From patchwork Tue Feb 7 09:16:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 93540 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2145166obz; Tue, 7 Feb 2017 01:20:13 -0800 (PST) X-Received: by 10.99.113.82 with SMTP id b18mr19155569pgn.118.1486459213485; Tue, 07 Feb 2017 01:20:13 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id l59si3506538plb.85.2017.02.07.01.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 01:20:13 -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 9A8AE6E628; Tue, 7 Feb 2017 09:20:12 +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 A389A6E628 for ; Tue, 7 Feb 2017 09:20:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A688020142; Tue, 7 Feb 2017 09:20:09 +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 3928720155; Tue, 7 Feb 2017 09:19:56 +0000 (UTC) From: Shawn Guo To: Daniel Vetter Subject: [PATCH v3 14/23] drm: meson: use vblank hooks in struct drm_crtc_funcs Date: Tue, 7 Feb 2017 17:16:26 +0800 Message-Id: <1486458995-31018-15-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: Neil Armstrong Acked-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_crtc.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/meson/meson_drv.c | 20 -------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c index 749770e5c65f..0fe49eccda65 100644 --- a/drivers/gpu/drm/meson/meson_crtc.c +++ b/drivers/gpu/drm/meson/meson_crtc.c @@ -33,6 +33,7 @@ #include "meson_crtc.h" #include "meson_plane.h" +#include "meson_venc.h" #include "meson_vpp.h" #include "meson_viu.h" #include "meson_registers.h" @@ -48,6 +49,24 @@ struct meson_crtc { /* CRTC */ +static int meson_crtc_enable_vblank(struct drm_crtc *crtc) +{ + struct meson_crtc *meson_crtc = to_meson_crtc(crtc); + struct meson_drm *priv = meson_crtc->priv; + + meson_venc_enable_vsync(priv); + + return 0; +} + +static void meson_crtc_disable_vblank(struct drm_crtc *crtc) +{ + struct meson_crtc *meson_crtc = to_meson_crtc(crtc); + struct meson_drm *priv = meson_crtc->priv; + + meson_venc_disable_vsync(priv); +} + static const struct drm_crtc_funcs meson_crtc_funcs = { .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, @@ -55,6 +74,9 @@ struct meson_crtc { .page_flip = drm_atomic_helper_page_flip, .reset = drm_atomic_helper_crtc_reset, .set_config = drm_atomic_helper_set_config, + .enable_vblank = meson_crtc_enable_vblank, + .disable_vblank = meson_crtc_disable_vblank, + }; static void meson_crtc_enable(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index c0a59889c45f..8d17d0e59cbe 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -79,22 +79,6 @@ static void meson_fb_output_poll_changed(struct drm_device *dev) .fb_create = drm_fb_cma_create, }; -static int meson_enable_vblank(struct drm_device *dev, unsigned int crtc) -{ - struct meson_drm *priv = dev->dev_private; - - meson_venc_enable_vsync(priv); - - return 0; -} - -static void meson_disable_vblank(struct drm_device *dev, unsigned int crtc) -{ - struct meson_drm *priv = dev->dev_private; - - meson_venc_disable_vsync(priv); -} - static irqreturn_t meson_irq(int irq, void *arg) { struct drm_device *dev = arg; @@ -126,10 +110,6 @@ static irqreturn_t meson_irq(int irq, void *arg) DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, - /* Vblank */ - .enable_vblank = meson_enable_vblank, - .disable_vblank = meson_disable_vblank, - /* IRQ */ .irq_handler = meson_irq,