Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753926AbdGCJlU (ORCPT ); Mon, 3 Jul 2017 05:41:20 -0400 Received: from mail-eopbgr50093.outbound.protection.outlook.com ([40.107.5.93]:31613 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753777AbdGCJlP (ORCPT ); Mon, 3 Jul 2017 05:41:15 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=axentia.se; From: Peter Rosin To: linux-kernel@vger.kernel.org Cc: Peter Rosin , Boris Brezillon , David Airlie , dri-devel@lists.freedesktop.org, Alexandre Belloni , Nicolas Ferre , Daniel Vetter Subject: [PATCH] drm: atmel-hlcdc: use a default gamma ramp if none is specified Date: Mon, 3 Jul 2017 11:42:10 +0200 Message-Id: <1499074930-10187-1-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: HE1PR05CA0143.eurprd05.prod.outlook.com (2603:10a6:7:28::30) To HE1PR0202MB2555.eurprd02.prod.outlook.com (2603:10a6:3:90::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b51d4276-ce92-4985-4085-08d4c1f7a2cd 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:4Vhm7sA1uk4jQoas8KQJkmXch9kbVY3B930FqmRxl+GTcZ87XW8V7FFL9kfsbtk7lMOKC3d4GWkSHx+DOJ1S77riBk5mLTi/VQOvlFY0aWJbhec4cteJTnSVZt21iv4OMetN8OYL0OyJ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pgawKDEVmqNTZqqzWX+Fj34WHEj7PqahpmLZpPpgruw9vkk7LArozzwEkkEjlPkfGeafZ1kiBaeMS0ZP2iSzdd22s0db8N9eW3wpaoNZA70eMN2Prz8JfJNAXbxDz3+QebMRvOM7bpahwjNaPmTP9JbGTBIXX5g4w/IrlI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(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)(20161123555025)(2016111802025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(6043046)(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:N1dFtufa7JmETwn79kShPXOg/YbZBm9AhE/ZkCnO?= =?us-ascii?Q?953spxoq/8lvn4JyKEL2Ry0pelNlTnW6ZbSs3kE74WVWz04oiZJlaTqJxlps?= =?us-ascii?Q?3AbHvVP57McjIzPTKLoOIwNnpyg/8vusTyAOMQQI0ez3QI55ygAgi64X/Xqd?= =?us-ascii?Q?Qyy1CGdwHnP8deP8340HAQhGbJXcTnYT6tQOsWhqj1OIEVXUtcqSe+I5kArS?= =?us-ascii?Q?T9GvL45WfhtDHAjERzYKNfPmOtu7p51Urmp5exyrOBEYzCA0/+VrpGyBPNFd?= =?us-ascii?Q?P+PDmL9cX/l3p6AMtdEvpfSIh/g0CJQpfosfkcoyt0/VYlZlQdiH8AFZihuC?= =?us-ascii?Q?Gd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/Ws7MD349p+JB?= =?us-ascii?Q?RQEE9HgxNzzYx+sXYH3LCpem6sCNhfgYMaTbqtNp?= X-Forefront-PRVS: 035748864E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39410400002)(39450400003)(39830400002)(5003940100001)(110136004)(53936002)(6512007)(38730400002)(3846002)(6486002)(74482002)(5660300001)(6666003)(6916009)(50226002)(189998001)(2361001)(2351001)(42186005)(2906002)(50466002)(50986999)(4326008)(8676002)(478600001)(48376002)(305945005)(25786009)(47776003)(54906002)(6116002)(36756003)(33646002)(66066001)(86362001)(6506006)(7736002)(81166006)(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:xG+kWGKIx41CtbLa26FeUona98Sqa/czznKzxRd?= =?us-ascii?Q?1p6cOFMuXVwL+QOcNZAImJv/07c/CkKYsa+U12ifHyCptgGw3uxJee/xZFBK?= =?us-ascii?Q?NDO+gg2XmaBjM7tdyDi/XoSwvVzVBexrsLbddMLvCg3WPkQPB7OQc+ovw41W?= =?us-ascii?Q?KuF5CPwzVCgaCPAsy60IC/NDUDY3hiOe70OT9TS+VqiMiui/FlT2NirwOYWX?= =?us-ascii?Q?vJiIBME5Hko1G0pBMKNkfgQRAEUo5+3zmsfMF/2mYkV2kKmJnghtANiXvIGe?= =?us-ascii?Q?imq7Cjm43rr/yAzBL1EV88UHt3xf5JKV84Xt5WwKksdReB93+Aij3TcjAFhh?= =?us-ascii?Q?tBO0AQrr3CJAU8536yGo8eU/Bbp+9ye1BmrJtVG58O6OIz8eBo80NaWUafly?= =?us-ascii?Q?zCiPvIPUN8U07t6BNEtK+QKCc3gIKLBOGAlz660pdd9Dfl9fvG7hkUWpfBxE?= =?us-ascii?Q?hGLgF9qvUMbDw5w+AG+E5Z19LwvY6B9c8W7LiVQK36QwBoYj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59P2ZVxwFG9Mbs9L95PMJ5/oDIN+HZG9whJFwJEOnbZD8os0g+IycXp3ZhBPkXzfyyRxx0weEIVMvfy27dvUH3SS3bbRU1cQz6tu8Vs690RWedoBKaDl5o5X/qv+SNVOOqQczhzAdZ8N9IJw4YZAIYXQsQTialLvwYds2gINWXVXEeD/BUdUGznB1VZUkKAfZdRIOdWuPof3hf1UIMY1wpbA8Vo2oCu7Lbna+ZhU2xFnrdh1PNkkMRDZFGzV7rnsiQJ+/LYy7WE2jE8IjEF7ak9Opo/DQBCFBVk/rIHuj9ypI= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2017 09:41:09.2588 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2555 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1842 Lines: 56 At init and if the gamma_lut property is ever removed, the clut registers must be programmed with a default gamma ramp instead of being left in some unknown state. Fixes: 364a7bf574eb ("drm: atmel-hlcdc: add support for 8-bit color lookup table mode") Signed-off-by: Peter Rosin --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index b5bd9b0..0ccd93c 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -429,6 +429,14 @@ static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane, ATMEL_HLCDC_LAYER_FORMAT_CFG, cfg); } +static void atmel_hlcdc_default_gamma_ramp(struct atmel_hlcdc_layer *layer) +{ + int idx; + + for (idx = 0; idx < ATMEL_HLCDC_CLUT_SIZE; idx++) + atmel_hlcdc_layer_write_clut(layer, idx, idx * 0x10101); +} + static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane) { struct drm_crtc *crtc = plane->base.crtc; @@ -438,9 +446,14 @@ static void atmel_hlcdc_plane_update_clut(struct atmel_hlcdc_plane *plane) if (!crtc || !crtc->state) return; - if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut) + if (!crtc->state->color_mgmt_changed) return; + if (!crtc->state->gamma_lut) { + atmel_hlcdc_default_gamma_ramp(&plane->layer); + return; + } + lut = (struct drm_color_lut *)crtc->state->gamma_lut->data; for (idx = 0; idx < ATMEL_HLCDC_CLUT_SIZE; idx++, lut++) { @@ -918,6 +931,8 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane, 0x40040890); } + atmel_hlcdc_default_gamma_ramp(&plane->layer); + return 0; } -- 2.1.4