403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/plugin_video.cpython-36.opt-1.pyc
3

��c�
�@sXddlmZddlTddlZddlmZddlZddlZej	j
�ZGdd�dej�Z
dS)�)�base)�*�N)�commandsc@sjeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
eddd�dd��Ze
d�ddd��ZdS)�VideoPlugina�
	`video`::
	
	Sets various powersave levels on video cards. Currently, only the
	Radeon cards are supported. The powersave level can be specified
	by using the [option]`radeon_powersave` option. Supported values are:
	+
	--
	* `default`
	* `auto`
	* `low`
	* `mid`
	* `high`
	* `dynpm`
	* `dpm-battery`
	* `dpm-balanced`
	* `dpm-perfomance`
	--
	+
	For additional detail, see
	link:https://www.x.org/wiki/RadeonFeature/#kmspowermanagementoptions[KMS Power Management Options].
	+
	NOTE: This plug-in is experimental and the option might change in future releases.
	+
	.To set the powersave level for the Radeon video card to high
	====
	----
	[video]
	radeon_powersave=high
	----
	====
	cCsTd|_t�|_t�|_x0|jjd�jd�jdd�D]}|jj|j	�q2Wt
�|_dS)NT�drmzcard*ZDEVTYPEZ	drm_minor)Z_devices_supported�setZ
_free_devicesZ_assigned_devices�_hardware_inventoryZget_devicesZmatch_sys_nameZmatch_property�addZsys_namer�_cmd)�self�device�r�"/usr/lib/python3.6/plugin_video.py�
_init_devices,s zVideoPlugin._init_devicescs�fdd�|D�S)Ncsg|]}�jjd|��qS)r)r	Z
get_device)�.0�x)rrr�
<listcomp>8sz3VideoPlugin._get_device_objects.<locals>.<listcomp>r)rZdevicesr)rr�_get_device_objects7szVideoPlugin._get_device_objectscCsddiS)N�radeon_powersaver)rrrr�_get_config_options:szVideoPlugin._get_config_optionscCsd|_d|_dS)NFT)Z_has_dynamic_tuningZ_has_static_tuning)r�instancerrr�_instance_init@szVideoPlugin._instance_initcCsdS)Nr)rrrrr�_instance_cleanupDszVideoPlugin._instance_cleanupcCsd|d|d|d�S)Nz%/sys/class/drm/%s/device/power_methodz&/sys/class/drm/%s/device/power_profilez(/sys/class/drm/%s/device/power_dpm_state)�method�profile�	dpm_stater)rr
rrr�_radeon_powersave_filesGsz#VideoPlugin._radeon_powersave_filesrT)Z
per_devicecCs|j|�}ttjdd|��j�}tjj|d�sF|sFtj	d|�dSx�|D]�}|dkr�|s�|j
j|dd
�r�|j
j|d
|�r�|SqL|dkr�|s�|j
j|dd�r�dSqL|dk�r�|�s|td�d�}|j
j|dd��r|j
j|d|��r|SqL|�stj	d�dSqLWdS)Nz#(\s*:\s*)|(\s+)|(\s*;\s*)|(\s*,\s*)� rz)radeon_powersave is not supported on '%s'�default�auto�low�mid�highr�dynpm�dpm-battery�dpm-balanced�dpm-performancezdpm-�dpmrz$Invalid option for radeon_powersave.)rr r!r"r#)r%r&r')
r�str�re�sub�split�os�path�exists�log�warnrZ
write_to_file�len)r�valuer
Zsim�	sys_filesZva�v�staterrr�_set_radeon_powersaveNs4



z!VideoPlugin._set_radeon_powersaveFcCsr|j|�}|jj|d|d�j�}|dkr>|jj|d�j�S|dkrJ|S|dkrjd|jj|d�j�SdSdS)Nr)Zno_errorrr$r(zdpm-r)rrZ	read_file�strip)rr
Zignore_missingr4rrrr�_get_radeon_powersavems
z!VideoPlugin._get_radeon_powersaveN)F)�__name__�
__module__�__qualname__�__doc__rr�classmethodrrrrZcommand_setr7Zcommand_getr9rrrrr
s r)�rZ
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsrr-r*Zlogs�getr0ZPluginrrrrr�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit