diff mbox

[GLK,MIPI,DSI,V3,4/7] drm/i915: Set the Z inversion overlap field

Message ID 1483361668-2095-5-git-send-email-madhav.chauhan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chauhan, Madhav Jan. 2, 2017, 12:54 p.m. UTC
From: Deepak M <m.deepak@intel.com>

Dual link Z-inversion overlap field is present
in MIPI_CTRL register unlike the older platforms,
hence setting the same in this patch.

Signed-off-by: Deepak M <m.deepak@intel.com>
Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Comments

Jani Nikula Jan. 18, 2017, 3:50 p.m. UTC | #1
On Mon, 02 Jan 2017, Madhav Chauhan <madhav.chauhan@intel.com> wrote:
> From: Deepak M <m.deepak@intel.com>
>
> Dual link Z-inversion overlap field is present
> in MIPI_CTRL register unlike the older platforms,
> hence setting the same in this patch.
>
> Signed-off-by: Deepak M <m.deepak@intel.com>
> Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 3ae70ae..95a6cad 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -558,12 +558,21 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
>  
>  	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
>  		u32 temp;
> -
> -		temp = I915_READ(VLV_CHICKEN_3);
> -		temp &= ~PIXEL_OVERLAP_CNT_MASK |
> +		if (IS_GEN9_LP(dev_priv)) {
> +			for_each_dsi_port(port, intel_dsi->ports) {
> +				temp = I915_READ(MIPI_CTRL(port));
> +				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK |
> +					intel_dsi->pixel_overlap <<
> +					BXT_PIXEL_OVERLAP_CNT_SHIFT;
> +				I915_WRITE(MIPI_CTRL(port), temp);

I think I'd do this where MIPI_CTRL is updated. If we set
->pixel_overlap to 0 for intel_dsi->dual_link !=
DSI_DUAL_LINK_FRONT_BACK in vbt_panel_init(), we can just write it
instead of checking dual_link.

BR,
Jani.

> +			}
> +		} else {
> +			temp = I915_READ(VLV_CHICKEN_3);
> +			temp &= ~PIXEL_OVERLAP_CNT_MASK |
>  					intel_dsi->pixel_overlap <<
>  					PIXEL_OVERLAP_CNT_SHIFT;
> -		I915_WRITE(VLV_CHICKEN_3, temp);
> +			I915_WRITE(VLV_CHICKEN_3, temp);
> +		}
>  	}
>  
>  	for_each_dsi_port(port, intel_dsi->ports) {
Chauhan, Madhav Jan. 20, 2017, 10:06 a.m. UTC | #2
> -----Original Message-----
> From: Nikula, Jani
> Sent: Wednesday, January 18, 2017 9:21 PM
> To: Chauhan, Madhav <madhav.chauhan@intel.com>; intel-
> gfx@lists.freedesktop.org
> Cc: Shankar, Uma <uma.shankar@intel.com>; Mukherjee, Indranil
> <indranil.mukherjee@intel.com>; Kamath, Sunil <sunil.kamath@intel.com>;
> Saarinen, Jani <jani.saarinen@intel.com>; Conselvan De Oliveira, Ander
> <ander.conselvan.de.oliveira@intel.com>; Konduru, Chandra
> <chandra.konduru@intel.com>; Kumar, Shobhit
> <shobhit.kumar@intel.com>; Syrjala, Ville <ville.syrjala@intel.com>; Deepak
> M <m.deepak@intel.com>; Chauhan, Madhav
> <madhav.chauhan@intel.com>
> Subject: Re: [GLK MIPI DSI V3 4/7] drm/i915: Set the Z inversion overlap field
> 
> On Mon, 02 Jan 2017, Madhav Chauhan <madhav.chauhan@intel.com>
> wrote:
> > From: Deepak M <m.deepak@intel.com>
> >
> > Dual link Z-inversion overlap field is present in MIPI_CTRL register
> > unlike the older platforms, hence setting the same in this patch.
> >
> > Signed-off-by: Deepak M <m.deepak@intel.com>
> > Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dsi.c | 17 +++++++++++++----
> >  1 file changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
> > b/drivers/gpu/drm/i915/intel_dsi.c
> > index 3ae70ae..95a6cad 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -558,12 +558,21 @@ static void intel_dsi_port_enable(struct
> > intel_encoder *encoder)
> >
> >  	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
> >  		u32 temp;
> > -
> > -		temp = I915_READ(VLV_CHICKEN_3);
> > -		temp &= ~PIXEL_OVERLAP_CNT_MASK |
> > +		if (IS_GEN9_LP(dev_priv)) {
> > +			for_each_dsi_port(port, intel_dsi->ports) {
> > +				temp = I915_READ(MIPI_CTRL(port));
> > +				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK |
> > +					intel_dsi->pixel_overlap <<
> > +					BXT_PIXEL_OVERLAP_CNT_SHIFT;
> > +				I915_WRITE(MIPI_CTRL(port), temp);
> 
> I think I'd do this where MIPI_CTRL is updated. If we set

What to do when MIPI_CTRL is updated and where?? Please specify.

> ->pixel_overlap to 0 for intel_dsi->dual_link !=
> DSI_DUAL_LINK_FRONT_BACK in vbt_panel_init(), we can just write it instead
> of checking dual_link.

Yes we can do this but any way we need to put if condition inside vbt_panel_init. Additional advantage??
It would be more useful if we replace all if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK)  checks inside the driver code 
When ->pixel_overlap is used. Am I missing something?? Please clarify.

> 
> BR,
> Jani.
> 
> > +			}
> > +		} else {
> > +			temp = I915_READ(VLV_CHICKEN_3);
> > +			temp &= ~PIXEL_OVERLAP_CNT_MASK |
> >  					intel_dsi->pixel_overlap <<
> >  					PIXEL_OVERLAP_CNT_SHIFT;
> > -		I915_WRITE(VLV_CHICKEN_3, temp);
> > +			I915_WRITE(VLV_CHICKEN_3, temp);
> > +		}
> >  	}
> >
> >  	for_each_dsi_port(port, intel_dsi->ports) {
> 
> --
> Jani Nikula, Intel Open Source Technology Center
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 3ae70ae..95a6cad 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -558,12 +558,21 @@  static void intel_dsi_port_enable(struct intel_encoder *encoder)
 
 	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
 		u32 temp;
-
-		temp = I915_READ(VLV_CHICKEN_3);
-		temp &= ~PIXEL_OVERLAP_CNT_MASK |
+		if (IS_GEN9_LP(dev_priv)) {
+			for_each_dsi_port(port, intel_dsi->ports) {
+				temp = I915_READ(MIPI_CTRL(port));
+				temp &= ~BXT_PIXEL_OVERLAP_CNT_MASK |
+					intel_dsi->pixel_overlap <<
+					BXT_PIXEL_OVERLAP_CNT_SHIFT;
+				I915_WRITE(MIPI_CTRL(port), temp);
+			}
+		} else {
+			temp = I915_READ(VLV_CHICKEN_3);
+			temp &= ~PIXEL_OVERLAP_CNT_MASK |
 					intel_dsi->pixel_overlap <<
 					PIXEL_OVERLAP_CNT_SHIFT;
-		I915_WRITE(VLV_CHICKEN_3, temp);
+			I915_WRITE(VLV_CHICKEN_3, temp);
+		}
 	}
 
 	for_each_dsi_port(port, intel_dsi->ports) {