[PATCH 09/12] drm/tilcdc: correct the dmachannel tracking logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darren Etheridge <detheridge@xxxxxx>

dma_channel_completed should be reset to channel 0 when the start
function is called and the dma channel in use should be tracked even
when no flip is pending.

Signed-off-by: Darren Etheridge <detheridge@xxxxxx>
[Rewrapped description]
Signed-off-by: Jyri Sarha <jsarha@xxxxxx>
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 50384fa..720a43a 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -133,6 +133,7 @@ static void start(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
 	struct tilcdc_drm_private *priv = dev->dev_private;
+	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
 
 	if (priv->rev == 2) {
 		tilcdc_set(dev, LCDC_CLK_RESET_REG, LCDC_CLK_MAIN_RESET);
@@ -141,6 +142,8 @@ static void start(struct drm_crtc *crtc)
 		msleep(1);
 	}
 
+	tilcdc_crtc->dma_completed_channel = 0;
+
 	tilcdc_set(dev, LCDC_DMA_CTRL_REG, LCDC_DUAL_FRAME_BUFFER_ENABLE);
 	tilcdc_set(dev, LCDC_RASTER_CTRL_REG, LCDC_PALETTE_LOAD_MODE(DATA_ONLY));
 	tilcdc_set(dev, LCDC_RASTER_CTRL_REG, LCDC_RASTER_ENABLE);
@@ -680,15 +683,17 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc)
 
 		spin_lock_irqsave(&tilcdc_crtc->irq_lock, irq_flags);
 
-		if (dirty & LCDC_END_OF_FRAME0) {
-			set_scanout(crtc, 0);
+		if (stat & LCDC_END_OF_FRAME0)
 			tilcdc_crtc->dma_completed_channel = 0;
-		}
 
-		if (dirty & LCDC_END_OF_FRAME1) {
-			set_scanout(crtc, 1);
+		if (stat & LCDC_END_OF_FRAME1)
 			tilcdc_crtc->dma_completed_channel = 1;
-		}
+
+		if (dirty & LCDC_END_OF_FRAME0)
+			set_scanout(crtc, 0);
+
+		if (dirty & LCDC_END_OF_FRAME1)
+			set_scanout(crtc, 1);
 
 		spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, irq_flags);
 
-- 
1.9.1

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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux