From patchwork Tue Dec 15 19:03:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 58458 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp233806lbb; Tue, 15 Dec 2015 11:04:23 -0800 (PST) X-Received: by 10.66.251.226 with SMTP id zn2mr56884868pac.44.1450206248484; Tue, 15 Dec 2015 11:04:08 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id 11si3466086pfp.49.2015.12.15.11.04.08; Tue, 15 Dec 2015 11:04:08 -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 5C78672041; Tue, 15 Dec 2015 11:04:07 -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 78BAF720A5 for ; Tue, 15 Dec 2015 11:04:04 -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 tBFJ41Rg028356; Tue, 15 Dec 2015 13:04:01 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tBFJ41H2028085; Tue, 15 Dec 2015 13:04:01 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 15 Dec 2015 13:04:01 -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 tBFJ3bb2015462; Tue, 15 Dec 2015 13:03:59 -0600 From: Jyri Sarha To: Subject: [PATCH 10/12] drm/tilcdc: make frame completion interrupt always enabled Date: Tue, 15 Dec 2015 21:03:21 +0200 Message-ID: <035887c267515417c8aa93997ad78a2b753cf0ce.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 DRM allows vblank handling to be controlled dynamically. Therefore if vblank interrupts are not needed by anybody they are disabled. However on tilcdc a ping-pong dma is used and there is no way to find out from the hardware which dma channel will be used for the next frame to program the corresponding dma registers with the new framebuffer address. The only way currently known is to use the vsync handler to track the channel currently used. This means that disabling the vsync is a bad idea because it is always needed to track the dma channel. This patch removes the enable/disable_vblank functions, moves the enabling of the FRAME0/FRAME1_DONE interrupts into the post_install_interrupt handler so they are always active and removes the calls to drm_vblank_get, drm_vblank_put. Signed-off-by: Darren Etheridge [Rewrapped descrription] Signed-off-by: Jyri Sarha --- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 6 ------ drivers/gpu/drm/tilcdc/tilcdc_drv.c | 26 +++----------------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 720a43a..8543d6b 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -89,7 +89,6 @@ static void set_scanout(struct drm_crtc *crtc, int n) static void update_scanout(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); - struct drm_device *dev = crtc->dev; struct drm_framebuffer *fb = crtc->primary->fb; struct drm_gem_cma_object *gem; unsigned int depth, bpp; @@ -120,8 +119,6 @@ static void update_scanout(struct drm_crtc *crtc) tilcdc_crtc->dirty |= LCDC_END_OF_FRAME0; set_scanout(crtc, 1); } - - drm_vblank_get(dev, 0); } else { /* not enabled yet, so update registers immediately: */ set_scanout(crtc, 0); @@ -706,8 +703,6 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) drm_send_vblank_event(dev, 0, event); spin_unlock_irqrestore(&dev->event_lock, flags); - if (dirty && !tilcdc_crtc->dirty) - drm_vblank_put(dev, 0); } if (priv->rev == 2) { @@ -736,7 +731,6 @@ void tilcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file) if (event && event->base.file_priv == file) { tilcdc_crtc->event = NULL; event->base.destroy(&event->base); - drm_vblank_put(dev, 0); } spin_unlock_irqrestore(&dev->event_lock, flags); } diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index f640b37..2b6d2dc 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -385,6 +385,8 @@ static int tilcdc_irq_postinstall(struct drm_device *dev) else tilcdc_set(dev, LCDC_INT_ENABLE_SET_REG, LCDC_V2_UNDERFLOW_INT_ENA | + LCDC_V2_END_OF_FRAME0_INT_ENA | + LCDC_V2_END_OF_FRAME1_INT_ENA | LCDC_FRAME_DONE); return 0; @@ -405,38 +407,16 @@ static void tilcdc_irq_uninstall(struct drm_device *dev) LCDC_V2_END_OF_FRAME0_INT_ENA | LCDC_V2_END_OF_FRAME1_INT_ENA | LCDC_FRAME_DONE); } - -} - -static void enable_vblank(struct drm_device *dev, bool enable) -{ - struct tilcdc_drm_private *priv = dev->dev_private; - u32 reg, mask; - - if (priv->rev == 1) { - reg = LCDC_DMA_CTRL_REG; - mask = LCDC_V1_END_OF_FRAME_INT_ENA; - } else { - reg = LCDC_INT_ENABLE_SET_REG; - mask = LCDC_V2_END_OF_FRAME0_INT_ENA | - LCDC_V2_END_OF_FRAME1_INT_ENA; - } - - if (enable) - tilcdc_set(dev, reg, mask); - else - tilcdc_clear(dev, reg, mask); } static int tilcdc_enable_vblank(struct drm_device *dev, unsigned int pipe) { - enable_vblank(dev, true); return 0; } static void tilcdc_disable_vblank(struct drm_device *dev, unsigned int pipe) { - enable_vblank(dev, false); + return; } #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_PM_SLEEP)