From patchwork Thu Jun 22 06:06:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9805469 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 B2C7260329 for ; Fri, 23 Jun 2017 01:05:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B70E0203B9 for ; Fri, 23 Jun 2017 01:05:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB51D2846A; Fri, 23 Jun 2017 01:05:16 +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 01C6B203B9 for ; Fri, 23 Jun 2017 01:05:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E03366E71E; Fri, 23 Jun 2017 01:04:00 +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-db5eur01on0115.outbound.protection.outlook.com [104.47.2.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D39A6E5E7; Thu, 22 Jun 2017 07:37:09 +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=xdDUO1rcA2ofyI9F3MhdK2aw0zyHv70yIjrPZ9XmGRw=; b=h6Q+nmlp0QwRJJoB5gUNo9UP1aB+Y+4EHO+2ilFpuhcHLb9l6Y0b6hbY9U35gq6Oe3ARJeQJrV3ARjh3MJAul39SCOIleHTQKZzVjF4A5/cLUVnRFfI5byMsmrTM/5/BmxNLQ6Z1P74Z1m8aMyqvhsB/U/WTgwQ8m2xm7x0pyRw= 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:05:54 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v2 01/14] drm/fb-helper: keep the .gamma_store updated in drm_fb_helper_setcmap Date: Thu, 22 Jun 2017 08:06:24 +0200 Message-Id: <1498111597-10714-2-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: 82f2a7e6-9966-4708-38d8-08d4b934c022 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500055)(300135000095)(300000501055)(300135300095)(22001)(300000502055)(300135100095)(300000503055)(300135400095)(201703131423075)(300000504055)(300135200095)(300000505055)(300135600095); SRVR:HE1PR0202MB2553; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2553; 3:65fI2LBRxvfW6lMxILebHf5YPmO12k5Mcx3pQk88STJLxrB3I1GTUeccPloGZGNiBKhFile1L6LaOq1tFlJSgW+mtOwvq7UWUUkjzDGh8Y2A9d7odVXJr5vPbx3v/QvbrbdsiPxA9Wis9DjeIw92r52KryTNA6k85YjyWz+W0/14qaxY6Vxsd0Gl4GePhMY49L7/58wgLWuiFu5pw2LpAwFZLYeXj3lZKsGogxPuOtmCh29FMLTDessj8auz43Qhu8u7bHapu7pbT74QQD8uDOVTcIXVpNdk/n6UMwWe0JV9DVSOXm91bmJfvHOltTKoZJxDDbtQG73it9bdSSJQKIqXRVvnUt7/8zSCbL+ONCoI+TDor0uWYaWNACsADqTI7LaY1QKD7dW8PPjSr6wqOAm26jdPXDNErq08PY4x7gyT2z7JaP1TkuU6Ik0b1hQL9xlGZgu4jna8qiW+08gYjEhfqEV/AhVswkXocKGxNO7YtQeWRLt4Os74WTMugBTy29geGOa4HeJ/kwMBzwjYFAcVPgGb4BhaZsuQ25r9HCudTN9sPKfItJJomT9cGg6HopihHscyBiVVVJPyv5inU3hipOy5cccn7qS4vyRq5wCHAn7mY8S3R4QwseUAsCCf5dOUt7btUKe/EqpGJU8QgA== X-MS-TrafficTypeDiagnostic: HE1PR0202MB2553: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2553; 25:U6kKdEEaRrTaPQznrH635QwmlHn/qD87bgLruyfCqlF2+wvDG0lobB2VkNka4EOmhIRfCVL6CXoRicnra0btcJA/aE6ZPoYrsiXKbYJJNzsoPaXS3YuybgvyXs5INUtWV/wOHuHSMVpHzYwpfF345GQHAt0daYrUAWI6MIZ08QRIwJHLz/9IHknFflwD3nHvmedmOrmDsUv2m8KZ2PYDb3j6zTxq3mcIz9w7PpSN6cLhyWJAZxYGwVphUjZLIaAWY9n0yWfRMjhpfUv91cdSaTUWdKwfqDOGpC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lagPOn0QSPTNIKsn1axZ/zUGdb+Tg25FIeeLAnIP9/v4xF4Pq7/ivXx9B9m9iOkRN8u08yayTG8yF/49gYrc5KSzPaZLpH4gFzZzfJDFU5Q6DX8cFJJFLUxfbquUCyKLuzT0WfiQ7ThwO/3WxiQu1NpNFO1MOjIfKlKflnB5MoZvHrfKsVpJtey8vlbJlB02LMA93j/ZFSJlBGfc5tICrE8clcpGyCozkKAyQCoUcO14oRiDlsNqb8jGPiA8+eAtPN9JGYQK0XjoI= 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:rsAxVF1irraI43JZSjkZg4TMN0c6u5mfIMOn2SS2?= =?us-ascii?Q?juDkqln+FIkhxpoCoHgdCjZ4Y9bheK1MMWqD9WOaexgVYgibpjNv2ddKHF8Q?= =?us-ascii?Q?3YNowoAq2wRdt9Edi1sNeVLn5OF4Vn0ZpDVOJZPaz5EoxaFQnYWCJCgysGmV?= =?us-ascii?Q?I8UjPKXf+Yd8S5U7Te+HYXyi4RtPx8y3U8mf6SQG0eIqVpq5thAo8iAOuSET?= =?us-ascii?Q?nfh/sXuWDmyNOetene0UgNskjRIlLxXqhXV5LX4Q93MP1h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gzi9a6hCa3rKZKsZEs+fjJsFG1V977CsEvdot3o0?= =?us-ascii?Q?X+cCaZmk5FjxCbQ=3D?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39830400002)(39450400003)(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)(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:zfRXQG2W1S3xb/gkr9WEPI0OExEmS5E+nrGGE0m?= =?us-ascii?Q?LP29FQ9a3Ko3exrWLkaWZugFmaY7ZhtkhFl0m/v8x4u18qhmVG5FQvl9WjMP?= =?us-ascii?Q?qm6irMvKN4icEYkxg2cuRzjbgLTSDqPX031M5wMsdKu+dZcBpu4rDQ1s+nLV?= =?us-ascii?Q?04XH11ltDoiRRwkiV+mZOPRzsBhiuoim/SL8Q7Jrh0iqK7V/jCIVS40ORHm1?= =?us-ascii?Q?xx5/TK+mm5Te329sgsq91CCqVVRZtnoam4BgBSs8tFR642FRb3KqDWWlOJXZ?= =?us-ascii?Q?B8WbNuwdOxPpr3Xag9Acnx6MDNBvPPbIfAtjgU1aF6Qh0OpkDdXbIDk0fjcN?= =?us-ascii?Q?6c8rk/bGdHxa+zzTVMeaPFYFUgtf9Bvs3kZRKeYvJ++DFCLdeNL09Z6iDxiq?= =?us-ascii?Q?FnocOF3wkX52UyJDyKOpibTb77j8HpM2KAIpaFErNKYPCka1OrMWJgg/yX7w?= =?us-ascii?Q?yPkNhHhjte7JLOvYx9A461dekRZs8W5sNqM/magbCzo2mcFR1IoJAtVmYAED?= =?us-ascii?Q?RXnClyZSUy9Xy2NuQCAtYd1m6ZZXAmFB7ovvfvRLAAoF9JmL2ogfsBGnPzQF?= =?us-ascii?Q?DoXDZwyhBwcQMzCFBTSjGqT1NcjtxhrZxib14L6L4zU5jbxBkGIUMZwmwijJ?= =?us-ascii?Q?jqwSUmlIau7GL0DPJMe7Omgonx0q/Cm/bo7/7i7XN4PCIQNJ1OT9UbliIwiw?= =?us-ascii?Q?U+95qW6i9b0G71AK7+kUGXMun7ajIcIn6k8R1dRwSoL6gUjhM35dBOkIoAhx?= =?us-ascii?Q?2cehrVcXjTfjpfpURSzqf9IubpHAJFTRg4SR+KocFlLtI05jaKUEHpYjz/OM?= =?us-ascii?Q?wuWxW4BH+zNiAz+uWl/xX1gK7nKzoqorcXCz/rdE/mEpAiiJM3JDvBaJbE4G?= =?us-ascii?Q?g69ho/iPdxCgiT9cgEMkgHQI9dfO+xqJLkKkyozzoMI4BYa1iAjBOOgZfbsj?= =?us-ascii?Q?T8MfLxn/KpeEBkdf7meNGnIq3q9V22fe/fffbEI04Jub3DHj6VaGBxJkOf63?= =?us-ascii?Q?UctRMOFRcFgpkibH3anE+vXCb4IOjG5XF53F7wBCCP5sIUe6eIkBvCL/62Mg?= =?us-ascii?Q?iNZb4C0886FuqPyOxQZSnPF9KNtfdAw9scXuw0uNzQJ7IJ/dbrL8ylfRBNQ7?= =?us-ascii?Q?l7rE+VV6mxSID05+IptFiKDojYb7Sa0X/LbO8rtEDlhBySXKIqftAGA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2553; 6:5cmGO5wgfF3XrzmsjbdHO3br1+NO9u3EqMkeWa2u?= =?us-ascii?Q?mbyhpyegigyCs7HyKs25nZMsPQCExV5j7Xec14FUekrYOSz9hLnzOFAQhHZ9?= =?us-ascii?Q?K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AHu2KItz+J/iSg+3UOAiOO?= =?us-ascii?Q?Gc4=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2553; 5:KoiAzlwHskR3Df7u7pIQG6dXrspngCiapEGAhjKsvapBXD64ZtnzeX/W+5fD70ZjkME6WKhTtnDy2tEF6c1K2U78rypcb3OiybxlsOHSBc6pYYm4d2/sxe0JWaJRJ29BT8D9oO9hINF7vat6CXv209Gvxd2sY+A0slsjQzM1QvsX9NYnOdotSt/PKRmJxtj13ovDyk75UyCMBckI+4YizlcrqNbp9iUHqh868FIw5IuSuyGih1arjFpA61OO0Dz0zbvJYOuHmkivqcRihlF8YBdb2o9E3uRe93hZlvP62Djgkl+38+vGvjFLL+Dj4z/PqaGitDhSu9zHmSNGtWa85K3ySbgTvjgiJEGCSxoCKe1Oh8yQErEd7qk6zmAwBhPyB+88YyAPNU0aeF7WysWQyAtw+0rKE3RMQhLY9TPq8xqzOJ5lWKP4BNJDl8J6cIHaw9uL8N4zNLnhCQF2+WMtjm0Oo1paGJZPtjKZoU0l0pW0AXBQgROK7RMofO8948Zx; 24:/Gtkk2GvudsgPrF+FZxMq/oVIvbYmrGnKR5ilU+3YoibzYC1OXzEN/qqXTs9nbuup5EOvNPF3Yelmrj0nuzhvgb5uqGtybJ04j2a37QBx9I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2553; 7:QV/AAWrCjjARv5nwIgqrsy7bhNszoFaZ1UMJ9A2JUdImn97GahOXC9AEjXo/Pg1OVUfap+CQtyelx3zH+VlDzPd2gcIJkYDC5uhgHMaAk36TrWCIln9b7wQv42lg719Tq2tXzApoTz40TwwZ9GdnTZ8ny6uI+cJAGwugyiksv4Xi9gslcg7narvrPXpHE28qwu0p1+KM0UI5qBjV/qa87Zf6jxYSaqubJj7wWvZ/M/H0m20YJdwff8uETe8T3NEyN737DjpPaiAWlsanfrlZUN/aA9IVO/SkxMO0er5QvIgwd8AeAXm7YWN+bHmpikTuoUHfd/Y1cdEvAWc4gks15ewUy8QFO/UkMYcVoLr8WRx79eKljea/16Pp40TSEJrzkBLGzxyYnCwGj4DBgmnr4+1vG3mEr/7DE/WsD8MEM+pFgquUbYOLbghV9+PdMuxxmg4YLqdVacyc4gogmoz9S3Xr2qQtej32QaHmXn/F8o9+nDHux/s+8UDhEl/5noJIZicFVUxIsxeqyk4Z5ddOscqjOq88n1amJL0K8QBjkTyGfySmQwgylRZQGjspYHztoO2hRpXRb1xWZ0Jg9HJpuiFM7QIN8PmpxfZf5HHRfRMo6csrmuRBKlgyMhwVUyaGGSDCe0nm3d5OfoLveL0wd9uIryPKda23eNpCrTJPOZG472TVTYUrHLpo77OoDX8yY3CFe0CTVqF7bj7RYV2Iz9sWrit/SjDzyhNAjgbDrlww701xJ1Cjovml0zeMX4xcBHD5L15WrxxTHiV51zz9Jj4XxqPkiTIB0u16G6vHSXY= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 06:05:54.6060 (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 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(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 574af01..25315fb 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1223,12 +1223,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; + drm_modeset_lock_all(dev); if (!drm_fb_helper_is_bound(fb_helper)) { drm_modeset_unlock_all(dev); @@ -1245,6 +1249,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;