From patchwork Tue Jul 4 10:36:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9825763 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 D55EC60353 for ; Wed, 5 Jul 2017 01:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF72922AFC for ; Wed, 5 Jul 2017 01:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A39012624A; Wed, 5 Jul 2017 01:19:12 +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 545AD22AFC for ; Wed, 5 Jul 2017 01:19:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 60A876E397; Wed, 5 Jul 2017 01:18:04 +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-ve1eur01on0090.outbound.protection.outlook.com [104.47.1.90]) by gabe.freedesktop.org (Postfix) with ESMTPS id 745FB6E147 for ; Tue, 4 Jul 2017 16:08:43 +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=nLjdPyADer1Njj7dusGn50BiwiH5A5hOD2L08lc+Scs=; b=kF8YqzvlFa8NOKYYSRhxVirzs5HWDDLT+SGoD5Bhk+aihZr/A7Sc2yJsXtPehuTwuQBehAQxrK8+Gq11pgyQrIRTysvkFARV3lp13nz5R5D0WmxijGV57+elX5ytM4/4+k7vSjtBMvSFHnGLlBL/BY0NrQP9DU35dYloTfdraX0= 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:15 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v3 02/16] drm/fb-helper: keep the .gamma_store updated in drm_fb_helper_setcmap Date: Tue, 4 Jul 2017 12:36:58 +0200 Message-Id: <1499164632-5582-3-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: 96844242-9f90-49a1-50bc-08d4c2c88057 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);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GxD2QXKeWUwfPrgabILN/5GnOQXfqDUMAF/Oqo4zFIoCCMJIVFQBLi5jE8sd5gM7RcAdGfVZKXa8OL3XhginEHGFgqvKJ83z7gbTqrXTGHC8Q4t0sQUrbdcO5vP8vFOQpcma/WgW3z5Kssh2gVpXcv8C81IdoNvK7kFsfsBsAvXXPRsTRTwYkLGfOj2ZMJ2vSp92UrGLwyJ4SQ9VD/vIjiy+YoShKvSQary9i66U7TcPQCk7bj5g47NPSJ8FDaKhQgjOb/tkVb6r/3uhVFhh6DmTAmorSPcrpzLTG8fLE8cQG2VlaYDwbNgQHbzghJw1XQkkwpDL38cuUYfR4gn0M40uxI2Fj5KUTSZusMtM1ory9Q0evA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); 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:hwsITtZy5Kgvte2BuCT+ZOlLULWZlb6HeE8Qup7a?= =?us-ascii?Q?Fk/2FK17A+V+raX10oAyVW9fkj3aWdB9u8gmxTK/sy0dqzmoiINP5cqe39mG?= =?us-ascii?Q?MTWZ/w6YHjTJXOdDLpUDoRmbsW/ZySjxbIdpcLPLkazm+kiylUInEKbSSN3F?= =?us-ascii?Q?8ncN2r8j7R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fa9ECgYw54P8?= =?us-ascii?Q?2Zwl20F0c1ki1v4lw5Xk/gWpZo9ZwixePK0l3ClsRnLa5OBqcQ/qAxcDhbIp?= =?us-ascii?Q?fCIJCY/PYCcIR+CvMbZCodNLE2CoeGYMVyjK7N4LDgPMm71OYreQ6mNjaJyi?= =?us-ascii?Q?OjTGauvtYR8EDVW5ZQY+JTpDZshzRy1+nvQmvOpiQrkN+roWSv+9G9l/03iv?= =?us-ascii?Q?WHMluKC9ElVLvpk7oJE=3D?= 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)(142923001)(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:v0uaCxm9TWuZ1SdNB9MLtgYPzJcvrNHHxr7TYCe?= =?us-ascii?Q?l2MGOI8tMFXQG+Q8cBKRAYR42NwdiwCRav6CKwkXl6Df4gDkN5ulLlxa2uGg?= =?us-ascii?Q?WdkSkZCe2mO5uB3Gv6dma9FsrXEw+YAtbd8iZNJ/nbb6jJCcvv2EhZ3ML34W?= =?us-ascii?Q?ZyUmk+0pmWPjp0iOYvFaguhezdB9JJKUS66EPLvFu0Mq0ktNS+ac12ahv6/s?= =?us-ascii?Q?P7X6h3pO44gMq9CvDGjJxYHHcKb6PRYiA8XzTTM0eRy5Lrn1pB6lCWCIdRMO?= =?us-ascii?Q?zTy3JjKrSX5KfPdFHB18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72umzAUNSyE2/n/wFdsdNjT9T5PQ3PmCufIAvA7AcYZqqzdcR9p3V3iuUkiP4G73j3poZ+h8jpc5GDgfWL1k2vGSnGeqZfBylP2pL/XbW3w7CIlm14JlmexwaXOu7j81gx/UM/LZlNIWbdT9TUhPSPh0U2EInkbeal/J8PLB2UEQApYp5Kh73ftq/cxmglwv1Yf31NvELejYsnApJs2Ho9WXpUM+bkBqkR/L6UDvkmVxyX4rW40DZgk9OmgRwDnW/1JU1OKVtT/VB2roFFOBt6R1Rlr7pj+O648jBe3kLrAM+aSPaf8zANSS4Kv/KyQL1d2TMgoL6AIjJ7Z4oKRHF9WOO9puNWgeTa5MUTs3paL7S+voD1eSjB+q+5eGeNmKGkcaOGa58YQubwBQ8SwS4lUAzQbdvpTuNuy3CAeOgB/gXWqECzCz0vDVUsYJpJm/bvVP3YdOhRsO2QSM9YseyECU638vPyuyh1wNjIWDe6r8hWwyH7R3VuFiyzwdRbRyqMXL8g7HotCIhx377UghQukSttg2pE+BvauDMscssQ7ifkRjEXxTOKcf/5iERgAkf/kQkfLsAvm+OYc/IYacEk5os2+voKSypc5XERaH+09UrpC9Ef5+pUO8uy+8JBU= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2017 10:36:15.7911 (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 , 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 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 9c76b8c..41fd9e0 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1339,6 +1339,7 @@ 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; @@ -1367,6 +1368,24 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) transp = cmap->transp; start = cmap->start; + 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(*r)); + memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); + memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); + for (j = 0; j < cmap->len; j++) { u16 hred, hgreen, hblue, htransp = 0xffff;