All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: dri-devel@lists.freedesktop.org
Cc: Jyri Sarha <jsarha@ti.com>,
	tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com
Subject: [PATCH v5 3/8] drm/tilcdc: Write to LCDC_END_OF_INT_IND_REG at the end of IRQ function
Date: Fri, 17 Jun 2016 12:22:38 +0300	[thread overview]
Message-ID: <992aae88f85d588cec5d6f221cd68afb166d5f6d.1466155291.git.jsarha@ti.com> (raw)
In-Reply-To: <cover.1466155291.git.jsarha@ti.com>

Reorder the IRQ function so that the write to LCDC_END_OF_INT_IND_REG
is done last. The write to LCDC_END_OF_INT_IND_REG indicates to LCDC
that the interrupt service routine has completed (see section
13.3.6.1.6 in AM335x TRM). This is needed if LCDC's ipgvmodirq module
is configured for pulse interrupts.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 6309d3c..65284e9 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -725,12 +725,16 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc)
 			tilcdc_crtc->frame_intact = true;
 	}
 
+	if (stat & LCDC_FIFO_UNDERFLOW)
+		dev_err_ratelimited(dev->dev, "%s(0x%08x): FIFO underfow",
+				    __func__, stat);
+
+	/* For revision 2 only */
 	if (priv->rev == 2) {
 		if (stat & LCDC_FRAME_DONE) {
 			tilcdc_crtc->frame_done = true;
 			wake_up(&tilcdc_crtc->frame_done_wq);
 		}
-		tilcdc_write(dev, LCDC_END_OF_INT_IND_REG, 0);
 
 		if (stat & LCDC_SYNC_LOST) {
 			dev_err_ratelimited(dev->dev, "%s(0x%08x): Sync lost",
@@ -743,11 +747,12 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc)
 					     LCDC_SYNC_LOST);
 			}
 		}
-	}
 
-	if (stat & LCDC_FIFO_UNDERFLOW)
-		dev_err_ratelimited(dev->dev, "%s(0x%08x): FIFO underfow",
-				    __func__, stat);
+		/* Indicate to LCDC that the interrupt service routine has
+		 * completed, see 13.3.6.1.6 in AM335x TRM.
+		 */
+		tilcdc_write(dev, LCDC_END_OF_INT_IND_REG, 0);
+	}
 
 	return IRQ_HANDLED;
 }
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-06-17  9:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  9:22 [PATCH v5 0/8] drm/tilcdc Fixes and cleanups Jyri Sarha
2016-06-17  9:22 ` [PATCH v5 1/8] drm/tilcdc: Restore old dpms state in pm_resume() Jyri Sarha
2016-06-17  9:22 ` [PATCH v5 2/8] drm/tilcdc: Move LCDC_SYNC_LOST handling inside if (ver == 2) statement Jyri Sarha
2016-06-17  9:22 ` Jyri Sarha [this message]
2016-06-17  9:22 ` [PATCH v5 4/8] drm/tilcdc: Move waiting of LCDC_FRAME_DONE IRQ into stop() Jyri Sarha
2016-06-17  9:22 ` [PATCH v5 5/8] drm/tilcdc: Increase time out for waiting frame done interrupt Jyri Sarha
2016-06-17  9:22 ` [PATCH v5 6/8] drm/tilcdc: Call drm_crtc_vblank_on() and *_off() in start() and stop() Jyri Sarha
2016-06-17  9:22 ` [PATCH v5 7/8] drm/tilcdc: Refer to panel.txt and tfp410.txt bindings in tilcdc.txt Jyri Sarha
2016-06-17  9:22 ` [PATCH v5 8/8] drm/tilcdc: Avoid error print by of_graph_get_next_endpoint() Jyri Sarha
2016-06-17  9:48 ` [PATCH v5 0/8] drm/tilcdc Fixes and cleanups Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=992aae88f85d588cec5d6f221cd68afb166d5f6d.1466155291.git.jsarha@ti.com \
    --to=jsarha@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.