From patchwork Thu Jun 22 10:22:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9805471 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 A522F60329 for ; Fri, 23 Jun 2017 01:05:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A998A1FFEB for ; Fri, 23 Jun 2017 01:05:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E19028405; Fri, 23 Jun 2017 01:05:23 +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=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 BE59D1FFEB for ; Fri, 23 Jun 2017 01:05:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21ADE6E724; Fri, 23 Jun 2017 01:04:07 +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-db5eur01on0095.outbound.protection.outlook.com [104.47.2.95]) by gabe.freedesktop.org (Postfix) with ESMTPS id DFB926E62A; Thu, 22 Jun 2017 10:22:21 +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=AncuVVQpEiAnu6K3ldTUqMeomJhNdUQGcYVY3Iw4NFE=; b=U9raLXvoBEfCZJe60XyZpPy8FEcmc2ApUo5ppltq9ePafbyfIRFF05DaBR2CYDqk5cZIZVynvdTlhUqe8RtoYeq0EjrmS8JkZoEzvR49ZCkxUCbc1Lp3nykNQFXY8w8KxmhrdjT4Qz+TXQXAeDMROYfPW/VUqcerZV3EBqAAmLY= Authentication-Results: free-electrons.com; dkim=none (message not signed) header.d=none;free-electrons.com; dmarc=none action=none header.from=axentia.se; Received: from [192.168.0.125] (81.224.171.159) by AM5PR0202MB2547.eurprd02.prod.outlook.com (2603:10a6:203:6d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Thu, 22 Jun 2017 10:22:15 +0000 Subject: [PATCH v2 03/14] drm/fb-helper: do a generic fb_setcmap helper in terms of crtc .gamma_set To: linux-kernel@vger.kernel.org References: <1498111597-10714-1-git-send-email-peda@axentia.se> <1498111597-10714-4-git-send-email-peda@axentia.se> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Thu, 22 Jun 2017 12:22:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1498111597-10714-4-git-send-email-peda@axentia.se> Content-Language: en-US X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: DB6PR07CA0139.eurprd07.prod.outlook.com (2603:10a6:6:16::32) To AM5PR0202MB2547.eurprd02.prod.outlook.com (2603:10a6:203:6d::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30e46aea-a1e3-4f88-1864-08d4b9588f55 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075); SRVR:AM5PR0202MB2547; X-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VFWWox9Ik5oQ+YKZGo0EIMY0XWE9xCwMjiXL/1Xfa1eRXP1bPyBYRg6DznnwFh0k6BiadD7QRJ2mCQySqG8L8m7q2MGXvun/O/LrWZlJiU9wyKr8qcfw+TW4nobkwW7t0jRA== 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)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(2016111802025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0202MB2547; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0202MB2547; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjAyMDJNQjI1NDc7NDo5SmpJOTJZeC9CNlpjWThtRkRzaFpPSGZI?= =?utf-8?B?a25LNDF5V25JNWhjQ0VyTlhxRnhyY1BsQk02MndCTkRHajhkNFd0OEtwYVFW?= =?utf-8?B?cFJyN3ErUTUrbE82U1FiYk01ZE12MjE5bU9EU2RtSnczYnZnbXVsai9xcElQ?= =?utf-8?B?ZU8rWmR1OXdoUjRxYXMzc0xSSHBxN0hhdk9vaURxY0c0VWVmbTd0OGRQR01w?= =?utf-8?B?ZEFGKzJ6Ly9sMDVoZElabVBqckFadkJvdXgvaEJiNnRwWTlOSHhIRGZWR0hP?= =?utf-8?B?YWlKWjhQUDRablB2SE9EeVdoTmhJZHU1cVA1R0JvTXk5cHJuSzRYaEdGZGdY?= =?utf-8?B?UlFqWjgyU0R4WHR1Vjd1azNWNnkveHg2aGNIMU1MYWM2b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J5ODBncGlaN1NmdDFYeGQ4?= =?utf-8?B?MjFkODF2WVpKejZUd0YwcEZERTFJSHNJUVVVVFZSYTNCejNjTTkrV0FTUXNr?= =?utf-8?B?KzJuNldCTnZNemJzN0drZnBQMnQwMTdyMjFkRlhwSmZuampHc0d1NGJ3a2dN?= =?utf-8?B?NEppdTZoTjdRNmJDMWUzRGNHVFhNU0F0K0VXdkJWZ1pKMFppUmQ3R1FwT3Q0?= =?utf-8?B?cTQxTzIyRTk0U2lVYlJIZ2J6eVIvTXNSQXZINjhKS2lFTjNmOTRZaTh4ZnJx?= =?utf-8?B?ZEJlbnhMZjgweW4vRlRrSUVnbXBBLzhSbjVqZG0wcWVub1RNRGJuQ25kMEha?= =?utf-8?Q?NOZ3oic1IJR+7TocgVIzd?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6049001)(39400400002)(39830400002)(39410400002)(39450400003)(6116002)(2351001)(4001350100001)(50466002)(110136004)(38730400002)(65956001)(66066001)(47776003)(3846002)(2361001)(65806001)(2906002)(4326008)(189998001)(8666007)(33646002)(23676002)(77096006)(6486002)(31686004)(76176999)(54356999)(83506001)(7416002)(64126003)(230700001)(305945005)(86362001)(65826007)(5660300001)(31696002)(50986999)(25786009)(7736002)(117156002)(3260700006)(478600001)(42186005)(8676002)(36756003)(53936002)(54906002)(2950100002)(74482002)(6916009)(6666003)(81166006)(41533002)(142923001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0202MB2547; H:[192.168.0.125]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjAyMDJNQjI1NDc7MjM6dFdLbGdwL3NDWHJ5VE1JNHdjRHd1a3Nr?= =?utf-8?B?ZXRnaFU0SnM5dlFMNWsrWWhnRWlXY21vc2s4YlFPZno4Q081VU1UR0c4Nmdk?= =?utf-8?B?cG0yWGdNLzJtT2k3NWVle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ZfosUT9hfA= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 10:22:15.0958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0202MB2547 X-Mailman-Approved-At: Fri, 23 Jun 2017 01:03:44 +0000 Cc: Boris Brezillon , amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Philippe Cornu , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Russell King , Yannick Fertre , Gerd Hoffmann , Daniel Vetter , Alex Deucher , Dave Airlie , virtualization@lists.linux-foundation.org, Vincent Abriou , =?UTF-8?Q?Christian_K=c3=b6nig?= , Ben Skeggs 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 | 151 +++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 88 deletions(-) This is an alternative version rebased on top of Daniel's "fbdev helper locking rework and deferred setup" series. And as noted by Daniel, .gamma_set does an atomic commit. Thus, the locks needs to be dropped and reacquired for each crtc. So, that is fixed here too. Doing it like this with a couple of individual alternative patches instead of sending a whole new series since the dependency on Daniel's series makes life somewhat difficult... Cheers, peda diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 4aceb59..aa025f1 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1257,50 +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; - - 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 @@ -1310,12 +1266,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 = 0; if (oops_in_progress) return -EBUSY; @@ -1329,61 +1283,82 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) return -EBUSY; } - drm_modeset_lock_all(dev); - for (i = 0; i < fb_helper->crtc_count; i++) { - crtc = fb_helper->crtc_info[i].mode_set.crtc; - crtc_funcs = crtc->helper_private; + drm_modeset_acquire_init(&ctx, 0); - red = cmap->red; - green = cmap->green; - blue = cmap->blue; - transp = cmap->transp; - start = cmap->start; + for (i = 0; i < fb_helper->crtc_count; i++) { + if (info->fix.visual == FB_VISUAL_TRUECOLOR) { + u32 *palette; + int j; - if (info->fix.visual != FB_VISUAL_TRUECOLOR) { - if (!crtc->gamma_size) { - rc = -EINVAL; - goto out; + if (cmap->start + cmap->len > 16) { + ret = -EINVAL; + break; } - 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; +retry: + ret = drm_modeset_lock_all_ctx(dev, &ctx); + if (ret) + break; - 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 drop_locks; } - for (j = 0; j < cmap->len; j++) { - u16 hred, hgreen, hblue, htransp = 0xffff; + if (cmap->start + cmap->len > crtc->gamma_size) { + ret = -EINVAL; + goto drop_locks; + } - 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; + ret = crtc->funcs->gamma_set(crtc, r, g, b, + crtc->gamma_size, &ctx); + if (ret == -EDEADLK) { + drm_modeset_backoff(&ctx); + goto retry; } - if (crtc_funcs->load_lut) - crtc_funcs->load_lut(crtc); +drop_locks: + drm_modeset_drop_locks(&ctx); + if (ret) + break; } - out: - drm_modeset_unlock_all(dev); + + drm_modeset_acquire_fini(&ctx); mutex_unlock(&fb_helper->lock); - return rc; + + return ret; } EXPORT_SYMBOL(drm_fb_helper_setcmap);