From: jsg Date: Tue, 19 Sep 2023 12:39:18 +0000 (+0000) Subject: drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b9fd6188ab9ae03a8c8d40b3ea11adc7d1ac5791;p=openbsd 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 --- 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) {