Commit 3f797396 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amd/display: check if ext_caps is valid in BL setup

LVDS connectors don't have extended backlight caps so check
if the pointer is valid before accessing it.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5012


Fixes: 14546429 ("drm/amd: Re-introduce property to control adaptive backlight modulation")
Cc: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatarMario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8b9e5259
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5418,7 +5418,7 @@ static void setup_backlight_device(struct amdgpu_display_manager *dm,
	caps = &dm->backlight_caps[aconnector->bl_idx];

	/* Only offer ABM property when non-OLED and user didn't turn off by module parameter */
	if (!caps->ext_caps->bits.oled && amdgpu_dm_abm_level < 0)
	if (caps->ext_caps && !caps->ext_caps->bits.oled && amdgpu_dm_abm_level < 0)
		drm_object_attach_property(&aconnector->base.base,
					   dm->adev->mode_info.abm_level_property,
					   ABM_SYSFS_CONTROL);