Skip to content

Commit 0e444a4

Browse files
melissawenalexdeucher
authored andcommitted
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> Cc: stable@vger.kernel.org
1 parent f8d7edb commit 0e444a4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
412412
{
413413
struct amdgpu_crtc *acrtc = NULL;
414414
struct drm_plane *cursor_plane;
415-
415+
bool is_dcn;
416416
int res = -ENOMEM;
417417

418418
cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL);
@@ -450,8 +450,14 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
450450
acrtc->otg_inst = -1;
451451

452452
dm->adev->mode_info.crtcs[crtc_index] = acrtc;
453-
drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
453+
454+
/* Don't enable DRM CRTC degamma property for DCE since it doesn't
455+
* support programmable degamma anywhere.
456+
*/
457+
is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
458+
drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0,
454459
true, MAX_COLOR_LUT_ENTRIES);
460+
455461
drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
456462

457463
return 0;

0 commit comments

Comments
 (0)