Skip to content

Commit 96b020e

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: check attr flag before set cursor degamma on DCN3+
Don't set predefined degamma curve to cursor plane if the cursor attribute flag is not set. Applying a degamma curve to the cursor by default breaks userspace expectation. Checking the flag before performing any color transformation prevents too dark cursor gamma in DCN3+ on many Linux desktop environment (KDE Plasma, GNOME, wlroots-based, etc.) as reported at: - https://gitlab.freedesktop.org/drm/amd/-/issues/1513 This is the same approach followed by DCN2 drivers where the issue is not present. Fixes: 03f54d7 ("drm/amd/display: Add DCN3 DPP") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1513 Signed-off-by: Melissa Wen <mwen@igalia.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Tested-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 61319b8 commit 96b020e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,11 @@ void dpp3_set_cursor_attributes(
357357
int cur_rom_en = 0;
358358

359359
if (color_format == CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ||
360-
color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA)
361-
cur_rom_en = 1;
360+
color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA) {
361+
if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) {
362+
cur_rom_en = 1;
363+
}
364+
}
362365

363366
REG_UPDATE_3(CURSOR0_CONTROL,
364367
CUR0_MODE, color_format,

0 commit comments

Comments
 (0)