Skip to content

Commit 97a0f2b

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: Disable CRTC degamma LUT for DCN401
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 --- When enabling HDR on KDE, it takes the first CRTC 1D LUT available and apply a color transformation (Gamma 2.2 -> PQ). AMD driver usually advertises a CRTC degamma LUT as the first CRTC 1D LUT, but it's actually applied pre-blending. In previous HW version, it seems to work fine because the 1D LUT was applied to cursor too, but DCN401 presents a different behavior and the 1D LUT isn't affecting the hardware cursor. To address the wrong gamma on cursor with HDR (see the link), I came up with this patch that disables CRTC degamma LUT in this hw, since it presents a different behavior than others. With this KDE sees CRTC regamma LUT as the first post-blending 1D LUT available. This is actually more consistent with AMD color pipeline. It was tested by the reporter, since I don't have the HW available for local testing and debugging. Melissa --- Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Melissa Wen <[email protected]> Signed-off-by: Ivan Lipski <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 340231c) Cc: [email protected]
1 parent b2ee9fa commit 97a0f2b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,16 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
728728
* support programmable degamma anywhere.
729729
*/
730730
is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
731-
drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0,
731+
/* Dont't enable DRM CRTC degamma property for DCN401 since the
732+
* pre-blending degamma LUT doesn't apply to cursor, and therefore
733+
* can't work similar to a post-blending degamma LUT as in other hw
734+
* versions.
735+
* TODO: revisit it once KMS plane color API is merged.
736+
*/
737+
drm_crtc_enable_color_mgmt(&acrtc->base,
738+
(is_dcn &&
739+
dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01) ?
740+
MAX_COLOR_LUT_ENTRIES : 0,
732741
true, MAX_COLOR_LUT_ENTRIES);
733742

734743
drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);

0 commit comments

Comments
 (0)