The degamma is to be handled by Color pipeline API.

Signed-off-by: Alex Hung <alex.h...@amd.com>
---
V10:
 - Disable CRTC degamma when color pipeline is enabled (Melissa Wen)

 .../drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c    | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

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 87058271b00c..62bb4855306d 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
@@ -685,7 +685,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 {
        struct amdgpu_crtc *acrtc = NULL;
        struct drm_plane *cursor_plane;
-       bool is_dcn;
+       bool has_degamma;
        int res = -ENOMEM;
 
        cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL);
@@ -724,11 +724,16 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 
        dm->adev->mode_info.crtcs[crtc_index] = acrtc;
 
-       /* Don't enable DRM CRTC degamma property for DCE since it doesn't
-        * support programmable degamma anywhere.
+       /* Don't enable DRM CRTC degamma property for
+        * 1. Degamma is replaced by color pipeline.
+        * 2. DCE since it doesn't 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,
+       if (plane->color_pipeline_property)
+               has_degamma = false;
+       else
+               has_degamma = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
+
+       drm_crtc_enable_color_mgmt(&acrtc->base, has_degamma ? 
MAX_COLOR_LUT_ENTRIES : 0,
                                   true, MAX_COLOR_LUT_ENTRIES);
 
        drm_mode_crtc_set_gamma_size(&acrtc->base, 
MAX_COLOR_LEGACY_LUT_ENTRIES);
-- 
2.43.0

Reply via email to