File: //lib/python3.9/site-packages/tuned/plugins/__pycache__/plugin_video.cpython-39.opt-1.pyc
a
,�g� � @ s` d dl mZ d dlT ddlZddlmZ ddlZddlZddl Z ej
�� ZG dd� dej
�ZdS )� )�base)�*� N)�commandsc s� e Zd ZdZ� fdd�Zdd� Zdd� Zedd � �Zd
d� Z dd
� Z
dd� Zddd�Ze
ddd�dd� �Zed�d dd��Ze
ddd�dd� �Zed�d!dd��Z� ZS )"�VideoPluginaf
Sets various power saving features on video cards.
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.
.Setting powersave level for the Radeon video card to high
====
----
[video]
radeon_powersave=high
----
====
Mobile hardware with amdgpu driven eDP panels can be configured
with the [option]`panel_power_savings` option.
This accepts a value range from 0 to 4, where 4 is the highest power savings
but will trade off color accuracy.
c s t t| �j|i |�� d S �N)�superr �__init__)�self�args�kwargs�� __class__� �>/usr/lib/python3.9/site-packages/tuned/plugins/plugin_video.pyr / s zVideoPlugin.__init__c C sn d| _ t� | _t� | _| j�d��d�D ]8}| �|j�}|D ]"}t j
�|| �r<| j�|j� q<q(t
� | _d S )NT�drmzcard*-*)Z_devices_supported�setZ
_free_devicesZ_assigned_devices�_hardware_inventoryZget_devicesZmatch_sys_name�_filesZsys_name�os�path�exists�addr �_cmd)r
�device�attrs�attrr r r �
_init_devices2 s zVideoPlugin._init_devicesc s � fdd�|D �S )Nc s g | ]}� j �d |��qS )r )r Z
get_device)�.0�x�r
r r �
<listcomp>@ � z3VideoPlugin._get_device_objects.<locals>.<listcomp>r )r
Zdevicesr r r �_get_device_objects? s zVideoPlugin._get_device_objectsc C s
d d d�S )N)�radeon_powersave�panel_power_savingsr r r r r �_get_config_optionsB s �zVideoPlugin._get_config_optionsc C s d|_ d|_d S )NFT)Z_has_dynamic_tuningZ_has_static_tuning�r
�instancer r r �_instance_initI s zVideoPlugin._instance_initc C s d S r r r'