From patchwork Tue Feb 7 09:16:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 93539 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2145048obz; Tue, 7 Feb 2017 01:19:52 -0800 (PST) X-Received: by 10.98.163.216 with SMTP id q85mr18497908pfl.123.1486459192139; Tue, 07 Feb 2017 01:19:52 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g28si3480861pfd.227.2017.02.07.01.19.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 01:19:52 -0800 (PST) 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 0D7E06E625; Tue, 7 Feb 2017 09:19:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 952566E625 for ; Tue, 7 Feb 2017 09:19:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA485202F0; Tue, 7 Feb 2017 09:19:13 +0000 (UTC) Received: from localhost.localdomain (li411-102.members.linode.com [106.187.91.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 77E88202FE; Tue, 7 Feb 2017 09:19:00 +0000 (UTC) From: Shawn Guo To: Daniel Vetter Subject: [PATCH v3 10/23] drm: hibmc: use vblank hooks in struct drm_crtc_funcs Date: Tue, 7 Feb 2017 17:16:22 +0800 Message-Id: <1486458995-31018-11-git-send-email-shawnguo@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486458995-31018-1-git-send-email-shawnguo@kernel.org> References: <1486458995-31018-1-git-send-email-shawnguo@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: Neil Armstrong , Liviu Dudau , Laurent Pinchart , Daniel Vetter , Marek Vasut , Alexey Brodkin , Russell King , Xinliang Liu , Tomi Valkeinen , Mali DP Maintainers , Ben Skeggs , Jyri Sarha , dri-devel@lists.freedesktop.org, Maxime Ripard 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" From: Shawn Guo The vblank hooks in struct drm_driver are deprecated and only meant for legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks in struct drm_crtc_funcs should be used instead. Signed-off-by: Shawn Guo Cc: Xinliang Liu Reviewed-by: Sean Paul Reviewed-by: Xinliang Liu --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 20 ++++++++++++++++++++ drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 ---------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c index c655883d3613..59542bddc980 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c @@ -423,6 +423,24 @@ static void hibmc_crtc_atomic_flush(struct drm_crtc *crtc, spin_unlock_irqrestore(&crtc->dev->event_lock, flags); } +static int hibmc_crtc_enable_vblank(struct drm_crtc *crtc) +{ + struct hibmc_drm_private *priv = crtc->dev->dev_private; + + writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1), + priv->mmio + HIBMC_RAW_INTERRUPT_EN); + + return 0; +} + +static void hibmc_crtc_disable_vblank(struct drm_crtc *crtc) +{ + struct hibmc_drm_private *priv = crtc->dev->dev_private; + + writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0), + priv->mmio + HIBMC_RAW_INTERRUPT_EN); +} + static const struct drm_crtc_funcs hibmc_crtc_funcs = { .page_flip = drm_atomic_helper_page_flip, .set_config = drm_atomic_helper_set_config, @@ -430,6 +448,8 @@ static void hibmc_crtc_atomic_flush(struct drm_crtc *crtc, .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .enable_vblank = hibmc_crtc_enable_vblank, + .disable_vblank = hibmc_crtc_disable_vblank, }; static const struct drm_crtc_helper_funcs hibmc_crtc_helper_funcs = { diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 8cac70454b57..2ffdbf9801bd 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -37,26 +37,6 @@ .llseek = no_llseek, }; -static int hibmc_enable_vblank(struct drm_device *dev, unsigned int pipe) -{ - struct hibmc_drm_private *priv = - (struct hibmc_drm_private *)dev->dev_private; - - writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1), - priv->mmio + HIBMC_RAW_INTERRUPT_EN); - - return 0; -} - -static void hibmc_disable_vblank(struct drm_device *dev, unsigned int pipe) -{ - struct hibmc_drm_private *priv = - (struct hibmc_drm_private *)dev->dev_private; - - writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0), - priv->mmio + HIBMC_RAW_INTERRUPT_EN); -} - irqreturn_t hibmc_drm_interrupt(int irq, void *arg) { struct drm_device *dev = (struct drm_device *)arg; @@ -84,8 +64,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg) .desc = "hibmc drm driver", .major = 1, .minor = 0, - .enable_vblank = hibmc_enable_vblank, - .disable_vblank = hibmc_disable_vblank, .gem_free_object_unlocked = hibmc_gem_free_object, .dumb_create = hibmc_dumb_create, .dumb_map_offset = hibmc_dumb_mmap_offset,