Commit fe14c0f0 authored by Melissa Wen's avatar Melissa Wen Committed by Alex Deucher
Browse files

Revert "drm/amd/display: Hardware cursor changes color when switched to software cursor"

This reverts commit 272e6aab.

Applying degamma curve to the cursor by default breaks Linux userspace
expectation.

On Linux, AMD display manager enables cursor degamma ROM just for
implict sRGB on HW versions where degamma is split into two blocks:
degamma ROM for pre-defined TFs and `gamma correction` for user/custom
curves, and degamma ROM settings doesn't apply to cursor plane.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1513
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803


Reported-by: default avatarMichel Dänzer <michel.daenzer@mailbox.org>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4144


Signed-off-by: default avatarMelissa Wen <mwen@igalia.com>
Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f6a305d4)
Cc: stable@vger.kernel.org
parent d33724ff
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -120,11 +120,12 @@ void dpp401_set_cursor_attributes(
	enum dc_cursor_color_format color_format = cursor_attributes->color_format;
	int cur_rom_en = 0;

	// DCN4 should always do Cursor degamma for Cursor Color modes
	if (color_format == CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ||
		color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA) {
		if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) {
			cur_rom_en = 1;
		}
	}

	REG_UPDATE_3(CURSOR0_CONTROL,
		CUR0_MODE, color_format,