[1/3] drm/i915: Add DPI FIFO empty status check
diff mbox

Message ID 1449238659-12473-1-git-send-email-m.deepak@intel.com
State New
Headers show

Commit Message

Deepak M Dec. 4, 2015, 2:17 p.m. UTC
From: Gaurav K Singh <gaurav.k.singh@intel.com>

After sending SHUTDOWN or TURN ON packet,check the DPI
FIFO empty status.

Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ville Syrjälä Dec. 4, 2015, 9:49 a.m. UTC | #1
On Fri, Dec 04, 2015 at 07:47:37PM +0530, Deepak M wrote:
> From: Gaurav K Singh <gaurav.k.singh@intel.com>
> 
> After sending SHUTDOWN or TURN ON packet,check the DPI
> FIFO empty status.
> 
> Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 170ae6f..5c5b59a 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -222,6 +222,12 @@ static int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs,
>  	else
>  		cmd |= DPI_LP_MODE;
>  
> +	mask = DPI_FIFO_EMPTY;
> +
> +	if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(port)) & mask)
> +							== mask, 50))
> +		DRM_ERROR("Timeout waiting for DPI FIFO empty\n");
> +

This checks for it _before_ sending the command, but the commit message
says "after". Which is it supposed to be?

>  	/* clear bit */
>  	I915_WRITE(MIPI_INTR_STAT(port), SPL_PKT_SENT_INTERRUPT);
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Deepak M Dec. 4, 2015, 9:55 a.m. UTC | #2
> -----Original Message-----
> From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> Sent: Friday, December 4, 2015 3:20 PM
> To: Deepak, M <m.deepak@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; Gaurav K Singh
> <gaurav.k.singh@intel.com>
> Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915: Add DPI FIFO empty status
> check
> 
> On Fri, Dec 04, 2015 at 07:47:37PM +0530, Deepak M wrote:
> > From: Gaurav K Singh <gaurav.k.singh@intel.com>
> >
> > After sending SHUTDOWN or TURN ON packet,check the DPI FIFO empty
> > status.
> >
> > Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dsi.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
> > b/drivers/gpu/drm/i915/intel_dsi.c
> > index 170ae6f..5c5b59a 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -222,6 +222,12 @@ static int dpi_send_cmd(struct intel_dsi *intel_dsi,
> u32 cmd, bool hs,
> >  	else
> >  		cmd |= DPI_LP_MODE;
> >
> > +	mask = DPI_FIFO_EMPTY;
> > +
> > +	if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(port)) & mask)
> > +							== mask, 50))
> > +		DRM_ERROR("Timeout waiting for DPI FIFO empty\n");
> > +
> 
> This checks for it _before_ sending the command, but the commit message
> says "after". Which is it supposed to be?
[Deepak, M] The check should be before, mistake in the commit message.
> 
> >  	/* clear bit */
> >  	I915_WRITE(MIPI_INTR_STAT(port), SPL_PKT_SENT_INTERRUPT);
> >
> > --
> > 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
Kahola, Mika Jan. 20, 2016, 11:06 a.m. UTC | #3
On Fri, 2015-12-04 at 19:47 +0530, Deepak M wrote:
> From: Gaurav K Singh <gaurav.k.singh@intel.com>
> 
> After sending SHUTDOWN or TURN ON packet,check the DPI
> FIFO empty status.
> 
Tested-by: Mika Kahola <mika.kahola@intel.com>
> Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 170ae6f..5c5b59a 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -222,6 +222,12 @@ static int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs,
>  	else
>  		cmd |= DPI_LP_MODE;
>  
> +	mask = DPI_FIFO_EMPTY;
> +
> +	if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(port)) & mask)
> +							== mask, 50))
> +		DRM_ERROR("Timeout waiting for DPI FIFO empty\n");
> +
>  	/* clear bit */
>  	I915_WRITE(MIPI_INTR_STAT(port), SPL_PKT_SENT_INTERRUPT);
>

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 170ae6f..5c5b59a 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -222,6 +222,12 @@  static int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs,
 	else
 		cmd |= DPI_LP_MODE;
 
+	mask = DPI_FIFO_EMPTY;
+
+	if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(port)) & mask)
+							== mask, 50))
+		DRM_ERROR("Timeout waiting for DPI FIFO empty\n");
+
 	/* clear bit */
 	I915_WRITE(MIPI_INTR_STAT(port), SPL_PKT_SENT_INTERRUPT);