From patchwork Wed Jun 1 14:48:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 69036 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp138505qge; Wed, 1 Jun 2016 07:48:58 -0700 (PDT) X-Received: by 10.157.44.72 with SMTP id f66mr2527085otb.126.1464792538796; Wed, 01 Jun 2016 07:48:58 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id ya1si9364913pab.93.2016.06.01.07.48.58; Wed, 01 Jun 2016 07:48:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 1E2576E9D2; Wed, 1 Jun 2016 14:48:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by gabe.freedesktop.org (Postfix) with ESMTPS id BD1AA6E9D3 for ; Wed, 1 Jun 2016 14:48:45 +0000 (UTC) Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.2.131.153]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id u51Emepm026613; Wed, 1 Jun 2016 15:48:41 +0100 From: Liviu Dudau To: Daniel Vetter , David Airlie Subject: [PATCH v2 4/5] drm: hdlcd: Don't touch vsync interrupts during vblank enable/disable. Date: Wed, 1 Jun 2016 15:48:38 +0100 Message-Id: <1464792519-24530-5-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1464792519-24530-1-git-send-email-Liviu.Dudau@arm.com> References: <1464792519-24530-1-git-send-email-Liviu.Dudau@arm.com> Cc: DRI Development 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Because the HDLCD lacks a hardware counter for vsync signal, the DRM framework expects that the vsync interrupts are left running to feed the internal software counter. Currently the HDLCD is masking/unmasking the vsync interrupt on vblank enable/disable calls, which break that expectation. Fix that. Signed-off-by: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_drv.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index fb172d2..3f92dfa 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -183,9 +183,13 @@ static int hdlcd_irq_postinstall(struct drm_device *drm) /* enable debug interrupts */ irq_mask |= HDLCD_DEBUG_INT_MASK; +#endif + + /* enable vsync interrupts */ + irq_mask |= HDLCD_INTERRUPT_VSYNC; hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask); -#endif + return 0; } @@ -208,20 +212,11 @@ static void hdlcd_irq_uninstall(struct drm_device *drm) static int hdlcd_enable_vblank(struct drm_device *drm, unsigned int crtc) { - struct hdlcd_drm_private *hdlcd = drm->dev_private; - unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK); - - hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask | HDLCD_INTERRUPT_VSYNC); - return 0; } static void hdlcd_disable_vblank(struct drm_device *drm, unsigned int crtc) { - struct hdlcd_drm_private *hdlcd = drm->dev_private; - unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK); - - hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask & ~HDLCD_INTERRUPT_VSYNC); } #ifdef CONFIG_DEBUG_FS