From b9fd6188ab9ae03a8c8d40b3ea11adc7d1ac5791 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 19 Sep 2023 12:39:18 +0000 Subject: [PATCH] drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma From Melissa Wen e1769b1dfcaebb7e4272528fa2f198c6549f619b in linux-6.1.y/6.1.54 57a943ebfcdb4a97fbb409640234bdb44bfa1953 in mainline linux --- sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 3c50b3ff795..cd6e99cf74a 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1269,6 +1269,13 @@ void handle_cursor_update(struct drm_plane *plane, attributes.rotation_angle = 0; attributes.attribute_flags.value = 0; + /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM + * legacy gamma setup. + */ + if (crtc_state->cm_is_degamma_srgb && + adev->dm.dc->caps.color.dpp.gamma_corr) + attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1; + attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0]; if (crtc_state->stream) { -- 2.20.1