From patchwork Thu Jul 6 12:20:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9829277 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 18ECB60317 for ; Fri, 7 Jul 2017 00:43:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08F4F1FF82 for ; Fri, 7 Jul 2017 00:43:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F169F28549; Fri, 7 Jul 2017 00:43:53 +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 5802D1FF82 for ; Fri, 7 Jul 2017 00:43:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEFAD6E6D0; Fri, 7 Jul 2017 00:43:12 +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-db5eur01on0117.outbound.protection.outlook.com [104.47.2.117]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AC258997C for ; Thu, 6 Jul 2017 12:19:48 +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=s/5qNrk1qwzqGCXa6v+prHow0wZj/V3TSNZs1zuDYb0=; b=gXQywEsYEEx+mbXtCDESMIvJDwlGTDslrhVSk+OpSa0/pTGwtgJFxXE8hJYXC36c2K8wSJGuIc/xzYqJu/tRIg7iOg64pSMdzr0N+LcuIoKORiu74yfJmgiGj87m5KyPbL9WjIAWpkfownnD+2/Rpg8Au9Czh5QEfB/vfE9J6Sw= 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.lan (81.224.171.159) by AM5PR0202MB2548.eurprd02.prod.outlook.com (2603:10a6:203:6d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Thu, 6 Jul 2017 12:19:45 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v4 03/14] drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths Date: Thu, 6 Jul 2017 14:20:37 +0200 Message-Id: <1499343648-29695-4-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1499343648-29695-1-git-send-email-peda@axentia.se> References: <1499343648-29695-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: VI1PR0801CA0084.eurprd08.prod.outlook.com (2603:10a6:800:7d::28) To AM5PR0202MB2548.eurprd02.prod.outlook.com (2603:10a6:203:6d::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c402b19b-146d-46f2-52cd-08d4c4694a41 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:AM5PR0202MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0202MB2548; 3:6TI9h4QPCn6eJbqHyLWrXOSyHCMBrtgd6146hnCKKlgFz+X/DqvHaaF54lPJUBmMHVM/60YhWPiZLTbXqh10aNJQ+KdMX/QP97vacrNT7gly7IjO29ewX65GmV/ws6wt+SEpLWzMjbSzbIFOVu3toJbmOGtzmq1G9K59azlJ1WnMxqiFI2ysiEZ6fpLrISX/KbfD7TfUc0At4tMOhQ6HasmFs/KTnJxkg/WRP3UsBapO8XMbZ5f13vT4UP8mXl6ov8oLwMPxK7h7nKtvuhL2KeydJHm6tx1ocDF+kmtgHn+hZAzn4aOUuRIcEfmz/6b0QwMY+hpWtIm+CANkIzFlH8A5H6NMglrNIV6Cy8P5WouYRhp1LFewWkbS9yjPW04cZkIX0qm23q34lj30ML/WY18M7zbycwaxx2+mG0QWuuaoem4dQWqVlUpeP1Y3d2pz3QV1y0DvMjGJNyBlrxGvkOCWQqhHF8OLbPGja2FrtzypEAFbxXCQ4w9WRynJmtctI7xmjfBbXpFXJz7tPzBiZHhpWPYbujihaeENLG8mQ6TIcXfLv40vGuviqZ6+iPFlHrDHawgUjfoEdOt2ivb9VbOwJXsnG5XcrvTFB/nFyAAzsFnnD9FYGyFPalLfIyEg9i22w79Uvv0PALs/bWTDBxVzTOoXvGsaJmfZfKawHyItuXfDmje1vFW6zPL4QedSRXBTiz8496E0+dL6hF/3gQ== X-MS-TrafficTypeDiagnostic: AM5PR0202MB2548: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0202MB2548; 25:+fZCdUtoY4l3kocDOYfL/uddmBAkwpCCHxHFpobn2maIb3q8F+VBKc0IlRXIrJSeIl2LuKEGpileTmoNRWuuc1NIQsw/qSh6XjsfmNZEHBILUAFWmAI4Nbtosi5nFJnSn/839bDRQJvVZR32gexjXy0qOvuyJ+y7rkRw6/TerrGhdSL3/0wwI1bAPaVxfoXQC84hqRJfDxmv5EPv8eC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lguexCRYd9gwVgBNmkixpB4nnPQoAILNCOKCFlwPi+W3KxsJF8nyVm74Eu/cyFXDqYads/J5/T0/w854lXxpSyJtzTNK0jD8u87d6yxwy22E3Gtk8naJX47sWhAIj6jlkn+eyOW2cUnpPuQU5NVYSY6MuB6FL83Xg5lck3M5rrbXTyiJfYpNU7CY4ORKrRg3JQAGgxtH7XRaJieqbstzmab153R9NEM6tRcR9MYNPMIXu9MW5jQktgdXqa2gjxsPFYobe4edFSDsUJAq7ClHjdU4KjHWkvAh4Oh1rCM05mAHhVti2jyTYvIAg4rq9vSVNz4YIMDNpVd1MDDr9ja0EU+QafpiYSuiKnlF+QL5R+zWsHc6A0z8Z8yys= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(2017060910047)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558100)(2016111802025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0202MB2548; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0202MB2548; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0202MB2548; 4:BSf3lKFgLNvalAJuP28nszF1pJR0Ix9f7DPF12RI?= =?us-ascii?Q?YLfRwiI8DFGbWM3V2yLjmJPis+2oR+PBC33Hj9XxLYxQgpCBHlqBumya+7wI?= =?us-ascii?Q?vxKtN/hUtxcLg38Ch8ldhaU0UhkFu0FvVC34kfQAzALgcsA0q78ggfIXrpYZ?= =?us-ascii?Q?BU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x60R0lfUba4cnEp?= =?us-ascii?Q?afEcrxgnwDkKOmwdcwyBHIA5SCnc/qKTaBpAm3clPsQqTUcUcyo07NqmMd88?= =?us-ascii?Q?tk7gbhTEhs7O265Ewm0AeOSnhTup4KcVjmzs4rYmv0C1hHUJbS/SoRKdSrFh?= =?us-ascii?Q?Q4EJfdjryRXHzMG0j3bkaw4TITaSfUebIwrQxO2hFTA51aUJ1jCP+PC//Hd5?= =?us-ascii?Q?B29G1b98cziEPxnbdz5eXxOnEsV5093aH9dhCYJrLQFU1S+cVv32JjiRRhgG?= =?us-ascii?Q?ST4z4iCLLeE38eit/eePaF4=3D?= X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39410400002)(39400400002)(39830400002)(39450400003)(6512007)(66066001)(33646002)(5660300001)(2361001)(6916009)(2351001)(478600001)(2950100002)(6666003)(54906002)(5003940100001)(38730400002)(42186005)(50226002)(47776003)(110136004)(6486002)(305945005)(50466002)(189998001)(81166006)(3846002)(76176999)(8676002)(6116002)(2906002)(48376002)(50986999)(36756003)(4326008)(7736002)(53936002)(86362001)(6506006)(74482002)(25786009)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0202MB2548; H:orc.lan; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0202MB2548; 23:OdcQDsjTOccYwhZx/7VKp7GqSkE1z2RwdFjZzv4?= =?us-ascii?Q?2ReBIyBs0et9r46qLL+U/0GXz5EnQZ+YN87IejUK4IW2ff8YhVnn/OjZZ3TK?= =?us-ascii?Q?isGZPrLGc4FDNIlMDg8vKWJLwk186Bbl66Lesz8fIKrxzNLEk7YKpRbGIwWn?= =?us-ascii?Q?7sFZXFLijUXMsBkaXXvg+lyvDWmhnQrgY8Hj0Kj5yfG/975HBFlezjJ6b+EE?= =?us-ascii?Q?3rKhHzI/KMDWf1uu76xw3irrJGUB81jE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/yQWNnhwYG+sudrfQHt0HRdcAKhG+X8cYPieTYlPPFe9?= =?us-ascii?Q?s61rjKa3rqGeyRgbU4FiMYjUJltDSiMDlgTcK82wL2UtOL1dyYaetXtp/Lwr?= =?us-ascii?Q?/J7hNio2Q5zwrHV4yZ77C2NCbs3Bk2UcVRxgeTLbIkeajBTNcqYJKRsnex3W?= =?us-ascii?Q?nTk=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0202MB2548; 5:0Uh+E/Ybuh9wtaHfDOxR0lyNfZQj7QmuS7IRD+x44uLrUkxA/LVH3CPClyVjNq0uDp3SFLE31oDJtokYzooCqAbkkgG+948gnDhiDqGCpXsoPCaiu82+WfVoG7vMTAQql4FizTRd8Ql4FIKPyAB6iGHMGIJYRaqTXrANxOExAxAVRZG7//GusLPy14KffU9wfYrKrs4rqDUlc1pDpJJMxAii1TnlqeXetxGDxgJpusKLJcoyiUBe8t/RE8G55dPrNwUfX9B1uDUE46o98DB4g9fQRCeNhjwvMYuzzpt08sJiFJHAeg5GLUDiLVe+tWzwK7/zkCfCiKuHf119IMCOBLBz7GYTSLEXtK1yjH3uyMOuPQJzOqQm9tIAFndRackWRPiyyWljnstI0vW69asrumwi4zlJB5AdCzhu7GJ3lYMICR5qjtMHgFBbIMTsLZgv3boxNh+CSPPv08W9jHJ6zH5bJX8NajswuVlstF0y3t4rNCnhV/nBbFynfLFeshAG; 24:bJkU4t88LTdlYQZ36IXtoNbLeMMxRyW4hbPR7BQGDAAULyrWJQYicvdLcHD3DGLPA5+Hzcn8+z5KI4e8lKYJ+uTV65dG3L9LRrh+3sTv9L4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0202MB2548; 7:sxdVEDVa2bc6/XW3zz9BruTE/jGOe0pBwV7nsOAjnvve0GOCLbMZP4QI9/lpkRQn60pFxy4tbPfkFL/u2q4WTTRCZzyK+L66WajtK4qcwlTDY8H/WhxdtYKWCJGf52B3WNecXFsV6jDu3msS8B8If4xVI4Cj6JcRHnF9eMwu9LWFBe2E3o3DxyKvY6KLPlOZDV85g2UVoIuBxIlQtupQ35Yn+3HqqMZQTYS+qOLdYi/6sYZSLiogjX9YL8/8CzZDoOWJf+woQhSsMFfa0AUNa8BR9W45dlSsweY7ND/ImKGT2tkTN8UecMfZ8kYUwtmsZDctBH8yJBX400bcjidvCZi44g7iwnFYILRBAbY1w8E45y4zxHDNYwb4v5KNpVVouTR9YCfTD8ElkbMm9UMdurFkaObmGjKx9GGvkF4eqm20JmJ6GXvy+Xz1/IjYnj2hVBgvFTyFDaAzQhf+s2OFYu+Ds6wsIg4ACgXHUVxAbL3lb6PCDVkMXE9jQ4FB4LFWhdrTF4EQlumjMqN5LHsqCQgm9HAo21OMuCLo3SlPpcewVtnzxdNOgMJUSPNbdwaNhgLZslbMqNw9ZIsy5AxCaWGzeIf7P/++JqEPpNtC+2q/O6q4huYJZgRAleqb6ApUpqob8ETIAE8zHaNIJ/fHhec4DgnjwyLWVFaNmsh3UTZBRXd8aAgmgebdvC5Ws7SQ0KXitvQcWPG30I8XXLc5aX1x0rFFvLMNh3HsbZsKiwjls8rXUBi011ws4iGrN6xMZ+qPpd/6MX9QwEMHKqh9B5MErmsu0H3t8dIm7ruiUhk= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 12:19:45.2175 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0202MB2548 X-Mailman-Approved-At: Fri, 07 Jul 2017 00:43:09 +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 | 232 ++++++++++++++++++++++++++++------------ 1 file changed, 161 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 721511d..32d6ea1 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,140 @@ 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; + 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; + + 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; + bool replaced = false; - red = cmap->red; - green = cmap->green; - blue = cmap->blue; - transp = cmap->transp; - start = cmap->start; + crtc = fb_helper->crtc_info[i].mode_set.crtc; - if (!crtc->gamma_size) { - rc = -EINVAL; - goto out; + gamma_lut = setcmap_new_gamma_lut(crtc, cmap); + if (IS_ERR(gamma_lut)) { + ret = PTR_ERR(gamma_lut); + 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)) { + drm_property_blob_put(gamma_lut); + ret = PTR_ERR(crtc_state); + goto out_state; } + drm_atomic_replace_property_blob(&crtc_state->degamma_lut, + NULL, &replaced); + drm_atomic_replace_property_blob(&crtc_state->ctm, + NULL, &replaced); + drm_atomic_replace_property_blob(&crtc_state->gamma_lut, + gamma_lut, &replaced); + crtc_state->color_mgmt_changed |= replaced; + drm_property_blob_put(gamma_lut); + } + + 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 +1368,56 @@ 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_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);