Skip to content

Commit 57a943e

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma
For DRM legacy gamma, AMD display manager applies implicit sRGB degamma using a pre-defined sRGB transfer function. It works fine for DCN2 family where degamma ROM and custom curves go to the same color block. But, on DCN3+, 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. To get DRM legacy gamma working as expected, enable cursor degamma ROM for implict sRGB degamma on HW with this configuration. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803 Fixes: 96b020e ("drm/amd/display: check attr flag before set cursor degamma on DCN3+") Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 47428f4 commit 57a943e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,13 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
12691269
attributes.rotation_angle = 0;
12701270
attributes.attribute_flags.value = 0;
12711271

1272+
/* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
1273+
* legacy gamma setup.
1274+
*/
1275+
if (crtc_state->cm_is_degamma_srgb &&
1276+
adev->dm.dc->caps.color.dpp.gamma_corr)
1277+
attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
1278+
12721279
attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
12731280

12741281
if (crtc_state->stream) {

0 commit comments

Comments
 (0)