From patchwork Wed Nov 15 14:19:40 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: 10059577 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 E5250604D4 for ; Wed, 15 Nov 2017 14:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB9CB2A02D for ; Wed, 15 Nov 2017 14:20:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D01212A05D; Wed, 15 Nov 2017 14:20:22 +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 451C32A02D for ; Wed, 15 Nov 2017 14:20:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E8696E542; Wed, 15 Nov 2017 14:20:18 +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 7A9956E542 for ; Wed, 15 Nov 2017 14:20:17 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:59110 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 1eEyY3-0008RE-H8; Wed, 15 Nov 2017 15:20:15 +0100 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 01/22] drm/gem-fb-helper: drm_gem_fbdev_fb_create() make funcs optional Date: Wed, 15 Nov 2017 15:19:40 +0100 Message-Id: <20171115142001.45358-2-noralf@tronnes.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171115142001.45358-1-noralf@tronnes.org> References: <20171115142001.45358-1-noralf@tronnes.org> MIME-Version: 1.0 Cc: narmstrong@baylibre.com, liviu.dudau@arm.com, laurent.pinchart@ideasonboard.com, marex@denx.de, boris.brezillon@free-electrons.com, abrodkin@synopsys.com, z.liuxinliang@hisilicon.com, kong.kongxinwei@hisilicon.com, tomi.valkeinen@ti.com, david@lechnology.com, puck.chen@hisilicon.com, jsarha@ti.com, vincent.abriou@st.com, alison.wang@freescale.com, philippe.cornu@st.com, yannick.fertre@st.com, zourongrong@gmail.com, maxime.ripard@free-electrons.com, shawnguo@kernel.org 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 Make the drm_framebuffer_funcs argument optional for drivers that don't need to set the dirty callback. Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index aa8cb9bfa499..4d682a6e8bcb 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -272,7 +272,8 @@ EXPORT_SYMBOL_GPL(drm_gem_fb_prepare_fb); * @sizes: fbdev size description * @pitch_align: Optional pitch alignment * @obj: GEM object backing the framebuffer - * @funcs: vtable to be used for the new framebuffer object + * @funcs: Optional vtable to be used for the new framebuffer object when the + * dirty callback is needed. * * This function creates a framebuffer from a &drm_fb_helper_surface_size * description for use in the &drm_fb_helper_funcs.fb_probe callback. @@ -300,6 +301,9 @@ drm_gem_fbdev_fb_create(struct drm_device *dev, if (obj->size < mode_cmd.pitches[0] * mode_cmd.height) return ERR_PTR(-EINVAL); + if (!funcs) + funcs = &drm_gem_fb_funcs; + return drm_gem_fb_alloc(dev, &mode_cmd, &obj, 1, funcs); } EXPORT_SYMBOL(drm_gem_fbdev_fb_create);