drm/i915: Add DPI FIFO empty status check

Submitted by Deepak M on Dec. 4, 2015, 4:11 p.m.

Details

Message ID 1449245477-16401-1-git-send-email-m.deepak@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 ) in Intel GFX

Not browsing as part of any series.

Commit Message

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

Before sending TURN ON packet,check the DPI
FIFO empty status.

v2: Change in commit message
    Checking for FIFO empty  only during TURN ON packet.

Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Deepak M <m.deepak@intel.com>
---
Got to know about the patch where they are removing this
DPI FIFO empty check while sending the SHUTDOWN packet.

http://lists.freedesktop.org/archives/intel-gfx/2014-July/048401.html

According added the check and waiting for DPI FIFIO empty
only when TURN_ON packet is sent.

 drivers/gpu/drm/i915/intel_dsi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 170ae6f..495056f 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 ((cmd & TURN_ON) && 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);
 

Comments

On Fri, Dec 04, 2015 at 09:41:17PM +0530, Deepak M wrote:
> From: Gaurav K Singh <gaurav.k.singh@intel.com>
> 
> Before sending TURN ON packet,check the DPI
> FIFO empty status.
> 
> v2: Change in commit message
>     Checking for FIFO empty  only during TURN ON packet.
> 
> Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
> Signed-off-by: Deepak M <m.deepak@intel.com>
> ---
> Got to know about the patch where they are removing this
> DPI FIFO empty check while sending the SHUTDOWN packet.
> 
> http://lists.freedesktop.org/archives/intel-gfx/2014-July/048401.html
> 
> According added the check and waiting for DPI FIFIO empty
> only when TURN_ON packet is sent.

Would seem cleaner to add a small function to do the wait, and
just call that before calling dpi_send_cmd(TURN_ON).

> 
>  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..495056f 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 ((cmd & TURN_ON) && 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);
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx