From patchwork Thu Jun 22 10:17:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9805489 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 25A5660329 for ; Fri, 23 Jun 2017 01:06:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BDBC26222 for ; Fri, 23 Jun 2017 01:06:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FDB526E3A; Fri, 23 Jun 2017 01:06:25 +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 BDEA726222 for ; Fri, 23 Jun 2017 01:06:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CDC86E713; Fri, 23 Jun 2017 01:04:45 +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-db5eur01on0106.outbound.protection.outlook.com [104.47.2.106]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7550A6E62A; Thu, 22 Jun 2017 10:31:34 +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=cBR9/Ra6yYJ8wRtQkP61P4SQk7fuvJeK7NkC6EODVbg=; b=afpdWqiob/n4gYY1L8wswtjQfvejSMoQRo1hWeVd01NJibpJcbSdzu0JzxTv0OPVS8j/40TMyZLx/dLsPl79Dk+VicMAjFpBxbaH1nmbsz5VcFIn/JuSnkU9+/rQ2ZpUHlRQimJcas7P++P2IkJQ/uERAS21VqxBhCwDRbHKTVM= 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 VI1PR0202MB2557.eurprd02.prod.outlook.com (2603:10a6:801:6::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:17:06 +0000 Subject: [PATCH v2 01/14] drm/fb-helper: keep the .gamma_store updated in drm_fb_helper_setcmap To: linux-kernel@vger.kernel.org References: <1498111597-10714-1-git-send-email-peda@axentia.se> <1498111597-10714-2-git-send-email-peda@axentia.se> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <0c8e535a-e8bf-f9cb-1950-036893ae282d@axentia.se> Date: Thu, 22 Jun 2017 12:17:00 +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-2-git-send-email-peda@axentia.se> Content-Language: en-US X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: AM5PR04CA0021.eurprd04.prod.outlook.com (2603:10a6:206:1::34) To VI1PR0202MB2557.eurprd02.prod.outlook.com (2603:10a6:801:6::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a1c4285-78c5-469f-2cdd-08d4b957d6e0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075); SRVR:VI1PR0202MB2557; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2557; 3:3OXasewYW9+UTSPNW8Xd53rLQktDdt2ZxrX1AneTS6LbL5DiolnfserjYC090zS5Bq1I1I+70a9QpXvl+63rO8JI2xOekn0jAm3KjDUxNY7o21Jb6mO5yES1EEv5QYwjbcnFVNKJk4zig6m0GoFw8TrBEnmDNubkAvfYSvNfN5aAV39c8F9LbmGZvLikSjUVjrW9OT9XeOmAqYrAXtDQZ58EIIo9s9dJcqGfOzsFdtwg0kBFJuW0vXYIOroEFONJotgN4MCJKQVXDIRa2iRHektI6bao+BKy79feeKLoweBUDis6t+dTgvFhZXDxSA4Y; 25:eZFXOOc8NOv0QDRZio6oQ8r1x+dJ0QYQNFL/IeBP32RE5f+4pkBeT3IeZCL9r8gxH4tl7ujeaXk5tOsiaLNaCOxCol730YMhYLAhIajoVnwdYQgAA/yborKKVih4HT2BfdSkr4i6l9fNwXe2bZl/qbMA/htAJHAZrxsCuvFsFzQE7M3utFT+2wmKfbzqhcRvw+4B0NDCafTAHPIE7OdVYHjZLz/9iwRAQko+vEnxtirmUccV9ffCsVvccfAp3qs/76m/jLxIa6G8+m/fwZLJrzfvL2sSQeBOJbtHj3O5qyk1JFpx0SKmPXRfBSsJ4svR834K8+GgwwjvKwX9xv/rQTI7roj757ENuplHCP9nXI01I5tPytcvoaCQzaYiLWyvZv8oYOf+Lj1IatyXU/KBW1at5n1Twukpc6/vuDRWPuomFJspsaMXwscUYR+8rDB37Rz6AOcnjH+3lCNrHJfGyNGsHU6rC3PGb6IvICmt2bs= X-MS-TrafficTypeDiagnostic: VI1PR0202MB2557: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2557; 31:MoD10B7flnd+Ex4PJjKae0zfkYTT8Pyp8d4V4g1srYPhQqz7qRAzg1DT4ZkYSnTjLUb01PLgjCJE4r4W3ZpIio43MpdwnACSuX5hXMd96arbK9WvrsgBUaCClOYmRsd5TGga9SUy+c6/GRJWw7i0I9AdYDFcU+0D1xSeorK8QVxLRPE+l4+e4oFuW+vMT5HAm1c0743qNX4FaUylZM2/mt81RYe3qvUR57zUaYOnpvDGz59dMq1zbfbqNQWfxQr1 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)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(2016111802025)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0202MB2557; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0202MB2557; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NTc7NDpoalIwTFVKRGJGL1RVdHM0Wkllclo5b0VY?= =?utf-8?B?OUFhYis0V2RhNTBaaC9BTnQ1a3hrWlBzZVBPRURZaE1vR3YxdXlWaUFtRGdW?= =?utf-8?B?RTg4cmszeXc5bmtRcXA3aXUvbWF1OTcrSVU3eGphVmg0Q3BYZFlyVnhUSFRO?= =?utf-8?B?ZURaMS8veCtnSkJVVFFjc1JBaDZyUFhJa0FXT1pabnlyZTkvOTI4QjlYMEVh?= =?utf-8?B?ZTY0dUNLR1FKT2U1TWtRVXF6SG1wOXlFMDI3MlYzek4rNGNjNktzcTNTQ0Qz?= =?utf-8?B?aXloYVBYQVloeHdMZCtLaVE2ZFRqZ29yNGY2VFFiZkNvQXFqWTlzRWx4ZTQv?= =?utf-8?B?ZGdzaWtkVEV2SDV2bzFXQjBibVUxTzJrVUphWmxvaW9Cdng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2tJN0dHRENTYWlyY0E1QmgrRFhYSEtvQU94T2pXcHVv?= =?utf-8?B?NWNuRW5nRExUWTcyN1BjR09pNnJYU1lScDRHcjJTay9yS2t4SnhCU2hWb1JT?= =?utf-8?B?c3BURW5JVm5JR0RsOUxUeXdrbGx3cGlCc2hXeWxyTGpscnFpanhndlE5LzFn?= =?utf-8?B?aHluYndSR084M0dHdHcvRzFrMEE4b0NNNlFoV0xBR29yc1I1bEZPemx3NmUw?= =?utf-8?B?TCtka0d5Nm5PUUl5V0kwN2RhQm9TYmp6aXZaWVRlVWpJditad245R3ZMTXli?= =?utf-8?B?cFQwZ2FhRG5yTHlpdmhlK0NPMXV4RlVvcWdYYjZyUjcxYTNPZ2hZSVdjSkpR?= =?utf-8?Q?=3D?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6049001)(39410400002)(39830400002)(39400400002)(39450400003)(74482002)(6486002)(64126003)(50466002)(36756003)(189998001)(53936002)(3260700006)(6116002)(3846002)(25786009)(4001350100001)(31696002)(7736002)(8676002)(86362001)(7416002)(2906002)(31686004)(81166006)(8666007)(38730400002)(83506001)(110136004)(77096006)(230700001)(305945005)(33646002)(42186005)(2361001)(54906002)(23676002)(5660300001)(2351001)(117156002)(2950100002)(65806001)(6666003)(66066001)(65956001)(47776003)(4326008)(50986999)(76176999)(6916009)(54356999)(478600001)(65826007)(142923001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0202MB2557; H:[192.168.0.125]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NTc7MjM6b3A2SjhseDczNUpvaUIvbjdDbGVCWktZ?= =?utf-8?B?VFpwOE1DU1NHcHdyQ0dXS0RpZ3NQMElnRmJkSGlsS3Y0M1E2Z1FpVjN1VXg3?= =?utf-8?B?Y0hYeitHQnZIeHNXWmNzSFlFRE43c1BVd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rJDr08vqGea1QmE; 24:v31BITRVMym4q2OH6s5A2vqT8TeMV5o1KWnpzlhKggfLeTbWUZPEvNY7KfokddE8fxNOhTY5fL4cUpVi8ZJTjk3Yj+SLBWFOFhtLKdTXjH4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2557; 7:JB6M0/z/a4+EjEctLyNMWKkYJCts2Pj1WWvmbFs6XjjYLI//kmM+LtsdEwXj4dbqN2qdjBeBzkz7ih/68LN8p6T8qS1byrUCDXNAJmzBVOsGHba3yyfGdow7g8SeSnw+TwI1MJhBDqlqhaNRWn2MnnmoRW9uTl6D/zHVhZeHXUr7Y/wnLDTXdqMOmnR/XxmRsA/Y9EHCL2JMfboAnGaMcTC2fgrN7VTCdHrfpcwt8ClimjALlMpu6w2/6VEyef4s29uO4SBXOtKdLP9LKMMJMgJLiYncuJU2Hbf4i/WtiGFgnqisPCPqrL42ErOcfC3HH/d0ZBqtNI/k1Fsq83xu4BCWxuo+3DxCX9C/bhj8N71Fx/lqOINaa1Smx9+v0XwjG3J9b16rwNseSe5rd81D3Xs+Ex+jcr9vU8U6+X8Dm62FAPTX+NDTjqUMGu4khRclSvyn2oGNGeiHNIx3W1R+3hOwqVMXkb4yvoTIe135/pZBg2YSYcabEs7sPcBak6n6xBSn5+8iG4IHSA8fe2KMvooI8IX7Lo7e5PgOkxEMe5reKOIyi+giTWDk1Z3UCmF1Ir41w5kl7RTcOvEAudOSktGHVsR5jhjFEwzwiu85p1HN6Vo6NByyNd3SWYB/JdNQM6jLpdZCioZDTx+EjvUFrdQudMrJFpVnnMZZnKi8+x40qsTouiOluwP3rgoM8lnPw0BJLMHHiazPgTwkPs1t3pJAYr7r0xESxnzxJ0ugL80fFrIqBdTfVUHTi+vFvlfq66GXHUWdrMuHHrsXVyk9LRJ6CFiwR3yFVri8boFZfa8= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 10:17:06.0170 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0202MB2557 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 I think the gamma_store can end up invalid on error. But the way I read it, that can happen in drm_mode_gamma_set_ioctl as well, so why should this pesky legacy fbdev stuff be any better? Signed-off-by: Peter Rosin --- drivers/gpu/drm/drm_fb_helper.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) This is an alternative version rebased on top of Daniels "fbdev helper locking rework and deferred setup" series. Cheers, peda diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index a4cfef9..c7122c9 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1330,12 +1330,16 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) 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; if (oops_in_progress) return -EBUSY; + if (cmap->start + cmap->len < cmap->start) + return -EINVAL; + mutex_lock(&fb_helper->lock); if (!drm_fb_helper_is_bound(fb_helper)) { mutex_unlock(&fb_helper->lock); @@ -1353,6 +1357,29 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) transp = cmap->transp; start = cmap->start; + if (info->fix.visual != FB_VISUAL_TRUECOLOR) { + if (!crtc->gamma_size) { + rc = -EINVAL; + goto out; + } + + if (cmap->start + cmap->len > crtc->gamma_size) { + rc = -EINVAL; + goto out; + } + + 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)); + } + for (j = 0; j < cmap->len; j++) { u16 hred, hgreen, hblue, htransp = 0xffff;