From patchwork Tue Jul 4 10:37:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9825743 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 58CA260353 for ; Wed, 5 Jul 2017 01:18:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E0EC22AFC for ; Wed, 5 Jul 2017 01:18:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 226472623C; Wed, 5 Jul 2017 01:18:10 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 350BC22AFC for ; Wed, 5 Jul 2017 01:18:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99F5389E2A; Wed, 5 Jul 2017 01:17:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 9263 seconds by postgrey-1.35 at gabe; Tue, 04 Jul 2017 13:10:45 UTC Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0098.outbound.protection.outlook.com [104.47.0.98]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E847899E9 for ; Tue, 4 Jul 2017 13:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=A9uodK8Z6IF7VwZbMk/xjk0kpMvMspXm6WvrcmJo/cM=; b=DUwJoL4aq+1LG4LvWu8fZ4b7QyI9QXSts/ZC/iy+n0lKrzXu7grkjhEAZ5n6AXIDPlXbirSg1tUgNeuI+vp0Ktajl8toN0MRSlDIIPv6saYv2xWusO5ZULnJtMtIAG/HbeQ6jJJp6DyZqoAFEf53OhSNR4PpOTyg3aFXvWi/wpc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from orc.lan (81.224.171.159) by HE1PR0202MB2555.eurprd02.prod.outlook.com (2603:10a6:3:90::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Tue, 4 Jul 2017 10:36:21 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v3 05/16] drm/fb-helper: do a generic fb_setcmap helper in terms of crtc .gamma_set Date: Tue, 4 Jul 2017 12:37:01 +0200 Message-Id: <1499164632-5582-6-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1499164632-5582-1-git-send-email-peda@axentia.se> References: <1499164632-5582-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: AM5PR0201CA0002.eurprd02.prod.outlook.com (2603:10a6:203:3d::12) To HE1PR0202MB2555.eurprd02.prod.outlook.com (2603:10a6:3:90::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33c3322e-21b5-4926-9f4b-08d4c2c883d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0202MB2555; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2555; 3:MaCXwB85YOhE/Nm6hJCjyYJcYFlJ79GHqvDHXWamrKMonISdj3l5pa0L1CZbzmg6M2Wf6ZorYLbcC+Y08flo58L6WTf4EcM/gRfGEH6iHTKG97uhsaX7lsR3n9t/Jxm9c9bmKVtZT0eRmxzB4gMW6ifV53byZcU783dotJTp7UvoP3QMZg3fX5VzNURNcrsHRmYrDdfAJ1TATC1K9IlhbOqZYgSPSWBF63sxkMCKAhCAy/ChDBrVO5fvrdj+Yv9VF6kI5Tzxg195yXaIzigr/8p9oCSmoJQYWMynjNqr4fVz8VqayfGc26Izih8c43sjDDt5s+AtM72lIqsKBxOIC1FWmVW/35Kw1dAtVJU7eKMjAlS92eS5mIMJg8Ha+A037ALUQvaQztUPitFK7YEnhZxGi688aon0/D+rPp0ZeDOD2dQklK5XwEYKKMEP7ZOJKfA/Rm4gknflw95a87+Pt4TEYOj8U+ZwJzArYco2FkzFrWe6AYnh2NqskMnIN9wIb3vKkeBEDJTPupBAgRvqa9RmPRG6rk/oKnzkYpY5eEWa0wMk1VZL6wrgwL4rZd8H7HZ8hdwhffQ2HKNWZhlCc60cd1uRtDkY3qNyqg0dN+JMmv8+8mfdrrrkY1tnlFWauptMl99mWNDCh5DwJkVlFDhMzp8Fdh4si1/+t9BnW20BGcnUr1guIYaKv/csZJ+UtbkbI7ij4xo4FJwpgYDxJA== X-MS-TrafficTypeDiagnostic: HE1PR0202MB2555: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2555; 25:QOmshNDxsh9B8PKfAfDrQPrCu8bcFmSoU8Bi43NfCU3Qom9AQJ/cUFuhr67oF2BgfecbLIfztNN1EXseunEyjuuzuAmY1dNLfe4UhArMYbui23TSkGR5ZjIWSu7lPNJcyDIXrU2x0bjD8l/7VJAu83aCjlH/trFIvHur4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zpXuA1JJ3mkAhX6tdHjaUeFwvzWT5yIgqV+zKAdLYdKXep+KCUJatGe1JWCL5TxJwuDhbsQyJ/zPnZw+jc2OQyxGvCAf0szb9StjoBNlsRWW34nT6V8jNcqbDj5JfPwieLHfgcO+rnpdiZyM7RV1/0ERMkdXuVTR7Qge3o56tqFm8jfr1W7RSRxAMSEsTqtYuu0+OgPMrb7CaxZYgG5r6KJJegiLDPXgccO/X8PcL3D5nclq7dd2ILYQYg4mj27bx9IbrU1UNL6n8eiKrdYv9cK1rNpqsbAv6tTpvn3J2HU80tfNc2WlhSm8bT/HPPr9VnH7012Ea33Ex+FmKpDXbWGohX4GRyLq/n6LWWPLZoc45WkAL3Xn4slVp/BzOEGwYxj1nKmQh+j+RhVEG4HxyryNbdwMOpXJczhuPEDE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6041248)(2016111802025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0202MB2555; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0202MB2555; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2555; 4:KrfGCdNX/0U4HofNqxXpM4KV1PnNebSYwrzo8MV5?= =?us-ascii?Q?g7Dz5fztSw0JrvDt6GXMwlAh3oxepP99BIFyoYfIUdU7m/7KNRBXyuqdtFWm?= =?us-ascii?Q?YMumXCe/GN9oBb+sFJw2kPZHuvF8vvWw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uMfYbaXMkWdxqo0Sa7pUPQmZhclfKN/evD2mhk4tWdC16w0aG9U6?= =?us-ascii?Q?6ZFJx0EiGHeH54++ARLjAffXXe8uILHEUas6WWCO24uYFJtQX07duE78E773?= =?us-ascii?Q?9GG9k2+h/5EdCJCnco17NGsmYqyx/XcYNeVVkIa5vjlaibXFLGbJDhE5Kfsh?= =?us-ascii?Q?5g7urhHqElfP5ef5cxjjZMUcT0GBUvkqKTO0Tj0sfVENXVdMyW0V6ITbRsfY?= =?us-ascii?Q?KjLu+C777lWN9mBzzDQ=3D?= X-Forefront-PRVS: 0358535363 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6009001)(39840400002)(39400400002)(39410400002)(39450400003)(8676002)(81166006)(7736002)(47776003)(81156014)(189998001)(97736004)(3846002)(36756003)(305945005)(50466002)(6116002)(48376002)(50226002)(53936002)(86362001)(33646002)(66066001)(2906002)(478600001)(42186005)(2361001)(74482002)(2351001)(38730400002)(110136004)(4326008)(25786009)(6506006)(6512007)(54906002)(5003940100001)(21086003)(6486002)(6916009)(5660300001)(6666003)(2950100002)(50986999)(76176999)(41533002)(142923001)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0202MB2555; H:orc.lan; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2555; 23:/+Ze1gWqUkUJaY5LVGh2HM11/i7G2aXgKz3YhN+?= =?us-ascii?Q?03sdlzqF0Si7yRyFJZmU3+NkFYEakrs9og2nzTvP28+efzQ4NTWd41md6c7N?= =?us-ascii?Q?z2uUc3tA+fJPmCV1Gdm13acKMGWeW4NgGWmFEhXkKq85oLPdRRbuJmCDpGzA?= =?us-ascii?Q?OM1yeCdZX5wrKrBkPkX0LI8M5tqgr4+uiXsEz9xL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fCDt0yCY8isushpjZxw0lhRHJV7F2OE65lhILtbK3ucX?= =?us-ascii?Q?4oWZh+OPQ+p/2Ct3BdRqn+mkT5jMMvxFlB+3RXTCKkhBQjsU357Q4sKiG/rL?= =?us-ascii?Q?OFVmO+Z/yT/lBOMoseNURnwFEmJ1eZk0A2xq9+W6YMGCpsjBQ1OOtXmc2pt6?= =?us-ascii?Q?crL8HD9nnpD7WeGqfWXrdilJLgXyT5stxuSEsxW1DowkMy9yX2y84uTSWOya?= =?us-ascii?Q?zdAA0cFptX2I7K7BgTIeK/6A=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2555; 6:HEta2zqb6BXDWu4vkSf3aaXgM3X0+UyKiRYU5X7W?= =?us-ascii?Q?HO4kyYjEC8Sdm+OD9UjMmP2p3BMbmHAvyg855LfXQtD1igK4zpP36HvsEHH0?= =?us-ascii?Q?MZTmEJM5ATg2I/3Ma23Qo2Lj94QdXjUT8uB8c7qW6xsSXsVlVsXOYfec5D8U?= =?us-ascii?Q?fIwe6xYwk+EWvwWF3VTsZZsXqbfxRr7ISZTp30icOHoeGx4pDc3q4kI9Tydl?= =?us-ascii?Q?tmzgteQxWGrWJxZENay98t5FnD6H7fgb0aINXEVPD1S8AIS00fD6sCJS0T5b?= =?us-ascii?Q?BIulaZCcXCUoYw/KGFk76ogJW2FQeHEHnwazkFdyXQS9cOCvI2dsNd2ov06v?= =?us-ascii?Q?2djhfk9nKdY/KM/yqGkW6e+kdOPAy+Bmzleab4KxMnFTvxoWL5vk++XpDlAX?= =?us-ascii?Q?5LxnbJG3DQEXPzyZwtGcwhsBy0RrHBawbSlO4ipwNVefHCygANJQfPZXfIs2?= =?us-ascii?Q?N0f/Hf7nvGMSSFo80MC6i33/tqhIAsIBzMLLCDVfrP7Go+6+nLfIh+I17dfz?= =?us-ascii?Q?G9EQ6UVNawTas5uisDa9Yvi+E5S6sxvYERhOfY48HGMjAyq8oaApaVWwOi/5?= =?us-ascii?Q?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HPQdzM; 24:QOD7+zUPaUiK23Mb+WLiSCMUFRyK7ty8JKDC7MwuW6evMKbqYTBNW/YeTTUgZDIWGRhyBxzmVtrFaXHa6S4Iy+2tSx5EVNRyEffjpIIl4D8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2555; 7:on/cOBI60zHTWafMViHU3mC3LrUNfi05CJ23ddxuykLDreSAAN3Jexf9l0vqj5PbzPybvwziHxY0U+BdphftF8DlNCu5Ha1UlqeASsCKFZdUA1cgynSxrYy53BC2a5tvWA5GXVK5Y3mXVm2CVeu9AwDE4FbhdCeq+aCfhTUtCeN4mGBpnzvAQkA4/QMFrRWr1hbAslQMJ+7MxR6gT6TqHN0Nz419EHyNAwaNVRBTDFU3cHlFu6CSHqr+uWkj2N7Fkh0WZY0fHbATwFxCowcX52KRyNxjlBBrrbT7pbiGwyFR1wIrbML88+osSf2bzj2Nx8voB0bAKT7Ut+6+/e7FSdLYvQv/3h8gS88AOrV1YIcPohLOsegf9NRch6644t1J6XpMP/ER4uDz/w1GRW/pYlCKLj9aEjeUATn9mMNkfGqlOU/E8T/tPFBsTaU5Dj/mkb9d271l6AYJ4y0CxWlUJMf38qXJsWX6BgYbteORrqPFxZgdODxyRZePSe67IySYeSfusaG6+sZKdCAsv0s0UENbci8JMMpwzYUlWK3WrGKNcIttHus4szHzxhv2ipWTwHRfv/KvYIkXeiFQ3O3hgM0f0qbsBA6X96Z64tT8hNBY+Y7OjK5RTdjX8hm4QmOswljKo1UKXZoLhSYNdt6a2cIqeODBwXffGZo61v1ypErqQKPKpOYb0Wp0rWX4KFzNhRHof0U8/cPcIr4pqrGlsjWgtUpQJTokPDYBV+08d95hXNz29GjpmkdXygS5wtmI5c2qYawRm+h0TPcUp0ZtoZytC5wNrt9cJaTeEQkPUXM= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2017 10:36:21.6817 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2555 X-Mailman-Approved-At: Wed, 05 Jul 2017 01:17:54 +0000 Cc: Boris Brezillon , dri-devel@lists.freedesktop.org, Daniel Vetter , Peter Rosin 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 This makes the redundant fb helpers .load_lut, .gamma_set and .gamma_get completely obsolete. Signed-off-by: Peter Rosin Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 165 +++++++++++++++++++++++----------------- 1 file changed, 94 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index b75b1f2..7f8199a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1257,27 +1257,6 @@ void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper, } EXPORT_SYMBOL(drm_fb_helper_set_suspend_unlocked); -static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, - u16 blue, u16 regno, struct fb_info *info) -{ - struct drm_fb_helper *fb_helper = info->par; - struct drm_framebuffer *fb = fb_helper->fb; - - /* - * The driver really shouldn't advertise pseudo/directcolor - * visuals if it can't deal with the palette. - */ - if (WARN_ON(!fb_helper->funcs->gamma_set || - !fb_helper->funcs->gamma_get)) - return -EINVAL; - - WARN_ON(fb->format->cpp[0] != 1); - - fb_helper->funcs->gamma_set(crtc, red, green, blue, regno); - - return 0; -} - static int setcmap_pseudo_palette(struct fb_cmap *cmap, struct fb_info *info) { u32 *palette = (u32 *)info->pseudo_palette; @@ -1310,54 +1289,68 @@ static int setcmap_pseudo_palette(struct fb_cmap *cmap, struct fb_info *info) return 0; } -/** - * drm_fb_helper_setcmap - implementation for &fb_ops.fb_setcmap - * @cmap: cmap to set - * @info: fbdev registered by the helper - */ -int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) +static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; - struct drm_device *dev = fb_helper->dev; - const struct drm_crtc_helper_funcs *crtc_funcs; - u16 *red, *green, *blue, *transp; struct drm_crtc *crtc; u16 *r, *g, *b; - int i, j, rc = 0; - int start; + int i, ret = 0; - if (oops_in_progress) - return -EBUSY; + for (i = 0; i < fb_helper->crtc_count; i++) { + crtc = fb_helper->crtc_info[i].mode_set.crtc; + if (!crtc->funcs->gamma_set || !crtc->gamma_size) + return -EINVAL; - mutex_lock(&fb_helper->lock); - if (!drm_fb_helper_is_bound(fb_helper)) { - mutex_unlock(&fb_helper->lock); - return -EBUSY; - } + if (cmap->start + cmap->len > crtc->gamma_size) + return -EINVAL; - drm_modeset_lock_all(dev); - if (info->fix.visual == FB_VISUAL_TRUECOLOR) { - rc = setcmap_pseudo_palette(cmap, info); - goto out; + r = crtc->gamma_store; + g = r + crtc->gamma_size; + b = g + crtc->gamma_size; + + memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r)); + memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); + memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); + + ret = crtc->funcs->gamma_set(crtc, r, g, b, + crtc->gamma_size, NULL); + if (ret) + return ret; } - for (i = 0; i < fb_helper->crtc_count; i++) { - crtc = fb_helper->crtc_info[i].mode_set.crtc; - crtc_funcs = crtc->helper_private; + return ret; +} - red = cmap->red; - green = cmap->green; - blue = cmap->blue; - transp = cmap->transp; - start = cmap->start; +static int setcmap_atomic(struct fb_cmap *cmap, struct fb_info *info) +{ + struct drm_fb_helper *fb_helper = info->par; + struct drm_device *dev = fb_helper->dev; + struct drm_modeset_acquire_ctx ctx; + struct drm_crtc_state *crtc_state; + struct drm_atomic_state *state; + struct drm_crtc *crtc; + u16 *r, *g, *b; + int i, ret = 0; - if (!crtc->gamma_size) { - rc = -EINVAL; + state = drm_atomic_state_alloc(dev); + if (!state) + return -ENOMEM; + drm_modeset_acquire_init(&ctx, 0); +retry: + ret = drm_modeset_lock_all_ctx(dev, &ctx); + if (ret) + goto fini; + state->acquire_ctx = &ctx; + for (i = 0; i < fb_helper->crtc_count; i++) { + crtc = fb_helper->crtc_info[i].mode_set.crtc; + if (!crtc->funcs->gamma_set) { + ret = -EINVAL; goto out; } - if (cmap->start + cmap->len > crtc->gamma_size) { - rc = -EINVAL; + crtc_state = drm_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) { + ret = PTR_ERR(crtc_state); goto out; } @@ -1369,27 +1362,57 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); - for (j = 0; j < cmap->len; j++) { - u16 hred, hgreen, hblue, htransp = 0xffff; + ret = crtc->funcs->gamma_set(crtc, r, g, b, + crtc->gamma_size, crtc_state); + if (ret) + goto out; + } - hred = *red++; - hgreen = *green++; - hblue = *blue++; + ret = drm_atomic_commit(state); + if (ret == -EDEADLK) { + drm_modeset_backoff(&ctx); + goto retry; + } - if (transp) - htransp = *transp++; +out: + drm_modeset_drop_locks(&ctx); +fini: + drm_modeset_acquire_fini(&ctx); + drm_atomic_state_put(state); - rc = setcolreg(crtc, hred, hgreen, hblue, start++, info); - if (rc) - goto out; - } - if (crtc_funcs->load_lut) - crtc_funcs->load_lut(crtc); + return ret; +} + +/** + * drm_fb_helper_setcmap - implementation for &fb_ops.fb_setcmap + * @cmap: cmap to set + * @info: fbdev registered by the helper + */ +int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) +{ + struct drm_fb_helper *fb_helper = info->par; + int ret; + + if (oops_in_progress) + return -EBUSY; + + mutex_lock(&fb_helper->lock); + + if (!drm_fb_helper_is_bound(fb_helper)) { + mutex_unlock(&fb_helper->lock); + return -EBUSY; } - out: - drm_modeset_unlock_all(dev); + + if (info->fix.visual == FB_VISUAL_TRUECOLOR) + ret = setcmap_pseudo_palette(cmap, info); + else if (drm_drv_uses_atomic_modeset(fb_helper->dev)) + ret = setcmap_atomic(cmap, info); + else + ret = setcmap_legacy(cmap, info); + mutex_unlock(&fb_helper->lock); - return rc; + + return ret; } EXPORT_SYMBOL(drm_fb_helper_setcmap);