Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: don't enable DRM CRTC degamma property for DCE

DM maps DRM CRTC degamma to DPP (pre-blending) degamma block, but DCE doesn't
support programmable degamma curve anywhere. Currently, a custom degamma is
accepted by DM but just ignored by DCE driver and degamma correction isn't
actually applied. There is no way to map custom degamma in DCE, therefore, DRM
CRTC degamma property shouldn't be enabled for DCE drivers.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Melissa Wen and committed by
Alex Deucher
c17b7a58 9a31c06f

+8 -2
+8 -2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
··· 415 415 { 416 416 struct amdgpu_crtc *acrtc = NULL; 417 417 struct drm_plane *cursor_plane; 418 - 418 + bool is_dcn; 419 419 int res = -ENOMEM; 420 420 421 421 cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL); ··· 453 453 acrtc->otg_inst = -1; 454 454 455 455 dm->adev->mode_info.crtcs[crtc_index] = acrtc; 456 - drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES, 456 + 457 + /* Don't enable DRM CRTC degamma property for DCE since it doesn't 458 + * support programmable degamma anywhere. 459 + */ 460 + is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch; 461 + drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0, 457 462 true, MAX_COLOR_LUT_ENTRIES); 463 + 458 464 drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES); 459 465 460 466 return 0;