From patchwork Tue Jun 20 19:25:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9800489 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 7271860329 for ; Wed, 21 Jun 2017 00:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A191200F5 for ; Wed, 21 Jun 2017 00:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E49C26222; Wed, 21 Jun 2017 00:59:00 +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 10F7A200F5 for ; Wed, 21 Jun 2017 00:58:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF2B689D2E; Wed, 21 Jun 2017 00:58:53 +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-he1eur01on0108.outbound.protection.outlook.com [104.47.0.108]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB76D89186 for ; Tue, 20 Jun 2017 19:25: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=z+vhrVjALTnep8Ic8it47hfvMUjXCOTjWcVcG6BP7RA=; b=B7Hf44xoV9OArRuDJx6inHALtLAN9NepwYocXRWMkPx5VucYfvQFKh/sT/KK6Bga4v3PHY/ZyqP2Li8bBqdby+/vVMcsuzQQmjoTLBruKHewGorx20m5Fs6jN7wGY5GB6bvB8XIq7YVfUil8ZBSJS1XSV8EXSx1OrPTDKA6USV8= 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 HE1PR0202MB2556.eurprd02.prod.outlook.com (2603:10a6:3:90::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Tue, 20 Jun 2017 19:25:27 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH 09/11] drm: radeon: remove dead code and pointless local lut storage Date: Tue, 20 Jun 2017 21:25:33 +0200 Message-Id: <1497986735-14418-10-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1497986735-14418-1-git-send-email-peda@axentia.se> References: <1497986735-14418-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: DB6PR07CA0081.eurprd07.prod.outlook.com (2603:10a6:6:2b::19) To HE1PR0202MB2556.eurprd02.prod.outlook.com (2603:10a6:3:90::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 053a0ecb-fccb-4a42-c197-08d4b8121d12 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075); SRVR:HE1PR0202MB2556; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0202MB2556; 3:/a50YUZabDKHTygTNIArWMUZWeUh61wZWZWjgo6zIV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Zc= 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)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(2016111802025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0202MB2556; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0202MB2556; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2556; 4:CU9AvObi+jDBg2GGLbf6VcjZDafwxUaZhDG4WuSP?= =?us-ascii?Q?D5qzqEkTKrcwEizZSICKHRWXtZkRvkoNccLia4JXCBDPBuj4aLBjjx+ijIz6?= =?us-ascii?Q?1p8B7+pMYynNo09BHP31Gbjnpzvt1cE6JdnvM3efEJXLz6sFzpqKR0/47rqD?= =?us-ascii?Q?CjeTyR34acVPR9LLI6gl6ND/d5qOcR59BqdTzs2moq+UXDuICRTaZzz/UN7z?= =?us-ascii?Q?APPZw54T0z3vttDRBc9R4f86SBamVGQf5z8+YfQfb5lpZzP1F/2vGFJzU8cU?= =?us-ascii?Q?jvu5Ex/NWtpYFV9og+PozZXvjJyOiXcLRkCFBxrLJ018cMCZX9/wTM7koQcN?= =?us-ascii?Q?TLGMaTQMeXvwwvCV/vEDaix+3KS5aPuHGV807+NOr9r1OBa2XRial2JllArW?= =?us-ascii?Q?shlYTuVNjKCUw7sU6RMAbQq7vUpzLKjU2rKmzjLxUpZiufCdgA8y9QweEWmo?= =?us-ascii?Q?764TpIjpbugLIsa4BikhgEawc7HyVZkdfD5PJxMYVOTHAyFAamU3suj5+H3i?= =?us-ascii?Q?2vIJzl8ZhEEk4oL+mViWSzjv9oxy1dqmKroLn6FCCPzyMpcpIkbcyt+vZbGn?= =?us-ascii?Q?v2YwRpPOsi8Tj5TXT5osipSV3ABAxkdNezHKVHu+Jiho6vtF911RbTIXjz7q?= =?us-ascii?Q?DaBg8HUXeacg8T05LMotKB8ko4v4ExCwq1VpAJ0MvQGsco6CeG/R8VO8nqAy?= =?us-ascii?Q?Q4K23kHBezBxJfCEIQuTbDhefmdGCJ+xlUhOVhZfPiA55JPE3o+gaO+H/FAP?= =?us-ascii?Q?jxLploR2oVzZANHKavkTdvAw/L2nHRW4Jd2xX7o+XaiBeXDDGfiPJvQzPv9E?= =?us-ascii?Q?TnT5tIAQOr0hyOkv69qklPm9UodPMpeSqaz3x8vDeq4jdtV7vvrhUF/DaJ+k?= =?us-ascii?Q?30yif2hXtRsEGlW9MSO4dWhJvaQzBkSnKkuq3ytCUUqbC3fuDjMI7W7C+gw0?= =?us-ascii?Q?4oWQ7Yt1ZzP9ReXNUPMuCPXeJXpxHO+6i4ZtYvCha/Vg8Ybrqte1l5X3q3db?= =?us-ascii?Q?c0jq8fKEVcl0bmgpP3RGK5pUOTzNFSGsxGZCRiYI/NHybqRQe57OJEoQa7vA?= =?us-ascii?Q?Q5XNLDEN30A4Y/ZN8bIUGgsarhPOwjZX862/mmhnPAfP9yCEKZNHHwFK8t0C?= =?us-ascii?Q?ViVK+RGsj7zi9eJT9wCCDBUtTexZA/fmF8fapn/lO3DN364s9bbLAWtgK8eT?= =?us-ascii?Q?igX/dNxRnaZCpN7d9pYHSXlxh8lR80nv7oD9?= X-Forefront-PRVS: 03449D5DD1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39410400002)(39400400002)(39450400003)(39840400002)(478600001)(6506006)(8666007)(53936002)(2906002)(8676002)(7736002)(38730400002)(110136004)(6916009)(2950100002)(6666003)(5003940100001)(74482002)(305945005)(81166006)(50226002)(42186005)(76176999)(6116002)(50466002)(50986999)(4326008)(7416002)(25786009)(3846002)(2351001)(2361001)(48376002)(86362001)(54906002)(189998001)(6512007)(5660300001)(6486002)(33646002)(66066001)(36756003)(47776003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0202MB2556; H:orc.lan; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2556; 23:lhl6fB6zNdg3mlZXeRp4NvBAVJFgfFwdrgD3RNx?= =?us-ascii?Q?SUEHYZ68d+LDjip6ocfOwkEuYvwkk15+v6b2aCckfJkqIRX8VcLSoBs0bnjM?= =?us-ascii?Q?PtUUDxMEyK5pmTtLUxt9qfMAh/zqT+ysF69tzwycYh3gXGyqOmfNL5xGbM6+?= =?us-ascii?Q?vaxWML4WSIGIcRFXdDYn3aMOW1BNJGZsCJuWhY027vCOoVO1gDFWzi6g1CcX?= =?us-ascii?Q?x9JqtnpS+F8PKk6wozapfYpfF9ihCSKPq0YsSsdWd+/J5WzKoUD93RbYjgpa?= =?us-ascii?Q?65B6aiqH3LmU+fQ4wGBymSPErlc3NH2HHVQWFvCYCvnQFxpmoxgLyMMM0uoG?= =?us-ascii?Q?1cxnHjKeqlMYuDC/T5mqMWdzYSzJwp2DcQyi7LULP8nmvuEPMPHlUZJuz7W6?= =?us-ascii?Q?LsXi49fRl5g0kw8n/X8jcpuoTlSJfe1DlqZEoeRSdERDY47zyyIpz+oZQGzU?= =?us-ascii?Q?4NdXc4fVHWObP3F07vhU9g09IyPKZckqWmQNo2AGyZHkw3z61nhTai/kNcNy?= =?us-ascii?Q?hmMqtQ9aaRBPwcgJm37cPXA9vSE7WjSJ80KylUuZ09kRcoN+j8OPdiczbU2D?= =?us-ascii?Q?hISobgYEpIcTCShM4tgnyY/GrCS64m8htUKO39TFAZRp1Sh3VGtdnQ/aCowl?= =?us-ascii?Q?ZEDxXnbvcpEXAZoGo4dtnTsDNfEprhz4M5AmqMdrcz8dG9hTm9p2vzyVvVb5?= =?us-ascii?Q?RpB4ztCU6kCX9Cc8V2d9ArCxLjLEMquy1Eoer4ya3B89X4GggB4yD/Bcvpzl?= =?us-ascii?Q?EHL7RzwORBjixHmE9EachwvwI1453dX17EENUKcMo/c4NMbliqElOw6C+eQj?= =?us-ascii?Q?ME5iK0Vb6el1VOVRQzrxEPw3ohXdqJla2JA32vsC8u263q9qpykowJUPCQAw?= =?us-ascii?Q?stpiZsa1hpwwU1AhM1kIt8xtgxgPHPMW6/7I1YXZxtr2WNx77rIJZn1fPloy?= =?us-ascii?Q?FvC2yQh3FMNZGZ4dUDWpUbcd3BT4EH0TtZ+8tiZ6eE5Xe0Q1s9KbaZ+cozEt?= =?us-ascii?Q?6zHYlSet4seWzg7iw5IPUfUoWowDlwrryE1cK0rNKW+Ye+zVEgY4roHNvWPk?= =?us-ascii?Q?boaYHY0l90+7iFtIaXHMKe6jLD603mOpHSOLo6gIFLCoQpNTRB45Ly6Z1u9+?= =?us-ascii?Q?Su4am04oMt8Ewczx+BMl2l9GT0SkvXRbl?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0202MB2556; 6:m6FuGYhYfd6V90xuClwS/XpL7s05TCbTjfZbcSbS?= =?us-ascii?Q?SKd5OM8evfXHNkWE1rGlaXa1u7rePOe3vKHWXyMSUvLBdCLzITniLWiXQByd?= =?us-ascii?Q?+Av7ctEsX/ccTUejXdeBvX1z1b/5NDMQxPyhUC6RhM0SUXsA/tYnE55RPMiB?= =?us-ascii?Q?rqQOLzISLhPbpisL9oMFD//PnjdtVMauif6h2JQfEMB/Ex1cxdfeXKXojpzl?= =?us-ascii?Q?Kcf0iTHdOO+b3eQ8O7WYBn5v8utvoQps4hDY0/tBHOTmY5+rgk3eJp8AwyUK?= =?us-ascii?Q?AirTds0HlhaPnIiidJ2d+tTxBm0Sb49AtxmSKDoLVdq1y4h7RrYOxN/wv2se?= =?us-ascii?Q?hIL6V/yOo8j96b0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KFTaZndRTmqxSzxXE3+zGzH6dns++vssG1Vq+zdz/g7EAtZ+Ca17XWSemJlBxuQIHVOT92u6ZkcnfC5GKHSlzoC13A3PimVI1AC1ZX1Juy6tJ6XdWabMX5xxb75qEwJXlyzrlVHSIOIDt7/PJjMhqhQvDIkRgtx4hKy5oyfqisBymgf08muh07Mn7/QJdpfq9FyRlbw= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 19:25:27.1053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2556 X-Mailman-Approved-At: Wed, 21 Jun 2017 00:58:52 +0000 Cc: amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Philippe Cornu , =?UTF-8?q?Christian=20K=C3=B6nig?= , Yannick Fertre , Gerd Hoffmann , Daniel Vetter , Alex Deucher , Dave Airlie , virtualization@lists.linux-foundation.org, Vincent Abriou , Peter Rosin , 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 The redundant fb helpers .load_lut, .gamma_set and .gamma_get are no longer used. Remove the dead code and hook up the crtc .gamma_set to use the crtc gamma_store directly instead of duplicating that info locally. Signed-off-by: Peter Rosin --- drivers/gpu/drm/radeon/atombios_crtc.c | 1 - drivers/gpu/drm/radeon/radeon_connectors.c | 7 ++- drivers/gpu/drm/radeon/radeon_display.c | 71 ++++++++++++----------------- drivers/gpu/drm/radeon/radeon_fb.c | 2 - drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 1 - 5 files changed, 33 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 3c492a0..02baaaf 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c @@ -2217,7 +2217,6 @@ static const struct drm_crtc_helper_funcs atombios_helper_funcs = { .mode_set_base_atomic = atombios_crtc_set_base_atomic, .prepare = atombios_crtc_prepare, .commit = atombios_crtc_commit, - .load_lut = radeon_crtc_load_lut, .disable = atombios_crtc_disable, }; diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 27affbd..2f642cb 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -773,12 +773,15 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct if (connector->encoder->crtc) { struct drm_crtc *crtc = connector->encoder->crtc; - const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); radeon_crtc->output_csc = radeon_encoder->output_csc; - (*crtc_funcs->load_lut)(crtc); + /* + * Our .gamma_set assumes the .gamma_store has been + * prefilled and don't care about its arguments. + */ + crtc->funcs->gamma_set(crtc, NULL, NULL, NULL, 0, NULL); } } diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 17d3daf..8b7d7a0 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -42,6 +42,7 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc) struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_device *dev = crtc->dev; struct radeon_device *rdev = dev->dev_private; + u16 *r, *g, *b; int i; DRM_DEBUG_KMS("%d\n", radeon_crtc->crtc_id); @@ -60,11 +61,14 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc) WREG32(AVIVO_DC_LUT_WRITE_EN_MASK, 0x0000003f); WREG8(AVIVO_DC_LUT_RW_INDEX, 0); + r = crtc->gamma_store; + g = r + crtc->gamma_size; + b = g + crtc->gamma_size; for (i = 0; i < 256; i++) { WREG32(AVIVO_DC_LUT_30_COLOR, - (radeon_crtc->lut_r[i] << 20) | - (radeon_crtc->lut_g[i] << 10) | - (radeon_crtc->lut_b[i] << 0)); + ((*r++ & 0xffc0) << 14) | + ((*g++ & 0xffc0) << 4) | + (*b++ >> 6)); } /* Only change bit 0 of LUT_SEL, other bits are set elsewhere */ @@ -76,6 +80,7 @@ static void dce4_crtc_load_lut(struct drm_crtc *crtc) struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_device *dev = crtc->dev; struct radeon_device *rdev = dev->dev_private; + u16 *r, *g, *b; int i; DRM_DEBUG_KMS("%d\n", radeon_crtc->crtc_id); @@ -93,11 +98,14 @@ static void dce4_crtc_load_lut(struct drm_crtc *crtc) WREG32(EVERGREEN_DC_LUT_WRITE_EN_MASK + radeon_crtc->crtc_offset, 0x00000007); WREG32(EVERGREEN_DC_LUT_RW_INDEX + radeon_crtc->crtc_offset, 0); + r = crtc->gamma_store; + g = r + crtc->gamma_size; + b = g + crtc->gamma_size; for (i = 0; i < 256; i++) { WREG32(EVERGREEN_DC_LUT_30_COLOR + radeon_crtc->crtc_offset, - (radeon_crtc->lut_r[i] << 20) | - (radeon_crtc->lut_g[i] << 10) | - (radeon_crtc->lut_b[i] << 0)); + ((*r++ & 0xffc0) << 14) | + ((*g++ & 0xffc0) << 4) | + (*b++ >> 6)); } } @@ -106,6 +114,7 @@ static void dce5_crtc_load_lut(struct drm_crtc *crtc) struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_device *dev = crtc->dev; struct radeon_device *rdev = dev->dev_private; + u16 *r, *g, *b; int i; DRM_DEBUG_KMS("%d\n", radeon_crtc->crtc_id); @@ -135,11 +144,14 @@ static void dce5_crtc_load_lut(struct drm_crtc *crtc) WREG32(EVERGREEN_DC_LUT_WRITE_EN_MASK + radeon_crtc->crtc_offset, 0x00000007); WREG32(EVERGREEN_DC_LUT_RW_INDEX + radeon_crtc->crtc_offset, 0); + r = crtc->gamma_store; + g = r + crtc->gamma_size; + b = g + crtc->gamma_size; for (i = 0; i < 256; i++) { WREG32(EVERGREEN_DC_LUT_30_COLOR + radeon_crtc->crtc_offset, - (radeon_crtc->lut_r[i] << 20) | - (radeon_crtc->lut_g[i] << 10) | - (radeon_crtc->lut_b[i] << 0)); + ((*r++ & 0xffc0) << 14) | + ((*g++ & 0xffc0) << 4) | + (*b++ >> 6)); } WREG32(NI_DEGAMMA_CONTROL + radeon_crtc->crtc_offset, @@ -172,6 +184,7 @@ static void legacy_crtc_load_lut(struct drm_crtc *crtc) struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); struct drm_device *dev = crtc->dev; struct radeon_device *rdev = dev->dev_private; + u16 *r, *g, *b; int i; uint32_t dac2_cntl; @@ -183,11 +196,14 @@ static void legacy_crtc_load_lut(struct drm_crtc *crtc) WREG32(RADEON_DAC_CNTL2, dac2_cntl); WREG8(RADEON_PALETTE_INDEX, 0); + r = crtc->gamma_store; + g = r + crtc->gamma_size; + b = g + crtc->gamma_size; for (i = 0; i < 256; i++) { WREG32(RADEON_PALETTE_30_DATA, - (radeon_crtc->lut_r[i] << 20) | - (radeon_crtc->lut_g[i] << 10) | - (radeon_crtc->lut_b[i] << 0)); + ((*r++ & 0xffc0) << 14) | + ((*g++ & 0xffc0) << 4) | + (*b++ >> 6)); } } @@ -209,41 +225,10 @@ void radeon_crtc_load_lut(struct drm_crtc *crtc) legacy_crtc_load_lut(crtc); } -/** Sets the color ramps on behalf of fbcon */ -void radeon_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, - u16 blue, int regno) -{ - struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - - radeon_crtc->lut_r[regno] = red >> 6; - radeon_crtc->lut_g[regno] = green >> 6; - radeon_crtc->lut_b[regno] = blue >> 6; -} - -/** Gets the color ramps on behalf of fbcon */ -void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, - u16 *blue, int regno) -{ - struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - - *red = radeon_crtc->lut_r[regno] << 6; - *green = radeon_crtc->lut_g[regno] << 6; - *blue = radeon_crtc->lut_b[regno] << 6; -} - static int radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, uint32_t size, struct drm_modeset_acquire_ctx *ctx) { - struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); - int i; - - /* userspace palettes are always correct as is */ - for (i = 0; i < size; i++) { - radeon_crtc->lut_r[i] = red[i] >> 6; - radeon_crtc->lut_g[i] = green[i] >> 6; - radeon_crtc->lut_b[i] = blue[i] >> 6; - } radeon_crtc_load_lut(crtc); return 0; diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 356ad90..638bcb55 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -332,8 +332,6 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb } static const struct drm_fb_helper_funcs radeon_fb_helper_funcs = { - .gamma_set = radeon_crtc_fb_gamma_set, - .gamma_get = radeon_crtc_fb_gamma_get, .fb_probe = radeonfb_create, }; diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index ce6cb66..1f1856e 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c @@ -1116,7 +1116,6 @@ static const struct drm_crtc_helper_funcs legacy_helper_funcs = { .mode_set_base_atomic = radeon_crtc_set_base_atomic, .prepare = radeon_crtc_prepare, .commit = radeon_crtc_commit, - .load_lut = radeon_crtc_load_lut, .disable = radeon_crtc_disable };