3 9sz3VideoPlugin._get_device_objects..r)r Zdevicesr)r r_get_device_objects8szVideoPlugin._get_device_objectscCsddiS)Nradeon_powersaver)r rrr_get_config_options;szVideoPlugin._get_config_optionscCsd|_d|_dS)NFT)Z_has_dynamic_tuningZ_has_static_tuning)r instancerrr_instance_initAszVideoPlugin._instance_initcCsdS)Nr)r rrrr_instance_cleanupEszVideoPlugin._instance_cleanupcCsd|d|d|dS)Nz%/sys/class/drm/%s/device/power_methodz&/sys/class/drm/%s/device/power_profilez(/sys/class/drm/%s/device/power_dpm_state)methodprofile dpm_stater)r r rrr_radeon_powersave_filesHsz#VideoPlugin._radeon_powersave_filesrT)Z per_devicec Csl|j|}ttjdd|j}tjj|dsF|sFtj d|dSx|D]}|dkr|s|j j |dd |rzt j gnd d r|j j |d ||rt j gnd d r|SqN|d kr|s|j j |dd |rt j gnd d rd SqN|dkrP|sd|tdd}|j j |dd|rt j gnd d rd|j j |d||r@t j gnd d rd|SqN|s`tj ddSqNWdS)Nz#(\s*:\s*)|(\s+)|(\s*;\s*)|(\s*,\s*) rz)radeon_powersave is not supported on '%s'defaultautolowmidhighrF)no_errordynpm dpm-battery dpm-balanceddpm-performancezdpm-dpmrz$Invalid option for radeon_powersave.)rr r!r"r#)r&r'r()rstrresubsplitospathexistslogwarnr Z write_to_fileerrnoENOENTlen) r valuer Zsimremove sys_filesZvavstaterrr_set_radeon_powersaveOs>   z!VideoPlugin._set_radeon_powersaveFcCsr|j|}|jj|d|dj}|dkr>|jj|djS|dkrJ|S|dkrjd|jj|djSdSdS)Nr)r$rr%r)zdpm-r)rr Z read_filestrip)r r Zignore_missingr8rrrr_get_radeon_powersavess z!VideoPlugin._get_radeon_powersaveN)F)__name__ __module__ __qualname____doc__rr classmethodrrrrZ command_setr;Z command_getr=rrrrr s   $r)rZ decoratorsZ tuned.logsZtunedZtuned.utils.commandsrr.r3r+Zlogsgetr1ZPluginrrrrrs