Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Don't change brightness for disabled connectors

[WHY]
When a laptop lid is closed the connector is disabled but userspace
can still try to change brightness. This doesn't work because the
panel is turned off. It will eventually time out, but there is a lot
of stutter along the way.

[How]
Iterate all connectors to check whether the matching one for the backlight
index is enabled.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4675
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ray Wu <ray.wu@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Mario Limonciello (AMD) and committed by
Alex Deucher
f6eeab30 1a794826

+15
+15
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 5125 5125 struct dc_link *link; 5126 5126 u32 brightness; 5127 5127 bool rc, reallow_idle = false; 5128 + struct drm_connector *connector; 5129 + 5130 + list_for_each_entry(connector, &dm->ddev->mode_config.connector_list, head) { 5131 + struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); 5132 + 5133 + if (aconnector->bl_idx != bl_idx) 5134 + continue; 5135 + 5136 + /* if connector is off, save the brightness for next time it's on */ 5137 + if (!aconnector->base.encoder) { 5138 + dm->brightness[bl_idx] = user_brightness; 5139 + dm->actual_brightness[bl_idx] = 0; 5140 + return; 5141 + } 5142 + } 5128 5143 5129 5144 amdgpu_dm_update_backlight_caps(dm, bl_idx); 5130 5145 caps = &dm->backlight_caps[bl_idx];