All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt
  2015-12-09 11:59 ` [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt Deepak M
@ 2015-12-09  8:19   ` Daniel Vetter
  2015-12-09  9:49     ` Deepak, M
  2015-12-09 14:44     ` [PATCH] " Deepak M
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Vetter @ 2015-12-09  8:19 UTC (permalink / raw)
  To: Deepak M; +Cc: intel-gfx

On Wed, Dec 09, 2015 at 05:29:58PM +0530, Deepak M wrote:
> Pipe is assigned based on the port, but it should be
> based on current crtc. Correcting the same in this patch.
> 
> Signed-off-by: Deepak M <m.deepak@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index f5df49b..0654b33 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -898,20 +898,25 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
>  			I915_WRITE(MIPI_CTRL(port), tmp |
>  					READ_REQUEST_PRIORITY_HIGH);
>  		} else if (IS_BROXTON(dev)) {
> -			/*
> -			 * FIXME:
> -			 * BXT can connect any PIPE to any MIPI port.
> -			 * Select the pipe based on the MIPI port read from
> -			 * VBT for now. Pick PIPE A for MIPI port A and C
> -			 * for port C.
> -			 */
> +			enum pipe pipe = intel_crtc->pipe;
> +
>  			tmp = I915_READ(MIPI_CTRL(port));
>  			tmp &= ~BXT_PIPE_SELECT_MASK;
>  
> -			if (port == PORT_A)
> +			switch (pipe) {
> +			case PIPE_A:
>  				tmp |= BXT_PIPE_SELECT_A;
> -			else if (port == PORT_C)
> +				break;
> +			case PIPE_B:
> +				tmp |= BXT_PIPE_SELECT_B;
> +				break;
> +			case PIPE_C:
>  				tmp |= BXT_PIPE_SELECT_C;

Please create a BXT_PIPE_SELECT(pipe) macro like we have for all the other
outputs that support more than 1 pipe selection bit. See e.g.
DP_PIPE_SELECT_CHV.
-Daniel

> +				break;
> +			default:
> +				DRM_ERROR("Unknown pipe used\n");
> +				return;
> +			}
>  
>  			I915_WRITE(MIPI_CTRL(port), tmp);
>  		}
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt
  2015-12-09  8:19   ` Daniel Vetter
@ 2015-12-09  9:49     ` Deepak, M
  2015-12-09 14:44     ` [PATCH] " Deepak M
  1 sibling, 0 replies; 9+ messages in thread
From: Deepak, M @ 2015-12-09  9:49 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx



> -----Original Message-----
> From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel
> Vetter
> Sent: Wednesday, December 9, 2015 1:50 PM
> To: Deepak, M <m.deepak@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [BXT MIPI PATCH 2/2] drm/i915: dual link pipe
> selection for bxt
> 
> On Wed, Dec 09, 2015 at 05:29:58PM +0530, Deepak M wrote:
> > Pipe is assigned based on the port, but it should be based on current
> > crtc. Correcting the same in this patch.
> >
> > Signed-off-by: Deepak M <m.deepak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dsi.c | 23 ++++++++++++++---------
> >  1 file changed, 14 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
> > b/drivers/gpu/drm/i915/intel_dsi.c
> > index f5df49b..0654b33 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -898,20 +898,25 @@ static void intel_dsi_prepare(struct intel_encoder
> *intel_encoder)
> >  			I915_WRITE(MIPI_CTRL(port), tmp |
> >  					READ_REQUEST_PRIORITY_HIGH);
> >  		} else if (IS_BROXTON(dev)) {
> > -			/*
> > -			 * FIXME:
> > -			 * BXT can connect any PIPE to any MIPI port.
> > -			 * Select the pipe based on the MIPI port read from
> > -			 * VBT for now. Pick PIPE A for MIPI port A and C
> > -			 * for port C.
> > -			 */
> > +			enum pipe pipe = intel_crtc->pipe;
> > +
> >  			tmp = I915_READ(MIPI_CTRL(port));
> >  			tmp &= ~BXT_PIPE_SELECT_MASK;
> >
> > -			if (port == PORT_A)
> > +			switch (pipe) {
> > +			case PIPE_A:
> >  				tmp |= BXT_PIPE_SELECT_A;
> > -			else if (port == PORT_C)
> > +				break;
> > +			case PIPE_B:
> > +				tmp |= BXT_PIPE_SELECT_B;
> > +				break;
> > +			case PIPE_C:
> >  				tmp |= BXT_PIPE_SELECT_C;
> 
> Please create a BXT_PIPE_SELECT(pipe) macro like we have for all the other
> outputs that support more than 1 pipe selection bit. See e.g.
> DP_PIPE_SELECT_CHV.
> -Daniel
> 
[Deepak, M] Agreed,  Have tried to address this comment http://lists.freedesktop.org/archives/intel-gfx/2015-December/082431.html 
> > +				break;
> > +			default:
> > +				DRM_ERROR("Unknown pipe used\n");
> > +				return;
> > +			}
> >
> >  			I915_WRITE(MIPI_CTRL(port), tmp);
> >  		}
> > --
> > 1.9.1
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT
@ 2015-12-09 11:59 Deepak M
  2015-12-09 11:59 ` [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt Deepak M
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Deepak M @ 2015-12-09 11:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: Deepak M

For broxton dual link Z-inversion overlap field is present
in MIPI_CTRL register unlike the other platforms, hence
setting the same in this patch.

Signed-off-by: Deepak M <m.deepak@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h  |  4 ++++
 drivers/gpu/drm/i915/intel_dsi.c | 16 +++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 009f474..fa72be9 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -8107,6 +8107,10 @@ enum skl_disp_power_wells {
 #define  BXT_PIPE_SELECT_B				(1 << 7)
 #define  BXT_PIPE_SELECT_A				(0 << 7)
 
+/* BXT has dual link Z inversion overlap field */
+#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
+#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10
+
 #define _MIPIA_DATA_ADDRESS		(dev_priv->mipi_mmio_base + 0xb108)
 #define _MIPIC_DATA_ADDRESS		(dev_priv->mipi_mmio_base + 0xb908)
 #define MIPI_DATA_ADDRESS(port)		_MIPI_PORT(port, _MIPIA_DATA_ADDRESS, \
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index eff982b..f5df49b 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -392,11 +392,21 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
 	u32 port_ctrl;
 
 	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
-		temp = I915_READ(VLV_CHICKEN_3);
-		temp &= ~PIXEL_OVERLAP_CNT_MASK |
+		if (IS_BROXTON(dev)) {
+			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) {
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt
  2015-12-09 11:59 [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Deepak M
@ 2015-12-09 11:59 ` Deepak M
  2015-12-09  8:19   ` Daniel Vetter
  2015-12-09 13:53 ` [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Ville Syrjälä
  2016-01-20 10:09 ` Mika Kahola
  2 siblings, 1 reply; 9+ messages in thread
From: Deepak M @ 2015-12-09 11:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: Deepak M

Pipe is assigned based on the port, but it should be
based on current crtc. Correcting the same in this patch.

Signed-off-by: Deepak M <m.deepak@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index f5df49b..0654b33 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -898,20 +898,25 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
 			I915_WRITE(MIPI_CTRL(port), tmp |
 					READ_REQUEST_PRIORITY_HIGH);
 		} else if (IS_BROXTON(dev)) {
-			/*
-			 * FIXME:
-			 * BXT can connect any PIPE to any MIPI port.
-			 * Select the pipe based on the MIPI port read from
-			 * VBT for now. Pick PIPE A for MIPI port A and C
-			 * for port C.
-			 */
+			enum pipe pipe = intel_crtc->pipe;
+
 			tmp = I915_READ(MIPI_CTRL(port));
 			tmp &= ~BXT_PIPE_SELECT_MASK;
 
-			if (port == PORT_A)
+			switch (pipe) {
+			case PIPE_A:
 				tmp |= BXT_PIPE_SELECT_A;
-			else if (port == PORT_C)
+				break;
+			case PIPE_B:
+				tmp |= BXT_PIPE_SELECT_B;
+				break;
+			case PIPE_C:
 				tmp |= BXT_PIPE_SELECT_C;
+				break;
+			default:
+				DRM_ERROR("Unknown pipe used\n");
+				return;
+			}
 
 			I915_WRITE(MIPI_CTRL(port), tmp);
 		}
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT
  2015-12-09 11:59 [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Deepak M
  2015-12-09 11:59 ` [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt Deepak M
@ 2015-12-09 13:53 ` Ville Syrjälä
  2016-01-20 10:09 ` Mika Kahola
  2 siblings, 0 replies; 9+ messages in thread
From: Ville Syrjälä @ 2015-12-09 13:53 UTC (permalink / raw)
  To: Deepak M; +Cc: intel-gfx

On Wed, Dec 09, 2015 at 05:29:57PM +0530, Deepak M wrote:
> For broxton dual link Z-inversion overlap field is present
> in MIPI_CTRL register unlike the other platforms, hence
> setting the same in this patch.
> 
> Signed-off-by: Deepak M <m.deepak@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h  |  4 ++++
>  drivers/gpu/drm/i915/intel_dsi.c | 16 +++++++++++++---
>  2 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 009f474..fa72be9 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -8107,6 +8107,10 @@ enum skl_disp_power_wells {
>  #define  BXT_PIPE_SELECT_B				(1 << 7)
>  #define  BXT_PIPE_SELECT_A				(0 << 7)
>  
> +/* BXT has dual link Z inversion overlap field */
> +#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
> +#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10

This could be parametrized. eg:
BXT_PIXEL_OVERLAP_CNT(x) ((x) << 10))

And so could the VLV version.

> +
>  #define _MIPIA_DATA_ADDRESS		(dev_priv->mipi_mmio_base + 0xb108)
>  #define _MIPIC_DATA_ADDRESS		(dev_priv->mipi_mmio_base + 0xb908)
>  #define MIPI_DATA_ADDRESS(port)		_MIPI_PORT(port, _MIPIA_DATA_ADDRESS, \
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index eff982b..f5df49b 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -392,11 +392,21 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
>  	u32 port_ctrl;
>  
>  	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
> -		temp = I915_READ(VLV_CHICKEN_3);
> -		temp &= ~PIXEL_OVERLAP_CNT_MASK |
> +		if (IS_BROXTON(dev)) {
> +			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;

That won't do anything sane.

> +				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) {
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: dual link pipe selection for bxt
  2015-12-09 14:44     ` [PATCH] " Deepak M
@ 2015-12-09 13:54       ` Ville Syrjälä
  2015-12-10 14:38         ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Ville Syrjälä @ 2015-12-09 13:54 UTC (permalink / raw)
  To: Deepak M; +Cc: intel-gfx

On Wed, Dec 09, 2015 at 08:14:04PM +0530, Deepak M wrote:
> Pipe is assigned based on the port, but it should be
> based on current crtc. Correcting the same in this patch.
> 
> v2: Use macro BXT_PIPE_SELECT(pipe) (Daniel)
> 
> Signed-off-by: Deepak M <m.deepak@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h  |  4 +---
>  drivers/gpu/drm/i915/intel_dsi.c | 15 +++------------
>  2 files changed, 4 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index fa72be9..91dbb32 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -8103,9 +8103,7 @@ enum skl_disp_power_wells {
>  #define  RGB_FLIP_TO_BGR				(1 << 2)
>  
>  #define  BXT_PIPE_SELECT_MASK				(7 << 7)
> -#define  BXT_PIPE_SELECT_C				(2 << 7)
> -#define  BXT_PIPE_SELECT_B				(1 << 7)
> -#define  BXT_PIPE_SELECT_A				(0 << 7)
> +#define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
>  
>  /* BXT has dual link Z inversion overlap field */
>  #define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index f5df49b..12cfcf5 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -898,21 +898,12 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
>  			I915_WRITE(MIPI_CTRL(port), tmp |
>  					READ_REQUEST_PRIORITY_HIGH);
>  		} else if (IS_BROXTON(dev)) {
> -			/*
> -			 * FIXME:
> -			 * BXT can connect any PIPE to any MIPI port.
> -			 * Select the pipe based on the MIPI port read from
> -			 * VBT for now. Pick PIPE A for MIPI port A and C
> -			 * for port C.
> -			 */
> +			enum pipe pipe = intel_crtc->pipe;
> +
>  			tmp = I915_READ(MIPI_CTRL(port));
>  			tmp &= ~BXT_PIPE_SELECT_MASK;
>  
> -			if (port == PORT_A)
> -				tmp |= BXT_PIPE_SELECT_A;
> -			else if (port == PORT_C)
> -				tmp |= BXT_PIPE_SELECT_C;
> -
> +			tmp |= BXT_PIPE_SELECT(pipe);
>  			I915_WRITE(MIPI_CTRL(port), tmp);

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

There's way too much RMW going on in the DSI code though. Someone should
probably do something about it.

>  		}
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] drm/i915: dual link pipe selection for bxt
  2015-12-09  8:19   ` Daniel Vetter
  2015-12-09  9:49     ` Deepak, M
@ 2015-12-09 14:44     ` Deepak M
  2015-12-09 13:54       ` Ville Syrjälä
  1 sibling, 1 reply; 9+ messages in thread
From: Deepak M @ 2015-12-09 14:44 UTC (permalink / raw)
  To: intel-gfx; +Cc: Deepak M

Pipe is assigned based on the port, but it should be
based on current crtc. Correcting the same in this patch.

v2: Use macro BXT_PIPE_SELECT(pipe) (Daniel)

Signed-off-by: Deepak M <m.deepak@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h  |  4 +---
 drivers/gpu/drm/i915/intel_dsi.c | 15 +++------------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index fa72be9..91dbb32 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -8103,9 +8103,7 @@ enum skl_disp_power_wells {
 #define  RGB_FLIP_TO_BGR				(1 << 2)
 
 #define  BXT_PIPE_SELECT_MASK				(7 << 7)
-#define  BXT_PIPE_SELECT_C				(2 << 7)
-#define  BXT_PIPE_SELECT_B				(1 << 7)
-#define  BXT_PIPE_SELECT_A				(0 << 7)
+#define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
 
 /* BXT has dual link Z inversion overlap field */
 #define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index f5df49b..12cfcf5 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -898,21 +898,12 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
 			I915_WRITE(MIPI_CTRL(port), tmp |
 					READ_REQUEST_PRIORITY_HIGH);
 		} else if (IS_BROXTON(dev)) {
-			/*
-			 * FIXME:
-			 * BXT can connect any PIPE to any MIPI port.
-			 * Select the pipe based on the MIPI port read from
-			 * VBT for now. Pick PIPE A for MIPI port A and C
-			 * for port C.
-			 */
+			enum pipe pipe = intel_crtc->pipe;
+
 			tmp = I915_READ(MIPI_CTRL(port));
 			tmp &= ~BXT_PIPE_SELECT_MASK;
 
-			if (port == PORT_A)
-				tmp |= BXT_PIPE_SELECT_A;
-			else if (port == PORT_C)
-				tmp |= BXT_PIPE_SELECT_C;
-
+			tmp |= BXT_PIPE_SELECT(pipe);
 			I915_WRITE(MIPI_CTRL(port), tmp);
 		}
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/i915: dual link pipe selection for bxt
  2015-12-09 13:54       ` Ville Syrjälä
@ 2015-12-10 14:38         ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2015-12-10 14:38 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Deepak M, intel-gfx

On Wed, Dec 09, 2015 at 03:54:33PM +0200, Ville Syrjälä wrote:
> On Wed, Dec 09, 2015 at 08:14:04PM +0530, Deepak M wrote:
> > Pipe is assigned based on the port, but it should be
> > based on current crtc. Correcting the same in this patch.
> > 
> > v2: Use macro BXT_PIPE_SELECT(pipe) (Daniel)
> > 
> > Signed-off-by: Deepak M <m.deepak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_reg.h  |  4 +---
> >  drivers/gpu/drm/i915/intel_dsi.c | 15 +++------------
> >  2 files changed, 4 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index fa72be9..91dbb32 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -8103,9 +8103,7 @@ enum skl_disp_power_wells {
> >  #define  RGB_FLIP_TO_BGR				(1 << 2)
> >  
> >  #define  BXT_PIPE_SELECT_MASK				(7 << 7)
> > -#define  BXT_PIPE_SELECT_C				(2 << 7)
> > -#define  BXT_PIPE_SELECT_B				(1 << 7)
> > -#define  BXT_PIPE_SELECT_A				(0 << 7)
> > +#define  BXT_PIPE_SELECT(pipe)				((pipe) << 7)
> >  
> >  /* BXT has dual link Z inversion overlap field */
> >  #define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> > index f5df49b..12cfcf5 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -898,21 +898,12 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
> >  			I915_WRITE(MIPI_CTRL(port), tmp |
> >  					READ_REQUEST_PRIORITY_HIGH);
> >  		} else if (IS_BROXTON(dev)) {
> > -			/*
> > -			 * FIXME:
> > -			 * BXT can connect any PIPE to any MIPI port.
> > -			 * Select the pipe based on the MIPI port read from
> > -			 * VBT for now. Pick PIPE A for MIPI port A and C
> > -			 * for port C.
> > -			 */
> > +			enum pipe pipe = intel_crtc->pipe;
> > +
> >  			tmp = I915_READ(MIPI_CTRL(port));
> >  			tmp &= ~BXT_PIPE_SELECT_MASK;
> >  
> > -			if (port == PORT_A)
> > -				tmp |= BXT_PIPE_SELECT_A;
> > -			else if (port == PORT_C)
> > -				tmp |= BXT_PIPE_SELECT_C;
> > -
> > +			tmp |= BXT_PIPE_SELECT(pipe);
> >  			I915_WRITE(MIPI_CTRL(port), tmp);
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> There's way too much RMW going on in the DSI code though. Someone should
> probably do something about it.

Yeah that'd be nice.

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT
  2015-12-09 11:59 [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Deepak M
  2015-12-09 11:59 ` [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt Deepak M
  2015-12-09 13:53 ` [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Ville Syrjälä
@ 2016-01-20 10:09 ` Mika Kahola
  2 siblings, 0 replies; 9+ messages in thread
From: Mika Kahola @ 2016-01-20 10:09 UTC (permalink / raw)
  To: Deepak M; +Cc: intel-gfx

On Wed, 2015-12-09 at 17:29 +0530, Deepak M wrote:
> For broxton dual link Z-inversion overlap field is present
> in MIPI_CTRL register unlike the other platforms, hence
> setting the same in this patch.
> 
Tested-by: Mika Kahola <mika.kahola@intel.com>
> Signed-off-by: Deepak M <m.deepak@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h  |  4 ++++
>  drivers/gpu/drm/i915/intel_dsi.c | 16 +++++++++++++---
>  2 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 009f474..fa72be9 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -8107,6 +8107,10 @@ enum skl_disp_power_wells {
>  #define  BXT_PIPE_SELECT_B				(1 << 7)
>  #define  BXT_PIPE_SELECT_A				(0 << 7)
>  
> +/* BXT has dual link Z inversion overlap field */
> +#define  BXT_PIXEL_OVERLAP_CNT_MASK			(0xf << 10)
> +#define  BXT_PIXEL_OVERLAP_CNT_SHIFT			10
> +
>  #define _MIPIA_DATA_ADDRESS		(dev_priv->mipi_mmio_base + 0xb108)
>  #define _MIPIC_DATA_ADDRESS		(dev_priv->mipi_mmio_base + 0xb908)
>  #define MIPI_DATA_ADDRESS(port)		_MIPI_PORT(port, _MIPIA_DATA_ADDRESS, \
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index eff982b..f5df49b 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -392,11 +392,21 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
>  	u32 port_ctrl;
>  
>  	if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
> -		temp = I915_READ(VLV_CHICKEN_3);
> -		temp &= ~PIXEL_OVERLAP_CNT_MASK |
> +		if (IS_BROXTON(dev)) {
> +			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) {


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-20 10:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 11:59 [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Deepak M
2015-12-09 11:59 ` [BXT MIPI PATCH 2/2] drm/i915: dual link pipe selection for bxt Deepak M
2015-12-09  8:19   ` Daniel Vetter
2015-12-09  9:49     ` Deepak, M
2015-12-09 14:44     ` [PATCH] " Deepak M
2015-12-09 13:54       ` Ville Syrjälä
2015-12-10 14:38         ` Daniel Vetter
2015-12-09 13:53 ` [BXT MIPI PATCH 1/2] drm/i915: Set the Z inversion overlap field for BXT Ville Syrjälä
2016-01-20 10:09 ` Mika Kahola

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.