From patchwork Fri Jul 29 14:44:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 9252631 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 F30F760757 for ; Fri, 29 Jul 2016 15:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4B0828375 for ; Fri, 29 Jul 2016 15:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D986928383; Fri, 29 Jul 2016 15:49:50 +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 7263B28375 for ; Fri, 29 Jul 2016 15:49:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0F326E9F0; Fri, 29 Jul 2016 15:49:41 +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 75C386E9EF for ; Fri, 29 Jul 2016 15:49:04 +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 u6TEiM76008331; Fri, 29 Jul 2016 15:44:23 +0100 From: Liviu Dudau To: David Airlie , Mali DP Maintainers , Daniel Vetter Subject: [PATCH 2/2] drm: mali-dp: Set the drm->irq_enabled flag to match driver's state. Date: Fri, 29 Jul 2016 15:44:16 +0100 Message-Id: <20160729144416.2860-3-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160729144416.2860-1-Liviu.Dudau@arm.com> References: <20160729144416.2860-1-Liviu.Dudau@arm.com> Cc: LKML , DRI devel 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 Mali DP driver does not use drm_irq_{un,}install() function so the drm->irq_enabled flag does not get managed automatically. Among other DRM framework functions, drm_wait_vblank() checks the value of the flag and return -EINVAL if not set. Cc: Brian Starkey Signed-off-by: Liviu Dudau --- drivers/gpu/drm/arm/malidp_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 87c9249..a1c01e4 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -377,6 +377,8 @@ static int malidp_bind(struct device *dev) if (ret < 0) goto irq_init_fail; + drm->irq_enabled = true; + ret = drm_vblank_init(drm, drm->mode_config.num_crtc); if (ret < 0) { DRM_ERROR("failed to initialise vblank\n"); @@ -402,6 +404,7 @@ fbdev_fail: vblank_fail: malidp_se_irq_fini(drm); malidp_de_irq_fini(drm); + drm->irq_enabled = false; irq_init_fail: component_unbind_all(dev, drm); bind_fail: @@ -439,6 +442,7 @@ static void malidp_unbind(struct device *dev) drm_kms_helper_poll_fini(drm); malidp_se_irq_fini(drm); malidp_de_irq_fini(drm); + drm->irq_enabled = false; drm_vblank_cleanup(drm); component_unbind_all(dev, drm); of_node_put(malidp->crtc.port);