From patchwork Tue Jul 4 10:36:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9825753 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 9A49060353 for ; Wed, 5 Jul 2017 01:18:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7173522AFC for ; Wed, 5 Jul 2017 01:18:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6617E2624A; Wed, 5 Jul 2017 01:18:46 +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 D2A0622AFC for ; Wed, 5 Jul 2017 01:18:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02F006E155; Wed, 5 Jul 2017 01:17:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0127.outbound.protection.outlook.com [104.47.0.127]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AFD26E12E for ; Tue, 4 Jul 2017 10:36:15 +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=G0VB9yOGuVx2XI8gTAUBVo0PwO0SR9VATyZhmY4VYVg=; b=oXmxW4Y1B8bABZD2m/aqFHxnCSQAu+XswkiSqzdpwRsd5KE6W1B0HL3f13sAa87Fb6VGbCuJ8s5gGIvr5eyggq3gJXPw5bCCdoS5eup/mY+seZ/e8LDVa21R/uyXIe58rvgV0O9OQ1lzGoGimFz3HAC8TpPJalYbZr7M0cfES/w= 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 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:10 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v3 01/16] drm/fb-helper: factor out pseudo-palette Date: Tue, 4 Jul 2017 12:36:57 +0200 Message-Id: <1499164632-5582-2-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: c378c790-16e7-46de-abb5-08d4c2c87d89 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:J+W0rfZGeIAJqc6tZNcQfvJpEOc6Qn4eLtjuNSxutIchs2RXjGvSaFDpbGdpch6Oev/3q0oc8b5asG1vcNm7QmoPYSz77fNcE18Aw/oGQsFQJfOVM6fkjqBWg9fegzQNy7l33kAVladHFNYpUopnejam6EeLcFddt26v0Wi/9uTN+O6R85pnhDMkYHFfCgv7bINlx5yXmON7hQMMQCrwEGZrtME8FE0vrr3PKi9BPN/UIeBh9owTwmwAeI//GBAq3wzAToNmF2ZeTDU0e1gkmhinzJ9t6dfXscei3pNMxR0Rr+t1aEripp+5uNuzuEKmbBdxZKCTlodkFHr2FjKaulIuy1aRuWexJIlURTFLNOQkTS8jrRfcVsqD+16KJ6ONGoCTjh89TFblRvf+z6+PkNkzbHO1N38eWHjtsaWCI5oajBzocunNV51gQOlX3QGGMJHZHCJQ43Z//q3+FUYU6GsLr7uhPB8kE+0MAZqoQkiYO+AfqV9J/tu59SPx8iD+YB8IOA+wz+0t9WDLnpkS1Ll0hwFc/TKmFolDVBa/c649BfUqtS0TtFxQxygyd6aIpz8gZEAy0WhuECsKGNjcmRtiSobzDRzo12HmxTBeHJGGpb7+6GUvlgAQA89+4UV12pdUqhjJmWtVHTXpz9nHrzaGRKPlcpZ+0z+wnryaqPRcRh8lVRIXtvAKVgqaELvMvu4hcP1lgNRAE+cxyRDD8g== X-MS-TrafficTypeDiagnostic: HE1PR0202MB2555: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2555; 25:Joy8BzpQ3W506YIjbchjKeU4ndFi0fNOUi/WKLcERND5hwrVUICXIMq7xJmfP3ZzriB1qXl0hezYhv7zhA/0FVlMMfMzIZkWPaPmrtjlXSN6HaeV5A1Y4X8YTpyjqgYp2VFQOBxfvdwWerv9JftkSMa8Id0eiH+gkxDqtqLiN681fEIpHL4eW/x1qj58vQderv23k3XsWn1PZAt6jqgwKXS+AT9e8QJm/cZ8HgRi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wScVvchlRph62sTdhZNt3alsESZXxNBMQgZUr2atqTmP82WWmzwNF2hkiCPREhQK+nyBgnRbqB/yQnrs17FA5oViKhxdcbvaW0D02cc48nU6UhAwo3nTimlY6C3o0o+P51O9Bq6UTCX9Mq2iPxkBJNm0NH0yaSrJHcWBKzpkpEFcjyaI+T35UZX05GIjor2YqVp5ZGwgWLAvAdYfWtnc5eoehL3Y974MfDtebqXs8icX4mOfBj7FrzrEDLRLkuyRP2M4G3f3JTusnKrn9FvyeGfMpuUhMQ1OBKncXvmSx/j9BJYGzMbo7TMqKdCwycu4j8+trY60WE+doLUx/ixTGiYHz1O5ca5Jc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(167848164394848); 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:XqHg2wuzBlKgR7CBAjAxoOnvWgB/MaNQsQ6bHopu?= =?us-ascii?Q?oJNyfP7T8RH4AhK6k123i9toMYnQ5itrssRNeJ9HvvJ7d4DDwQRg7vryFNjs?= =?us-ascii?Q?h7EG/T/j6AMeeCRet3AuwaA/wiLBZ8QMlvDc/AZATgUMI/51xwV8fcxl6dSr?= =?us-ascii?Q?oAakSK4/zZ01D47Hw5cShHUKlWzNbJDtc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AYm0nn2nerAl0cNLRbUM85zfi78g3YULc+y6mllgySMqavN?= =?us-ascii?Q?5r6O1vDUmW7QGW4au0pQL9H3uUH9JJf8fe5ZzmyEAy/+4QqpZRu5u1vhQoNV?= =?us-ascii?Q?B2NadHrf2KPPjZFypjQn6Qbu/RmsOkEHuMv7hgtlfH0/5QVcWqWf6yuCK1Sf?= =?us-ascii?Q?oHAVNyBk6nQrNqWeG7B9PMjbjkRrZJZROP1IiVSP?= X-Forefront-PRVS: 0358535363 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39830400002)(39400400002)(39410400002)(39450400003)(8676002)(81166006)(7736002)(47776003)(189998001)(3846002)(36756003)(305945005)(50466002)(6116002)(50226002)(53936002)(86362001)(33646002)(66066001)(2906002)(478600001)(42186005)(2361001)(74482002)(2351001)(38730400002)(110136004)(4326008)(25786009)(6506006)(6512007)(54906002)(5003940100001)(6486002)(6916009)(5660300001)(6666003)(2950100002)(50986999)(76176999)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0202MB2555; H:orc.lan; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2555; 23:wWyuJhJgFOF33vHVh7kM/L2Bt7ysZwhdo1X8YQd?= =?us-ascii?Q?KD9Ccc5QqTPeu0anbmPfgn14lM13BoFkVVeCBCAjz7FBEvU7xPpaQNYpNOpn?= =?us-ascii?Q?Ujd6ViC+6OsuVUfg3lVrXq0loSL3jUPXyn1tu2X/cm5klW6+OtmAx6+R45+o?= =?us-ascii?Q?ozbuLb5hj2f9Oe/vsqRq4BJUO5wyMtCr3N/XSQpyCu4JdF3+tILVGdjKGvZk?= =?us-ascii?Q?fFRLp0gIyjJ3JSI6MQRvG0gnNDq1a/WucLkr0U/QmBKnixUF2gGDZlAt00ph?= =?us-ascii?Q?SVc4I+FhFyF0FdyZSh88XicejEacVQSVzsCATetrqDleB/F8oFUNe5GV4R8A?= =?us-ascii?Q?xjfH/EtFnPup1G/QzRMZFJPVK0E4vye1Vcb1W6hllqlNBQj5L+vmdFYYd2E/?= =?us-ascii?Q?/YMPJD6wGtjFqSyggr6hs5rWoVfZ4zW1YxFt8MRf461TK8EH65AllppSN+Uh?= =?us-ascii?Q?R+DsMljiClIOff9OPhSvDr/GPklZK4LlH0q65eEZLSWGIlngz9Kpd6rh1W1b?= =?us-ascii?Q?T5FDZRBTahsf9rmMlLldoGwoIUbh3PS8jfpiOeVL419QqbXOggkzXMGb7zrY?= =?us-ascii?Q?uzoCjI313r8qhMOk8A4KaFEQhgI75a4ttDw09iaEPCUgui6vlDT+cUC5XYF/?= =?us-ascii?Q?qEKk79XhGn7qZbN0lI9tGsXiQn8JqakCN4jskxD8dLy+7plPyoqxMS+7Rrx/?= =?us-ascii?Q?E2fU+pwR75UrfCW8RgOVAb8PcIZtr7uaULXwlubuASMDfsdezxdsksgHInyB?= =?us-ascii?Q?VkyXKClqNye64jWOV7+bhZp2lzFFtKHQin0lxF4YJIVd+gIu/f2FRcMoJc+L?= =?us-ascii?Q?J6Z3JbwGoFE8lL5XO+aKIB/H57VoforbiSqS25s9/NfvAmR2I4ee87093RYR?= =?us-ascii?Q?eVYbsq6ywnv78I3ywcPxADJfkRlCOj8UfcBTvrKyNCQWEPydSCifC3iwufxS?= =?us-ascii?Q?1AFNkkjd/TCd/FEXjPgRfl8nS1+F13NdBx92cNXtmb/pDPgku6L4Y5eCZ6T5?= =?us-ascii?Q?mut2y1gW2uEM0F/UinXhY0taP3u8IgeThO6qh5Rv2Cr1yEwGft0kcKgjjBxR?= =?us-ascii?Q?08MGcsE54zDt//ZIgqUIoo6agyNOC?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2555; 6:p9MM4MSxte12aN1XQIQsK808iQNO6rBSbMjp52jm?= =?us-ascii?Q?H02gsST8FpbKf0H6MmcJ29OmPY391l18B341vmsKHqKSwmaIGBscVCyDgznj?= =?us-asc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AJXWKl+k2Cy/Lue3K5Xau?= =?us-ascii?Q?sWk=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2555; 5:WbMHz58XW6gHM5MzgAWPTTxUUqf7qiR8WBYWy0GihgHqmfz6UApNKYzd8R4n6Acwr+SXac0n4gMBQqa2Vm9Qp90Qn6GfwCntWI3f04OIXKdN0Vv5YhSTp3xifZL/oB4Q4I18jcx3sajdqF/m8XYB4wj7HBI3mlxoX4Z3P2yrWsBz094+qrUrUGT6YyZQqZXc/b0VoEadWmbVnFXEdrU9qOuYiNBpwtIzHME5VgNTWwAHdFw4+mSTuEYk98E/WN/7q8EhQFb3rER1eC2UpVIaz+5tiuNdWptHHpfLEpiUMSTlG+/h0lorXZayB+/zNlr++R24Iqp5+K6G3aT4JDOEWxXRyWnVdUKjvXOjYZuh0mFyTvnA5r0sLoft97xzVL4lizHdtIFXzxQRCml08aZwhQJFgb6vD8R/x5ED5uDXtrlfIbwD9mEKXezzjmBCjozdMfgv4ZTWKoOSCl16tWh6LiWetdrgFtvkjBX+V5rsXvmRT/ECVPSk84e0Xnql+5SQ; 24:65i8DeV/Du5uw/J5qVig3QQA3ghqr8vExKxAoKGJI6myE0Sn21njAry20W14gLpAFEVvpDZBjBt0LWhJiobQ3L/RXvrmeNpDwpNEgQ2brUI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2555; 7:DHTKzZcjLL9ffY0WRQThUaB4SsVh9LYHvnk3zZSrrrPWKrpTUKlgYDKs76SWugw/2pU/zGVYhcANhO9ZNjPO7sWBnHVyDwkVdX2X3HsN7PUs8ARGA54OGnC4Fh04ZT+um8N7CKcIKXLviwkcOMe1AwUtVxtH3NsLYUGonhaFnSVmno49aIUwSpG6Gxfkwcv/6kvNOROhYiacKSynLUVvl+0XH6yxCYcY3qQMKxK1jMyWPp22wrX4cc7726S23q9M3ZJuDUF4xQx1i5tYfjEDETb1XS9EK6mBVeLmPptnTtrrk5pNKVX0yTIuxjB36z7vfL3ywO5twiXghKAV5Qgmlj/xtAPbOoj/FVl59KrzN4lG9Kr6L0AwAQPks2wtkRImUfVl2X69dHicEpdNtmhKl2JrCVxF9Xjko+z0GR5E+0QGtgO9JJBb2nUbyZ4os9+ZLox9PKtlvvy1B7PDI1W8boxUErD/hd8bJxnPwr2fdnGA07FmtPuTef9D0IqZSAfdvcTFRl26jmc4BVLbFS1w7emn6FV5XiIScQaWr2PN+lQj1+y4Z0Rf8Zi0PP6dMRrYFpFOnn4OS7ySUSMBTlruQjSgyXdxiVMxG0mOE1Nel4OJyht14QYe5FLT0LGzI4tcRDC4/5bukDSXka4+HuElaZLJ0Zldailp/g0CIGHubbqJPEBBabdgCXzRalGSmMHN5nmjsdOlKJRTYKdWY6VgR5DhHGfptNQNQNbRp8VQMkeJ/W+E2E4aD1Aq/X2McKvr92FB0JSToJLVjRBja2kq1bF4vz6LJajvIh76g+YS4o4= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2017 10:36:10.9317 (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 , Peter Rosin , 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 pseudo-palette has nothing to do with the crtc, so move it out of the crtc loop and update the palette once, then break out early. Signed-off-by: Peter Rosin --- drivers/gpu/drm/drm_fb_helper.c | 60 +++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index a4cfef9..9c76b8c 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1280,29 +1280,6 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, 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. @@ -1318,6 +1295,38 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, return 0; } +static int setcmap_pseudo_palette(struct fb_cmap *cmap, struct fb_info *info) +{ + u32 *palette = (u32 *)info->pseudo_palette; + int i; + + if (cmap->start + cmap->len > 16) + return -EINVAL; + + for (i = 0; i < cmap->len; ++i) { + u16 red = cmap->red[i]; + u16 green = cmap->green[i]; + u16 blue = cmap->blue[i]; + 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 + i] = value; + } + + return 0; +} + /** * drm_fb_helper_setcmap - implementation for &fb_ops.fb_setcmap * @cmap: cmap to set @@ -1343,6 +1352,11 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) } drm_modeset_lock_all(dev); + if (info->fix.visual == FB_VISUAL_TRUECOLOR) { + rc = setcmap_pseudo_palette(cmap, info); + 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;