@@ -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);