From patchwork Tue Dec 15 19:03:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 58457 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp233752lbb; Tue, 15 Dec 2015 11:04:18 -0800 (PST) X-Received: by 10.66.148.167 with SMTP id tt7mr57620631pab.62.1450206244787; Tue, 15 Dec 2015 11:04:04 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id 83si3462668pfh.104.2015.12.15.11.04.04; Tue, 15 Dec 2015 11:04:04 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9999A7209B; Tue, 15 Dec 2015 11:04:03 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D06F72032 for ; Tue, 15 Dec 2015 11:04:02 -0800 (PST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id tBFJ3xa0028349; Tue, 15 Dec 2015 13:03:59 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tBFJ3xr7028053; Tue, 15 Dec 2015 13:03:59 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Tue, 15 Dec 2015 13:03:58 -0600 Received: from imryr.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id tBFJ3bb1015462; Tue, 15 Dec 2015 13:03:57 -0600 From: Jyri Sarha To: Subject: [PATCH 09/12] drm/tilcdc: correct the dmachannel tracking logic Date: Tue, 15 Dec 2015 21:03:20 +0200 Message-ID: <29001cedc1e85b98cf0789623f0c76ae987e473d.1450202735.git.jsarha@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 Cc: Jyri Sarha , Darren Etheridge , tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Darren Etheridge 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 [Rewrapped description] Signed-off-by: Jyri Sarha --- 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);