drm/i915/xelpd: Enable Pipe color support for D13 platform
authorUma Shankar <uma.shankar@intel.com>
Tue, 7 Dec 2021 07:11:33 +0000 (12:41 +0530)
committerUma Shankar <uma.shankar@intel.com>
Tue, 7 Dec 2021 07:20:30 +0000 (12:50 +0530)
Enable pipe color support for Display 13 platforms. Currently
limit to just 10bit gamma and later extend it for logarithmic
gamma, once the new UAPI is agreed by community and implemented
by a userspace consumer.

v2: Updated dev_priv to i915 (Ville)

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-2-uma.shankar@intel.com
drivers/gpu/drm/i915/display/intel_color.c

index 840f13b754929b7419aa802973a80b7bac10bcc7..42fe549ef6fe9062d9e8ed036f8af29d7c19555f 100644 (file)
@@ -1574,6 +1574,8 @@ static int glk_color_check(struct intel_crtc_state *crtc_state)
 
 static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state)
 {
+       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+       struct drm_i915_private *i915 = to_i915(crtc->base.dev);
        u32 gamma_mode = 0;
 
        if (crtc_state->hw.degamma_lut)
@@ -1586,6 +1588,13 @@ static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state)
        if (!crtc_state->hw.gamma_lut ||
            crtc_state_is_legacy_gamma(crtc_state))
                gamma_mode |= GAMMA_MODE_MODE_8BIT;
+       /*
+        * Enable 10bit gamma for D13
+        * ToDo: Extend to Logarithmic Gamma once the new UAPI
+        * is acccepted and implemented by a userspace consumer
+        */
+       else if (DISPLAY_VER(i915) >= 13)
+               gamma_mode |= GAMMA_MODE_MODE_10BIT;
        else
                gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED;