From patchwork Thu Jul 26 14:10:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10545947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5EF414E0 for ; Thu, 26 Jul 2018 14:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B50672B3E6 for ; Thu, 26 Jul 2018 14:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B27032B411; Thu, 26 Jul 2018 14:11:00 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,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 4E06A2B422 for ; Thu, 26 Jul 2018 14:11:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 533D76E75A; Thu, 26 Jul 2018 14:10:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::60b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80B966E760 for ; Thu, 26 Jul 2018 14:10:54 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Thu, 26 Jul 2018 14:10:52 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, ayan.halder@arm.com Subject: [PATCH 2/3] drm: Make drm_gem_fb_alloc available for drivers to use Date: Thu, 26 Jul 2018 15:10:04 +0100 Message-Id: <20180726141005.8321-3-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> References: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b80d59f5-5159-4929-c757-08d5f30198b5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:v3UmXfh5UXri8TwrMHVQPsuDTKWmMOA2ewmYC9KdTGRpRSHN+Cmqy5ru0obwnDkA/qw7DPb4B8YDP4Kf57B372ITufRpfpo/Fumj8YbpzVWNQakZcawfZH1rMR2PYS7iyldoRh3igTE1NSRtlzjnDsgfxC0t5bavjiXcLBJ1tidd2plO/A9qPDRF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OSw==; 4:BRQn0oGMEm4gu4stniGzkkQ1HXI7TO3I7XjZOPLvu8N8eP3U65Bet6OCbRxqWOt2Jqixeqv7/WRHuKi+mJOA/eCmBr3OI4YX2Rcto1goLfRnmNq9MHtmRbnOC0V8MhcAFat6Krs4yq67qojEQ+s4ywwI6hzKC+382RhML4AtTuoYrx0VNJ34iS1+1KGxXLNZ7FnQQPxVDFdrM5LPHkOwwhKKXA4X/WEjurTq58B7tilZjK4sWCj2a0IFB207j0tAg8SxrYItfRo2MJjoWr/fYZJWpuWBUl0Rk2TMRKG2oWnB0yU/Ozk7jMtu5b+b6BYy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(199004)(189003)(6486002)(7696005)(51416003)(16586007)(47776003)(52116002)(316002)(36756003)(956004)(11346002)(476003)(446003)(386003)(486006)(2616005)(76176011)(66066001)(86362001)(478600001)(16526019)(186003)(26005)(14444005)(53936002)(72206003)(48376002)(8936002)(4326008)(81156014)(81166006)(5660300001)(6666003)(7736002)(305945005)(25786009)(8676002)(50466002)(50226002)(68736007)(106356001)(3846002)(6116002)(6636002)(97736004)(1076002)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2545; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2545; 23:H74DURphrbvHHQBoYK2rJfbKonBw0KRmzN8pP2N?= 1+MZ7W8vbiyMfXXVQL+Wb/2Cl+rS1LcJNyXLb11mLjp+32aeFGkKDEWSGAyMI3HRahHUzpjmLiDaej/zK3yhcXXsnS5IarVZFIxKWADXqhAlsXA9+4aKArZNKDlkXtCGKlyScGYp/ox7dqAvZ7ZOol2qsPY1wcq08M9HOKI/GoTd2MbEJ95EqgX8RRDD8YUzP80khwQQseP3FQHRwUykoDYGbja8AQDkCmDKxDIHsAt6SmqBThV/HDJwPCAzmOVfkG+xOg5Fb0xt+S4WfNKknszKp73DplWt7Yrj43ati+nMOxzo1mUwN5T6B1QuzuTegrq/ZcOge26lZ/63uiVTLFGkLaxJ/O3W+UrtRLyJGsVPVKlvVUS0XcCKFSRPoCVFezZ41sq6YUZp59yXkzD7+TgNlyRl9+S3Ra4GUsvedQF1v1TYucaBVL7tkZvufZedpcNoWtqQhDr2+6q8LQZytH/cedr9rQuW9kUU4yB1D1W+7px5u0rHiwU841nVgH7PUPkzGdZSQQn75toxJ6W10ANfzSMDZLpt5f6uFlume7cfYy8VZEGiae106NWGU6BLQqMXZNU04P9VY+LQjByLOht2P2C7/MPbkT4JEn53VQTYAclcbHRQsOTUvwskicde6n9wCk4bzFbHlOHu7s1DwnINpkZenRpzD78qTIxd/c372mj957yM9OVpdS4DqWBiBtLgn9J73ks6w8KSEnKsvBbA8yo34ZTrwQ9bx8lVlC1Y+1nMMsQQwJRLzbIcBop+IjB0yPTlEn6TrXBC0TX9hZQjeilr7FiYvbRnTHVH85e9fanY6NljX/wwqT2zBi1eoCZq3XEUu9XExnDC4ZqghkyVGV/qkkUoaOSLTdGFodsvv1Wk+WyMyEY4kIO6TRugSGS0vZHuKCK3NfKbaCLemR5G3FYG9ImqMX2jPC+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gJ+uKkWNdzc1W1UXpCq7jJPW32erPf3t6EVzmdBL0pNS7jdmAKhfB7L4Q==; 5:QnsXrnbfpP+AK3/zYYiPoa0Iy6K1CP78EcK4GeX39/ALxzzSJtCioJo/b9JSQd6yedVNdDi7jNmpcILrh0iWNhGFF6HiDfDk7YF2lPaTjL9znmECoINIadjFc325DfZ21FWUWpo5U1nuCRKUMdp2xVZ2uH23/IyNznAQxFXw9pA=; 7:H388GkvoJiXK3fcR5bKIJfXMWFqsEEdpwkZfTIf/xznbOBtdbGoY1HSi8v+D0UDjfo9WzJrT34GO6NRQFUgtACDfgHFFl7kwv6DQU0HI7J1BWG8gfvcVtqh5rnpqp8aqkmizFwTiUp0N8UuvTnVn6p3xEUkocRmAUgvoHZcixZuWFX57rzXz9G15v2jBLnTbLMViJOx2it+hExFs/zqZ8ZrE03a51Hevzcn3sKVFf1KoXN+n0yKUYE6dE+sx97q4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 14:10:52.2860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b80d59f5-5159-4929-c757-08d5f30198b5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2545 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some drivers can't use drm_gem_fb_create, so instead of copying the logic that does the framebuffer allocation allow them to use core drm_gem_fb_alloc. Signed-off-by: Alexandru Gheorghe Acked-by: Liviu Dudau --- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++- include/drm/drm_gem_framebuffer_helper.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index 2810d4131411..64eddf5a1bd9 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -57,7 +57,7 @@ struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb, } EXPORT_SYMBOL_GPL(drm_gem_fb_get_obj); -static struct drm_framebuffer * +struct drm_framebuffer * drm_gem_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **obj, unsigned int num_planes, @@ -85,6 +85,7 @@ drm_gem_fb_alloc(struct drm_device *dev, return fb; } +EXPORT_SYMBOL_GPL(drm_gem_fb_alloc); /** * drm_gem_fb_destroy - Free GEM backed framebuffer diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h index a38de7eb55b4..d20c1356000a 100644 --- a/include/drm/drm_gem_framebuffer_helper.h +++ b/include/drm/drm_gem_framebuffer_helper.h @@ -14,6 +14,11 @@ struct drm_simple_display_pipe; struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb, unsigned int plane); +struct drm_framebuffer * +drm_gem_fb_alloc(struct drm_device *dev, + const struct drm_mode_fb_cmd2 *mode_cmd, + struct drm_gem_object **obj, unsigned int num_planes, + const struct drm_framebuffer_funcs *funcs); void drm_gem_fb_destroy(struct drm_framebuffer *fb); int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file *file, unsigned int *handle);