]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Disable CRTC degamma LUT for DCN401
authorMelissa Wen <mwen@igalia.com>
Mon, 7 Jul 2025 20:52:05 +0000 (16:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:56:23 +0000 (08:56 +0200)
commit 97a0f2b5f4d4afcec34376e4428e157ce95efa71 upstream.

In DCN401 pre-blending degamma LUT isn't affecting cursor as in previous
DCN version. As this is not the behavior close to what is expected for
CRTC degamma LUT, disable CRTC degamma LUT property in this HW.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/4176
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c

index 2ac56e79df05e67257b02559c90cf17e4b234c98..9a31e5da368792e5a5fcc0241afad5d5c267c097 100644 (file)
@@ -731,7 +731,16 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
         * support programmable degamma anywhere.
         */
        is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
-       drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0,
+       /* Dont't enable DRM CRTC degamma property for DCN401 since the
+        * pre-blending degamma LUT doesn't apply to cursor, and therefore
+        * can't work similar to a post-blending degamma LUT as in other hw
+        * versions.
+        * TODO: revisit it once KMS plane color API is merged.
+        */
+       drm_crtc_enable_color_mgmt(&acrtc->base,
+                                  (is_dcn &&
+                                   dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01) ?
+                                    MAX_COLOR_LUT_ENTRIES : 0,
                                   true, MAX_COLOR_LUT_ENTRIES);
 
        drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);