From patchwork Fri Dec 8 19:37:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 10103219 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 B5E70602A0 for ; Fri, 8 Dec 2017 19:38:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A908528ED3 for ; Fri, 8 Dec 2017 19:38:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C44B28EFC; Fri, 8 Dec 2017 19:38:31 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A71528ED3 for ; Fri, 8 Dec 2017 19:38:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0FB16E987; Fri, 8 Dec 2017 19:38:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id A625A6E978 for ; Fri, 8 Dec 2017 19:38:05 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:57546 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eNOTD-0003EJ-Pe; Fri, 08 Dec 2017 20:38:03 +0100 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 05/11] drm/meson: Use drm_fb_cma_fbdev_init/fini() Date: Fri, 8 Dec 2017 20:37:37 +0100 Message-Id: <20171208193743.34450-6-noralf@tronnes.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171208193743.34450-1-noralf@tronnes.org> References: <20171208193743.34450-1-noralf@tronnes.org> MIME-Version: 1.0 Cc: marex@denx.de, david@lechnology.com, alison.wang@freescale.com, puck.chen@hisilicon.com, narmstrong@baylibre.com, abrodkin@synopsys.com, z.liuxinliang@hisilicon.com, kong.kongxinwei@hisilicon.com, laurent.pinchart@ideasonboard.com, daniel.vetter@ffwll.ch, zourongrong@gmail.com, liviu.dudau@arm.com 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use drm_fb_cma_fbdev_init() and drm_fb_cma_fbdev_fini() which relies on the fact that drm_device holds a pointer to the drm_fb_helper structure. This means that the driver doesn't have to keep track of that. Also use the drm_fb_helper functions directly. Cc: Neil Armstrong Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/meson/meson_drv.c | 20 +++++--------------- drivers/gpu/drm/meson/meson_drv.h | 1 - 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index f9ad0e960263..55f0f2c07101 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -68,15 +69,8 @@ * - Powering Up HDMI controller and PHY */ -static void meson_fb_output_poll_changed(struct drm_device *dev) -{ - struct meson_drm *priv = dev->dev_private; - - drm_fbdev_cma_hotplug_event(priv->fbdev); -} - static const struct drm_mode_config_funcs meson_mode_config_funcs = { - .output_poll_changed = meson_fb_output_poll_changed, + .output_poll_changed = drm_fb_helper_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, .fb_create = drm_gem_fb_create, @@ -263,12 +257,9 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) drm_mode_config_reset(drm); - priv->fbdev = drm_fbdev_cma_init(drm, 32, - drm->mode_config.num_connector); - if (IS_ERR(priv->fbdev)) { - ret = PTR_ERR(priv->fbdev); + ret = drm_fb_cma_fbdev_init(drm, 32, 0); + if (ret) goto free_drm; - } drm_kms_helper_poll_init(drm); @@ -294,11 +285,10 @@ static int meson_drv_bind(struct device *dev) static void meson_drv_unbind(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct meson_drm *priv = drm->dev_private; drm_dev_unregister(drm); drm_kms_helper_poll_fini(drm); - drm_fbdev_cma_fini(priv->fbdev); + drm_fb_cma_fbdev_fini(drm); drm_mode_config_cleanup(drm); drm_dev_unref(drm); diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h index 5e8b392b9d1f..746bbdbbdec3 100644 --- a/drivers/gpu/drm/meson/meson_drv.h +++ b/drivers/gpu/drm/meson/meson_drv.h @@ -33,7 +33,6 @@ struct meson_drm { struct drm_device *drm; struct drm_crtc *crtc; - struct drm_fbdev_cma *fbdev; struct drm_plane *primary_plane; /* Components Data */