diff mbox series

[1/3] drm/i915/xelpd: Enable Pipe color support for D13 platform

Message ID 20211123193649.3153258-2-uma.shankar@intel.com (mailing list archive)
State New, archived
Headers show
Series Enable pipe color support on D13 platform | expand

Commit Message

Shankar, Uma Nov. 23, 2021, 7:36 p.m. UTC
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.

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/i915/display/intel_color.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ville Syrjala Nov. 24, 2021, 2:58 p.m. UTC | #1
On Wed, Nov 24, 2021 at 01:06:47AM +0530, Uma Shankar wrote:
> 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.
> 
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index c870a0e50cb1..e529dbeee525 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -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 *dev_priv = to_i915(crtc->base.dev);

s/dev_priv/i915/ for new stuff please.

>  	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(dev_priv) >= 13)
> +		gamma_mode |= GAMMA_MODE_MODE_10BIT;

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  	else
>  		gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED;
>  
> -- 
> 2.25.1
Shankar, Uma Nov. 25, 2021, 7:48 p.m. UTC | #2
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Wednesday, November 24, 2021 8:29 PM
> To: Shankar, Uma <uma.shankar@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; =ville.syrjala@linux.intel.com
> Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915/xelpd: Enable Pipe color support for
> D13 platform
> 
> On Wed, Nov 24, 2021 at 01:06:47AM +0530, Uma Shankar wrote:
> > 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.
> >
> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_color.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_color.c
> > b/drivers/gpu/drm/i915/display/intel_color.c
> > index c870a0e50cb1..e529dbeee525 100644
> > --- a/drivers/gpu/drm/i915/display/intel_color.c
> > +++ b/drivers/gpu/drm/i915/display/intel_color.c
> > @@ -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 *dev_priv = to_i915(crtc->base.dev);
> 
> s/dev_priv/i915/ for new stuff please.

Sure, will update this.

> 
> >  	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(dev_priv) >= 13)
> > +		gamma_mode |= GAMMA_MODE_MODE_10BIT;
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> >  	else
> >  		gamma_mode |=
> GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED;
> >
> > --
> > 2.25.1
> 
> --
> Ville Syrjälä
> Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index c870a0e50cb1..e529dbeee525 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -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 *dev_priv = 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(dev_priv) >= 13)
+		gamma_mode |= GAMMA_MODE_MODE_10BIT;
 	else
 		gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED;