From patchwork Thu Jun 22 06:06:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9805487 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 488BA60329 for ; Fri, 23 Jun 2017 01:06:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D8C81FFEB for ; Fri, 23 Jun 2017 01:06:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41E4428405; Fri, 23 Jun 2017 01:06:15 +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 7EA5A1FFEB for ; Fri, 23 Jun 2017 01:06:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E557D6E6FB; Fri, 23 Jun 2017 01:04:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0103.outbound.protection.outlook.com [104.47.1.103]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F2B46E5DA; Thu, 22 Jun 2017 06:38:35 +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=246fjaUiDOhRT0huMQcnOjRvXjUVfCX3wGvXlQDBE/c=; b=UUeMClwECMDTslYv77D03oaJKt4D2Jgt1h7VNXc/DYKO6amP03uOWWfIJ87yKDUOWYT4beBOVcYmfp/OaPX57S4len8L0UbMbryoOSvGseddjASVgNWNhwfOjyiE43VEVrOWQxhGBMnvMllr/clzH24MoZsqRrtGyane232dr5Q= 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 HE1PR0202MB2553.eurprd02.prod.outlook.com (2603:10a6:3:8f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Thu, 22 Jun 2017 06:06:02 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v2 03/14] drm/fb-helper: do a generic fb_setcmap helper in terms of crtc .gamma_set Date: Thu, 22 Jun 2017 08:06:26 +0200 Message-Id: <1498111597-10714-4-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498111597-10714-1-git-send-email-peda@axentia.se> References: <1498111597-10714-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: DB6P193CA0003.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::13) To HE1PR0202MB2553.eurprd02.prod.outlook.com (2603:10a6:3:8f::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 623667e0-d14f-4b76-748d-08d4b934c4af X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500055)(300135000095)(300000501055)(300135300095)(22001)(300000502055)(300135100095)(300000503055)(300135400095)(201703131423075)(300000504055)(300135200095)(300000505055)(300135600095); SRVR:HE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Biyv+OnwemOZl+GYNEcsnACr4ZKwtj1bl+OHog+aIHywtUZ471N4qslJRmuQqmHhxSwVTx9LUchFsHP9qpfRGNvz1yX1H8WdG5xDYSDfvPrkEiYMifPtrcYNgk8cKyCOy+BsjflrJaHl+mXyV0ttEkhV2C/jS0Wq64RmB4o7j0Kh42byj+NijOLo+b0+SjMJhjLp077Z8uDBrElHTCNTHb5sq5PoqXl4V1CtKzcIEgW1Q3pDoXF4BxTes1mvU+X/wDuq1nndOrJYEWA2kzNSRmSUuufQhViBO+gT41PQWJYRY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(2016111802025)(20161123560025)(20161123555025)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0202MB2553; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0202MB2553; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2553; 4:bSMNuVdFi1HVtGen52O3rY9B8kh5b8mdGOCa8UTw?= =?us-ascii?Q?xaWzjZUnJ1S3Jo9xCHXsvN8pxxB9JHQY3sigzA5X6gGpr17Cn1FJnJlrxoH+?= =?us-ascii?Q?7T0BfMZYpxuUBCB5JPwxWpRgB/wtGAosUN3/Mgzd24khjecWjwKD2vRv/ShO?= =?us-ascii?Q?qb2Xt0p/rT00KmDCGEvMZ1s4O6M3kaTmALX1gJGLRXiVFhskvezGbK8+DZLy?= =?us-ascii?Q?ef/IESWwM+zXWAGxVO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?Q?m1d38VW5iF+RvYbj+Dgmk7I4VWlaqbuv7A80BRgEkCB15qp5i7aJu5UkKhOH?= =?us-ascii?Q?m5NO2fBpNrcoTuEVtxDGDKhD/mJCwXiWyQ7H?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39450400003)(39840400002)(7416002)(6486002)(5660300001)(3846002)(6116002)(76176999)(36756003)(305945005)(50986999)(2906002)(50466002)(25786009)(478600001)(66066001)(42186005)(33646002)(50226002)(48376002)(2351001)(2361001)(6512007)(54906002)(53936002)(8666007)(6666003)(81166006)(6916009)(2950100002)(47776003)(6506006)(38730400002)(5003940100001)(110136004)(8676002)(86362001)(74482002)(7736002)(189998001)(4326008)(41533002)(142923001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0202MB2553; H:orc.lan; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2553; 23:s6iMkLdteuK1NJuD7pqKXvPivjcEWP3y/KS6jrK?= =?us-ascii?Q?EtHg+NDbWCrSICo8YzdHZ9R2OQiezatLCdeUP2CaluM/UUV9O4h5E0SBgz6N?= =?us-ascii?Q?aufjW9LPrt8yks0SUUAB3kFz3PMMPh3Z8v5hxD9JnZ7WZYDOn7jiioHOl4Nz?= =?us-ascii?Q?f4WZ1BJyqknuci084AAzqxvyUwOpsyddUkBLFgLodWHTs0+XboqZMvC25Mf1?= =?us-ascii?Q?i2C/NXz6yF+BFDI4gWQBr42c85dJQWxOE2dvU8TVNt+6jBJaLqMdf7CR267+?= =?us-ascii?Q?nzCk29nHhENBcAsHqRhzE7Ad5Zvj9d4TolFUD+5hmPFo/tej76JQlhjo2LD5?= =?us-ascii?Q?iZvuDzN4Imw5haoibLND49xhviXgnqcU4yJntIGFJO2DSFOgPVfvyUWf4hM0?= =?us-ascii?Q?62WMhaZ5oTGp4ojS2knSKwjHgQcwA4Ji+1brWOzx/AOjRKetkri3KiOovMsM?= =?us-ascii?Q?QoSh2qxfJWEe1EnWjeUENWv9n1MsNlUyCGLbtGZZY2xNMfa9eaxi6q+UF8Hk?= =?us-ascii?Q?nLd/dP4cI9tR8g1cspOU0CI/tER82CmI/jCxceLs78fTm0x3/UEmhRpWfxpB?= =?us-ascii?Q?ZrmruNyp01Z+asz6QL5WGOg1hwjJt8Wvz65qR7NYodwhzuWOL2M5nM1YceCV?= =?us-ascii?Q?FHvD6OfAUubf2KWHjbzoHGCZ0CojW+Eil/QRvOtbXOO4nn+ZdNAhFoBofKoC?= =?us-ascii?Q?K80zQsK3SzUrqOJGVOnHKB3qfXn/Cj6dTNXQivrr8p8/FcRJHC3t+p68fhjO?= =?us-ascii?Q?u59zreVPNsUSwECpUso5lj0Ub7ci+JmIh39qbpy6tq+kOHwRgr4v5em2R4V2?= =?us-ascii?Q?w1iTqPGJFoEw3Baejtjj3ssUQ8hMGomEHkMi7PPfPrqnDqpTV96BVTnARkmC?= =?us-ascii?Q?MpSOwB+RfeGlHgpb7UywkW3iOwy8o22kbr7S6LCSUK/IOEOu/aQLqQKeHVe2?= =?us-ascii?Q?K8RQGrbOupiMmDWSgsqt35iWkgMiw+WP0jLovw66wratDUYef9qC+9CCVqge?= =?us-ascii?Q?PB7xnghHjfjGXURf+FbL62aY4gJlMjKUmKEZQgbd1LT0QZgX9AWZ9dyk4L/9?= =?us-ascii?Q?ZmH5rAQaD5JCAh9uJoaZWb/0KfLj3/5dm4nDUxCJFmijrUEJXiiwfqqKNC+w?= =?us-ascii?Q?nBfqMaAi9rugchNv9QyvcAPOSD4DGOUyJ+tERfPGhs13RVf2ck6jYCwPlSWN?= =?us-ascii?Q?kRA3Ii6mosUe3Cek=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2553; 6:GWLhPRAQss5MKVKJw9PGgveL7WPZbZ7gbccprWO1?= =?us-ascii?Q?7fD2G2fE0MMiexhWV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jSONrbscHMWWsS92tqe3sXyVoxxClGGz5CTv481N0CDuRbMubJfYHB1z6+Fwik9qNxT7t3tcT9ptiRJruGiXsuuxipOwIlXCRWa/VVJTRkkBHZ7nITwp+sHjFkzqULQC7LM5W3T9oGx5eiYfr7lYwaBxb2P3LFK0k9C74xCJso8FtWkNNURsxG+Vav7Hun1O+2inoNssAjvjAl7LUP1G0vF9QPpeCTFFVMSGBs2o2AR/ksSOtKJb/mEhepkpaS88N/H7ZvkqinT6cgdwLXye4UUyz3YhiIzywXCSlbMdXj9WFTjBiaouERllzCx2DIav98Ir2Ybx2BOzVYb7TigjKy0ZPS0tK9qXR2ba6rBkToyIMFN9YF9aqM7X3WCVVho4S8jq9cMIROBhVX5eAgpgQoqpMa35+roe+JJNPJ3wYrqwP1jIHe6fnvZXPouj499PoxKOFN4wJffQeyTwqS9M/df9oLMEosrV6NVims414Aq+wemQ0GK2ya4Fji5i6MamJOKzwlQCpHa0zxhQJCTJIRE3ZNzjZiCbuGqa32J0DhbStpedxzqLl/lr8TW7UV9PAw1ScyKkuLAjjo+is= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 06:06:02.2215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2553 X-Mailman-Approved-At: Fri, 23 Jun 2017 01:03:45 +0000 Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, amd-gfx@lists.freedesktop.org, Daniel Vetter , Boris Brezillon , Russell King , Ben Skeggs , Dave Airlie , intel-gfx@lists.freedesktop.org, Vincent Abriou , Philippe Cornu , Peter Rosin , Yannick Fertre , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Gerd Hoffmann 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 totally obsolete. Signed-off-by: Peter Rosin --- drivers/gpu/drm/drm_fb_helper.c | 154 ++++++++++++++++------------------------ 1 file changed, 63 insertions(+), 91 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 7ade384..58eb045 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1150,50 +1150,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; - - if (info->fix.visual == FB_VISUAL_TRUECOLOR) { - u32 *palette; - u32 value; - /* place color in psuedopalette */ - if (regno > 16) - return -EINVAL; - palette = (u32 *)info->pseudo_palette; - red >>= (16 - info->var.red.length); - green >>= (16 - info->var.green.length); - blue >>= (16 - info->var.blue.length); - value = (red << info->var.red.offset) | - (green << info->var.green.offset) | - (blue << info->var.blue.offset); - if (info->var.transp.length > 0) { - u32 mask = (1 << info->var.transp.length) - 1; - - mask <<= info->var.transp.offset; - value |= mask; - } - palette[regno] = value; - return 0; - } - - /* - * 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; -} - /** * drm_fb_helper_setcmap - implementation for &fb_ops.fb_setcmap * @cmap: cmap to set @@ -1203,12 +1159,10 @@ int drm_fb_helper_setcmap(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_modeset_acquire_ctx ctx; struct drm_crtc *crtc; u16 *r, *g, *b; - int i, j, rc = 0; - int start; + int i, ret; if (oops_in_progress) return -EBUSY; @@ -1216,65 +1170,83 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) if (cmap->start + cmap->len < cmap->start) return -EINVAL; - drm_modeset_lock_all(dev); + drm_modeset_acquire_init(&ctx, 0); +retry: + ret = drm_modeset_lock_all_ctx(dev, &ctx); + if (ret) + goto out; if (!drm_fb_helper_is_bound(fb_helper)) { - drm_modeset_unlock_all(dev); - return -EBUSY; + ret = -EBUSY; + goto out; } 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 (info->fix.visual == FB_VISUAL_TRUECOLOR) { + u32 *palette; + int j; - if (info->fix.visual != FB_VISUAL_TRUECOLOR) { - if (!crtc->gamma_size) { - rc = -EINVAL; + if (cmap->start + cmap->len > 16) { + ret = -EINVAL; goto out; } - if (cmap->start + cmap->len > crtc->gamma_size) { - rc = -EINVAL; - goto out; + palette = (u32 *)info->pseudo_palette; + for (j = 0; j < cmap->len; ++j) { + u16 red = cmap->red[j]; + u16 green = cmap->green[j]; + u16 blue = cmap->blue[j]; + u32 value; + + red >>= 16 - info->var.red.length; + green >>= 16 - info->var.green.length; + blue >>= 16 - info->var.blue.length; + value = (red << info->var.red.offset) | + (green << info->var.green.offset) | + (blue << info->var.blue.offset); + if (info->var.transp.length > 0) { + u32 mask = (1 << info->var.transp.length) - 1; + + mask <<= info->var.transp.offset; + value |= mask; + } + palette[cmap->start + j] = value; } + continue; + } - r = crtc->gamma_store; - g = r + crtc->gamma_size; - b = g + crtc->gamma_size; - - memcpy(r + cmap->start, cmap->red, - cmap->len * sizeof(u16)); - memcpy(g + cmap->start, cmap->green, - cmap->len * sizeof(u16)); - memcpy(b + cmap->start, cmap->blue, - cmap->len * sizeof(u16)); + crtc = fb_helper->crtc_info[i].mode_set.crtc; + if (!crtc->funcs->gamma_set || !crtc->gamma_size) { + ret = -EINVAL; + goto out; } - for (j = 0; j < cmap->len; j++) { - u16 hred, hgreen, hblue, htransp = 0xffff; + if (cmap->start + cmap->len > crtc->gamma_size) { + ret = -EINVAL; + goto out; + } - hred = *red++; - hgreen = *green++; - hblue = *blue++; + r = crtc->gamma_store; + g = r + crtc->gamma_size; + b = g + crtc->gamma_size; - if (transp) - htransp = *transp++; + memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(u16)); + memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(u16)); + memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(u16)); - rc = setcolreg(crtc, hred, hgreen, hblue, start++, info); - if (rc) - goto out; - } - if (crtc_funcs->load_lut) - crtc_funcs->load_lut(crtc); + ret = crtc->funcs->gamma_set(crtc, r, g, b, + crtc->gamma_size, &ctx); + if (ret) + break; } - out: - drm_modeset_unlock_all(dev); - return rc; +out: + if (ret == -EDEADLK) { + drm_modeset_backoff(&ctx); + goto retry; + } + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); + + return ret; } EXPORT_SYMBOL(drm_fb_helper_setcmap);