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: 9147539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3249060467 for ; Wed, 1 Jun 2016 14:48:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 246C126A46 for ; Wed, 1 Jun 2016 14:48:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1943126B41; Wed, 1 Jun 2016 14:48:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFF1A26A46 for ; Wed, 1 Jun 2016 14:48:58 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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