[AMD Official Use Only - AMD Internal Distribution Only] Thanks Melissa! We will add the patch to next week's testing.
-- Regards, Jay ________________________________ From: Wentland, Harry <[email protected]> Sent: Wednesday, June 25, 2025 10:00 AM To: Melissa Wen <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]> Cc: Pillai, Aurabindo <[email protected]>; Michel Daenzer <[email protected]>; Xaver Hugl <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]> Subject: Re: [PATCH] drm/amd/display: disable CRTC degamma LUT for DCN401 On 2025-05-11 17:22, Melissa Wen wrote: > 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 > Signed-off-by: Melissa Wen <[email protected]> Sorry, Melissa, for the late response. I though we dealt with this patch already but it looks like we didn't. Thanks for the fix and your detailed explanation. Reviewed-by: Harry Wentland <[email protected]> Harry > --- > > Hi, > > 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 > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c > index e8bdd7f0c460..db157b38f862 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c > @@ -737,7 +737,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);
