summaryrefslogtreecommitdiff
path: root/tests/amdgpu/amd_abm.c
AgeCommit message (Collapse)Author
2019-04-18amdgpu/amd_abm: Fix getting and setting abm level propertyNicholas Kazlauskas
This patch addresses a few problems: 1. Inner loop that iterates over the properties uses the same iterator as the outer loop over connectors. If the eDP panel isn't on the first output, then it won't be checked and the tests will skip. 2. We can get null pointer deferences if any of the DRM calls return NULL. 3. The proplist isn't freed after being acquired. These can be fixed by using the kmstest_get_property helper to get the prop_id. The prop_id and KMS connector ID are then stored for use later in the test when we need to set the ABM level. All the necessary cached state has been placed into a data structure and many callsites have been updated to make use of this. Cc: David Francis <david.francis@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: David Francis <david.francis@amd.com>
2019-01-08tests/amdgpu: Add test for Adaptive Backlight ManagementDavid Francis
Adaptive Backlight Management (ABM) is a power-saving feature on AMD ASICs that reduces backlight while increasing pixel contrast and luminance. This test confirms that ABM is present and enabled, and that backlight performance is sane. It uses AMD-specific debugfs entries to read the backlight PWM values. It has 5 subtests: dpms_cycle Sets brightness to half, then confirms that value is restored after dpms off and then on. backlight_monotonic_basic Sets brightness to ten different values, confirming that higher brightness values are brighter. backlight_monotonic_abm Same as backlight_monotonic_basic, but with abm enabled. abm_enabled Sets abm to its four intensity levels, confirming that abm reduces the backlight, and the reduction is greater for higher abm level. abm_gradual Sets abm to off and then maximum intensity, confirming that brightness decreases continually over the first second and eventually reaches the target value. This test takes 30s to run. v2: make sure that dpms is cycled on the eDP display Signed-off-by: David Francis <David.Francis@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com>