From patchwork Tue Feb 7 09:16:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 93544 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2107470qgi; Tue, 7 Feb 2017 01:21:11 -0800 (PST) X-Received: by 10.98.94.2 with SMTP id s2mr18556832pfb.133.1486459271681; Tue, 07 Feb 2017 01:21:11 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 23si3515943pfi.14.2017.02.07.01.21.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 01:21:11 -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 B016A6E62C; Tue, 7 Feb 2017 09:21:10 +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 898A36E62C for ; Tue, 7 Feb 2017 09:21:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8360E202FF; Tue, 7 Feb 2017 09:21:08 +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 6A0C920142; Tue, 7 Feb 2017 09:20:57 +0000 (UTC) From: Shawn Guo To: Daniel Vetter Subject: [PATCH v3 19/23] drm: sun4i: use vblank hooks in struct drm_crtc_funcs Date: Tue, 7 Feb 2017 17:16:31 +0800 Message-Id: <1486458995-31018-20-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: Maxime Ripard Acked-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_crtc.c | 24 ++++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun4i_drv.c | 27 --------------------------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index 4a192210574f..a5d546a68e16 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -104,6 +104,28 @@ static void sun4i_crtc_enable(struct drm_crtc *crtc) .enable = sun4i_crtc_enable, }; +static int sun4i_crtc_enable_vblank(struct drm_crtc *crtc) +{ + struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); + struct sun4i_drv *drv = scrtc->drv; + + DRM_DEBUG_DRIVER("Enabling VBLANK on crtc %p\n", crtc); + + sun4i_tcon_enable_vblank(drv->tcon, true); + + return 0; +} + +static void sun4i_crtc_disable_vblank(struct drm_crtc *crtc) +{ + struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); + struct sun4i_drv *drv = scrtc->drv; + + DRM_DEBUG_DRIVER("Disabling VBLANK on crtc %p\n", crtc); + + sun4i_tcon_enable_vblank(drv->tcon, false); +} + static const struct drm_crtc_funcs sun4i_crtc_funcs = { .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, @@ -111,6 +133,8 @@ static void sun4i_crtc_enable(struct drm_crtc *crtc) .page_flip = drm_atomic_helper_page_flip, .reset = drm_atomic_helper_crtc_reset, .set_config = drm_atomic_helper_set_config, + .enable_vblank = sun4i_crtc_enable_vblank, + .disable_vblank = sun4i_crtc_disable_vblank, }; struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 0816c635df20..9ccf7c4deb6d 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -24,29 +24,6 @@ #include "sun4i_drv.h" #include "sun4i_framebuffer.h" #include "sun4i_layer.h" -#include "sun4i_tcon.h" - -static int sun4i_drv_enable_vblank(struct drm_device *drm, unsigned int pipe) -{ - struct sun4i_drv *drv = drm->dev_private; - struct sun4i_tcon *tcon = drv->tcon; - - DRM_DEBUG_DRIVER("Enabling VBLANK on pipe %d\n", pipe); - - sun4i_tcon_enable_vblank(tcon, true); - - return 0; -} - -static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe) -{ - struct sun4i_drv *drv = drm->dev_private; - struct sun4i_tcon *tcon = drv->tcon; - - DRM_DEBUG_DRIVER("Disabling VBLANK on pipe %d\n", pipe); - - sun4i_tcon_enable_vblank(tcon, false); -} static const struct file_operations sun4i_drv_fops = { .owner = THIS_MODULE, @@ -90,10 +67,6 @@ static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe) .gem_prime_mmap = drm_gem_cma_prime_mmap, /* Frame Buffer Operations */ - - /* VBlank Operations */ - .enable_vblank = sun4i_drv_enable_vblank, - .disable_vblank = sun4i_drv_disable_vblank, }; static void sun4i_remove_framebuffers(void)