From patchwork Thu Jul 13 16:25:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9839751 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 104F0602A0 for ; Fri, 14 Jul 2017 01:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B3EC27F4B for ; Fri, 14 Jul 2017 01:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FE582876F; Fri, 14 Jul 2017 01:04:14 +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 7411727F4B for ; Fri, 14 Jul 2017 01:04:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D35976E738; Fri, 14 Jul 2017 01:03:11 +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-db5eur01on0111.outbound.protection.outlook.com [104.47.2.111]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAAC46E6EB for ; Thu, 13 Jul 2017 21:57:27 +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=HM8a0axGbG5nqMDJAj6ALVEXDPb4E+XRSITITk3IsI4=; b=c76GwvZysq0gcyaD+0uCSc+/SfaCD/H+ryqSJfiZF13SyuXZKoRn2oR8KbOZ7kUpLeFI48DM9altg44RAOmKl6IkMf4JBSqsruh1JdHIw1L9J6wy/paZDeVV/HcE2Z/R4346cXSdXRn62U0Hgb9cSQ7P6DH8VDNSfwIAATyANPM= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=axentia.se; Received: from orc.pedanet (81.224.168.30) by HE1PR0202MB2556.eurprd02.prod.outlook.com (2603:10a6:3:90::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Thu, 13 Jul 2017 16:24:27 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v5 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths Date: Thu, 13 Jul 2017 18:25:27 +0200 Message-Id: <20170713162538.22788-4-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170713162538.22788-1-peda@axentia.se> References: <20170713162538.22788-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: HE1PR09CA0048.eurprd09.prod.outlook.com (2603:10a6:7:3c::16) To HE1PR0202MB2556.eurprd02.prod.outlook.com (2603:10a6:3:90::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a2cecbb0-a14e-4efd-1cb5-08d4ca0ba214 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: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pt8l6MxTH32ojB06rBtzGgwHrKTEuwPuKYWLjFR068ZBRaJ++gs9HXzKch6ErZMpNZnrQs/srb+DnaDMk8zr6/1WRAMXv0Y3kdtajZktHUHZPzWwDt+H+OWkMaoDmwzAMaToLWhgoWmlS625jRpJzyS9abFDp61WN4bBAHz/M7xEom2Qo3iwDR7CafKSmig8CFpJotsAcpC2hTFQpXYVi+iiUFFMkL6SODJ8IQzp1AFtgk7KLf87FlreRNq3TCsKs66hZm3WzW8adus834z4R43yb3XejdtkyxnkEux79DIYHk0OxNwVpbfMnV87KAvuvA9xvPDHYBlF0HMDxLIOFX+RgnTa7fWD5l8hPtRW5s7hZLMV/byg= X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123564025)(2016111802025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0202MB2556; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0202MB2556; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2556; 4:vafKTaaZ4Yt1SHCtzMvmfxl9+KH0VVjY4p5UbSgc?= =?us-ascii?Q?dwo7xZnWA9Ml/DjmG1ouMFCvi8u8aWICLrlj5tntDyvMOuDiUPEtia5zPSOJ?= =?us-ascii?Q?TEAqS41EDuUjTL0vzLnYu5QKaw62aRzC7IR1DZ56dcWa/5Fx0NJMCm5lzSgT?= =?us-ascii?Q?yfR6g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rH61dWK9Yv62zRZW0K75oyWbxSH?= =?us-ascii?Q?gYSzMNoz9oCkg8vb6hQK/V1cvM57unbfrhMgUN8dW6hXTr8rcrYFdh6OCnZ8?= =?us-ascii?Q?ONG3u4emx8MPi+liBvKcEIfUw5GzB69Ki0Rsh+pstcLSnctyrAx7qXoUflqO?= =?us-ascii?Q?rIitj4C5Dvg2brovTFM0gCqgphby5Ig714XMu0qMY4sSSsbyIBGRxU9b67Zb?= =?us-ascii?Q?vgUpTE0KCFo8lGpM+5N9waRBH1OcbTiQ5QFXvpnp+HoHBBtkcR0/pHW47gBT?= =?us-ascii?Q?BdWcHP6CZ3BsSaR8G2eH/to=3D?= X-Forefront-PRVS: 0367A50BB1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(7370300001)(4630300001)(6009001)(39830400002)(39400400002)(39410400002)(39450400003)(54906002)(8676002)(81166006)(5003940100001)(50226002)(6512007)(6506006)(38730400002)(110136004)(7350300001)(53936002)(6486002)(7736002)(189998001)(5660300001)(305945005)(4326008)(25786009)(2361001)(2351001)(33646002)(3846002)(6116002)(74482002)(48376002)(50466002)(36756003)(86362001)(76176999)(50986999)(1076002)(42186005)(2950100002)(6916009)(478600001)(66066001)(47776003)(2906002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0202MB2556; H:orc.pedanet; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2556; 23:DRYJt+9FE318SuldpFpIxZIARrUcsJy0637Oxtt?= =?us-ascii?Q?OYFhSCGy3RyqwnJARJgrupLl4fFf3IUCeWU3DG4nVuK/YWC3488mKc+pvMGp?= =?us-ascii?Q?/tdrqe+g2uVtcuHr+sGiAjbwJ1V3n3OXCoB1kloUgWouEUrszEh9tHZ9Rmqv?= =?us-ascii?Q?CoUvdUaWQbktHdxUjRBBxwQXJrMeHL4OM6fq96kHVRaiV89fVlHErPWKE699?= =?us-ascii?Q?bEioM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6mYhQljvKj4HP?= =?us-ascii?Q?nTonsJjnLX9I2y6aIamVqWRcVj4vrJdl8CRvedMSOn+nCRuOgG2MFAQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2556; 6:OBbcGJP5x7Zu/4NvDh1hTkZS6j/0lNWqP8mPN7k+?= =?us-ascii?Q?ljinIA3IUiBhO2adxomOrQIK2cWro+boFFuslJxIgXOf6oG8syY9u/l3S8Pz?= =?us-ascii?Q?DRfGAiFE3wrc1CS61XB44ux2fYXSFTVJTIqKYKC9fjvPwRw7DGuYfSlcgIPL?= =?us-ascii?Q?+DtmXZuqIee/LZkh0WbIWJu9MqKUV5im/ynwV0fVocZGysje4/jF4AKKLUN7?= =?us-ascii?Q?3XtcaszqTl/QqTSGUoRw+ncUS0rg+WqM0l3kTTWEhkjPyhQt7ITP7a74VJWY?= =?us-ascii?Q?12WKbvqpt1XRy98/nNDaOKq6jjwmJZr1vwSg3UwYtNX6wWF9mBCsTSX7u8IU?= =?us-ascii?Q?hIaSQF/yTdmm382D/cOQoNe7ZrlI76BSNqDJm1ADUIKSiIw9Kvymokxx3tif?= =?us-ascii?Q?hJJyO5Z4MAAjtTUY/JMzsj0OgTs5hpA+VY+/nevw88IZnf9jAI83zJatCuD4?= =?us-ascii?Q?kwmaiN8veI3VBIBjnIn0JW2J/R1+cKby45YV6OJ7fcv+/B7UfZiE3FqTNu0y?= =?us-ascii?Q?Wu08cG9HaKuVbocFOouf69qQXNuDDL3FJuBZn09I1fOVoOVCXR4SBlvnDiJz?= =?us-ascii?Q?V3My1ErxMPKpKzaPY8jh+AcT8A2WtdBF3gC1eQ604Bm/uph3cDhMz64hIpvX?= =?us-ascii?Q?eDtD/7v4hBau/y+JhJZAqFbcQ4NjZqvW/X2/xE5ZhSnyf51DCNQ/+krb/LhF?= =?us-ascii?Q?DWtfPmFiUUFhYbmnbGb6OmV6530ABjet7UscgPjGO5eYvQym4fZGBVNtPhg+?= =?us-ascii?Q?egtCCKWO6rw+o4XiiWvGnaGdWsKwaj+Zsdq8iTBuowlrtbpJffr3xK4AczTz?= =?us-ascii?Q?Z/qplcRUwlUbcpNpgvGcIY3tV6Yb6bNANDbOo52V0cLcY3uPEDrEl9NexDqn?= =?us-ascii?Q?uRAPxDAavPSyUYVpprewlhtN9juzPBuAeW1bdpRuhSfg5GWb1b0dYU0xHWHw?= =?us-ascii?Q?25f768QfZCiZwwF5juF+Y9KCIC3AHlK1xluC89R4pw4Zn2m5PKvkKN3FlDNL?= =?us-ascii?Q?0Po=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2556; 5:n74A/3sP8r7VCdbrzymxgfBqmZkPet2nbqajUWMXKNhmr3slt4/p8Q5ZBLZAFaX876vVVN8Vteyva156Dg6Y5rj+0K0cUwzb8ynjKzmOx9I04uXBOvoirRPzn+Z6LbCM+RSev6QW+KnISxDsQaWZrrH2zbs4MqFchffEtyQnPxNv3yPs9IaXqbKa9kYWLJyLwKpBR5LBMCSyOY+YwBonuVVnkzf3jZ+u4h493uHW3ij8UHRtgunsuzCCWFwg0HsPiuiTAEqpOsvyef3XX4O44KPGIQOC8p7ISem4Ktmh0bXPj68rSeJCTopmE2ajK5TTybS3xD5ekN/pLUknzpZR6Yl66wlf3ewzHl1oY+K/X4cBwmblT+Bjn0rNGUiKUJ7piMFnCZ+WjA8drn/h8EWCAGpRw0HSC8o+ZEnK7N3iy91eLsay9cPt0TNdYt7vHcLv2UnJNyDTE8vpzM35EOCLYytYkhjlgmHHTkvH6dK+l0gWLFngou+xXnAklLEZrcFb; 24:tv/Bif5QS2TSYQXEh5a3rtEVBYROYJiRvtXUkv2u0WmnIJYr/CClcQoohUtpo4sTFwYl8n45kUqUdlSK2wltFcdMih4XpJKK+NrQIlxGhm0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2556; 7:XKYMogkSIj/iRCQFQOPrsqk7dtc3TEfdq9BOofBxywhzxPXSx/Fo5/4hHDo+47bW/0oKCrMKuiA0xZjdWicM6ywaRNPuyOhKv2xbZrvtJcwo8fE3FF4paj4WECs7ejwHyRAQPX+HpJbJCzbkyoJt/V0A4USbY/bmZVveYdo0T8qtiKRSXzEDbWmhAjNrR1DUQ436bjcMOadBqM7fneJraZGJ55O3yhmLHYsqlZubBs+dyMEvUV1j8U/Ax85ltu+8ptr75f/UsAuomscRb3uLSK5LQvxnIidboquTjUBv1/z31seyu4PP842ApQEJEtK+3KqnyiYUBhx8GxfNnXrKOtiq7dB7Sa1p8CkUIZgmTO0pIzdDi3hqb3t7iHRCR+Id51uyC7XvxZV54MJDrurXcGWSFw9kODqvtuvzTLkJRfmX4iqfm3X8CxeULdA4EiYfR0d6uOnG0HCdDXnaDwv8LEqf+kLvYTckR8lStID2wNXgEZ+lqi+jmzgJoE8ZOc1e8to+8i+9s6BKhvmY5WxsPO4ExM+TezyQQKImFUVGM8Q8uMoBLXK50UZMAoJ6JsZJCQEMsEYSlCzePz8/9sX+XyekN/8Mdxzcs0Mnn8X1GGNUAltWgWqOAXmrQQY5JhcS7fm2nVYM+oWXFnT0B0DPUjRiG1Cd5q6sF2seYpGieqo/vD4n2IGGX1iZTQs2CAwMqybEBfkN6ndhwnPNQ6KIszBfaFkbD+VokKfSIfOsZMkEgHjms354I1Pq6eZWy+f5tfRfYbhqdPrDeVIJ3TrG+D+cKTyJ216FSNnuHmvXhKk= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 16:24:27.2354 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2556 X-Mailman-Approved-At: Fri, 14 Jul 2017 01:03:04 +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 The legacy path implements setcmap in terms of crtc .gamma_set. The atomic path implements setcmap by directly updating the crtc gamma_lut property. This has a couple of benefits: - it makes the redundant fb helpers .load_lut, .gamma_set and .gamma_get completely obsolete. They are now unused and subject for removal. - atomic drivers that support clut modes get fbdev support for those from the drm core. This includes atmel-hlcdc, but perhaps others as well? Signed-off-by: Peter Rosin --- drivers/gpu/drm/drm_fb_helper.c | 231 ++++++++++++++++++++++++++++------------ 1 file changed, 160 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 721511da4de6..42090fe00ef9 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1195,27 +1195,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; @@ -1248,57 +1227,138 @@ 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; + drm_modeset_lock_all(fb_helper->dev); + 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; + + 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; } + drm_modeset_unlock_all(fb_helper->dev); - drm_modeset_lock_all(dev); - if (info->fix.visual == FB_VISUAL_TRUECOLOR) { - rc = setcmap_pseudo_palette(cmap, info); - goto out; + return ret; +} + +static struct drm_property_blob *setcmap_new_gamma_lut(struct drm_crtc *crtc, + struct fb_cmap *cmap) +{ + struct drm_device *dev = crtc->dev; + struct drm_property_blob *gamma_lut; + struct drm_color_lut *lut; + int size = crtc->gamma_size; + int i; + + if (!size || cmap->start + cmap->len > size) + return ERR_PTR(-EINVAL); + + gamma_lut = drm_property_create_blob(dev, sizeof(*lut) * size, NULL); + if (IS_ERR(gamma_lut)) + return gamma_lut; + + lut = (struct drm_color_lut *)gamma_lut->data; + if (cmap->start || cmap->len != size) { + u16 *r = crtc->gamma_store; + u16 *g = r + crtc->gamma_size; + u16 *b = g + crtc->gamma_size; + + for (i = 0; i < cmap->start; i++) { + lut[i].red = r[i]; + lut[i].green = g[i]; + lut[i].blue = b[i]; + } + for (i = cmap->start + cmap->len; i < size; i++) { + lut[i].red = r[i]; + lut[i].green = g[i]; + lut[i].blue = b[i]; + } + } + + for (i = 0; i < cmap->len; i++) { + lut[cmap->start + i].red = cmap->red[i]; + lut[cmap->start + i].green = cmap->green[i]; + lut[cmap->start + i].blue = cmap->blue[i]; + } + + return gamma_lut; +} + +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_property_blob *gamma_lut = NULL; + 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; + bool replaced; + + drm_modeset_acquire_init(&ctx, 0); + + state = drm_atomic_state_alloc(dev); + if (!state) { + ret = -ENOMEM; + goto out_ctx; } + state->acquire_ctx = &ctx; +retry: for (i = 0; i < fb_helper->crtc_count; i++) { crtc = fb_helper->crtc_info[i].mode_set.crtc; - crtc_funcs = crtc->helper_private; - red = cmap->red; - green = cmap->green; - blue = cmap->blue; - transp = cmap->transp; - start = cmap->start; - - if (!crtc->gamma_size) { - rc = -EINVAL; - goto out; + if (!gamma_lut) + gamma_lut = setcmap_new_gamma_lut(crtc, cmap); + if (IS_ERR(gamma_lut)) { + ret = PTR_ERR(gamma_lut); + gamma_lut = NULL; + goto out_state; } - if (cmap->start + cmap->len > crtc->gamma_size) { - rc = -EINVAL; - goto out; + crtc_state = drm_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) { + ret = PTR_ERR(crtc_state); + goto out_state; } + replaced = drm_property_replace_blob(&crtc_state->degamma_lut, + NULL); + replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL); + replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, + gamma_lut); + crtc_state->color_mgmt_changed |= replaced; + } + + ret = drm_atomic_commit(state); + if (ret) + goto out_state; + + for (i = 0; i < fb_helper->crtc_count; i++) { + crtc = fb_helper->crtc_info[i].mode_set.crtc; + r = crtc->gamma_store; g = r + crtc->gamma_size; b = g + crtc->gamma_size; @@ -1306,28 +1366,57 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) 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)); + } + +out_state: + if (ret == -EDEADLK) + goto backoff; + + drm_property_blob_put(gamma_lut); + drm_atomic_state_put(state); +out_ctx: + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); - for (j = 0; j < cmap->len; j++) { - u16 hred, hgreen, hblue, htransp = 0xffff; + return ret; - hred = *red++; - hgreen = *green++; - hblue = *blue++; +backoff: + drm_atomic_state_clear(state); + drm_modeset_backoff(&ctx); + goto retry; +} - if (transp) - htransp = *transp++; +/** + * 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; - rc = setcolreg(crtc, hred, hgreen, hblue, start++, info); - if (rc) - goto out; - } - if (crtc_funcs->load_lut) - crtc_funcs->load_lut(crtc); + if (oops_in_progress) + return -EBUSY; + + mutex_lock(&fb_helper->lock); + + if (!drm_fb_helper_is_bound(fb_helper)) { + ret = -EBUSY; + goto out; } - 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); + +out: mutex_unlock(&fb_helper->lock); - return rc; + + return ret; } EXPORT_SYMBOL(drm_fb_helper_setcmap);