]> git.hungrycats.org Git - linux/commit
drm/amd/display: Fix KUnit backlight tests for CACP
authorAlex Hung <alex.hung@amd.com>
Tue, 16 Jun 2026 15:34:09 +0000 (09:34 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Jul 2026 23:12:34 +0000 (19:12 -0400)
commitb48b1cad84609ed422f8d4086205cc06d425487e
tree673072b8c83a10e77f421469bfb99c3253792b5f
parentf8ee6447e7ec1d75d6663c817e45566dd01f440b
drm/amd/display: Fix KUnit backlight tests for CACP

[WHY]
A change was added in amdgpu_dm_should_create_sysfs() to
check link->panel_type instead of caps->aux_support, and removed
the OLED exclusion from the ABM property attach path in
amdgpu_dm_setup_backlight_device().

This broke three KUnit tests:
- dm_test_should_create_sysfs_no_backlight_index and
  dm_test_should_create_sysfs_pwm_backlight returned false
  because kzalloc zeroes panel_type but PANEL_TYPE_LCD is 1.
- dm_test_setup_backlight_device_oled_success crashed with a
  NULL pointer dereference in drm_object_attach_property since
  abm_level_property was NULL.

[WHY]
Set panel_type to PANEL_TYPE_LCD in the two sysfs tests and
skip the ABM property attach path in the OLED setup test by
setting amdgpu_dm_abm_level to 0.

Cc: Chenyu Chen <chen-yu.chen@amd.com>
Assisted-by: Copilot:Claude-Opus-4.6
Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c