From patchwork Fri Dec 20 04:33:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 13916216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D854E7718B for ; Fri, 20 Dec 2024 04:40:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1DEEB10EE9F; Fri, 20 Dec 2024 04:40:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="xPml1ait"; dkim-atps=neutral Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20602.outbound.protection.outlook.com [IPv6:2a01:111:f403:2009::602]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4820310EE9D; Fri, 20 Dec 2024 04:40:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V2SCrrEP+TjJ0zeMQfqAYnfWJ+Dzr/eFcGQkQVj1c/KcoJAxKHrR7v+k14A1d2qGWOHlSlE+TBy0alhUJfVMjLAVSDdTNJ97clv0y2h/tmjn0zwYpkp1Xet6u3yIR7nkGq4c9CzwWldMRCEVk0O3DgTF0yb6g2ILYgLMTwb2+YUvkckJVjJ1HIdNTcB8zsrPb8ldjo5XFNcFKcwVe0DOe+/l7XJvzD0tGfUSqpNlCXKWpRPKC2ZZdMlcjuQ9/kZOHk9XF1d3Qcjp3PkkdK/Upw1zuYa8UOWFUrGWYhfGQfexRPYhe0ZS+T95lpZdfINmkYFkWA7v9FP3ce9S9Vmq2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fl3eJlHQZFMshFgkC2xrJbonFmTj/2f/6oZmjaNTYLQ=; b=VTJeO+W44ehoT9GQfcIKOkDCCRolNDFdD5pjMFo1o26iJIZ+N+/ufz+UI4OZMZr228x2f3sbUMo7MPPQ6WvYv00fs1OUL4QSc732kOYQCaDftC6jQXTxF4XbDrp8ZUZwk8NayCcn9GNkTBWfLUaylwttcE/f0kppNr9dZElirSJ/7FKPQZPNf3DYerxl6CFYw08/j2djHGDIwUUKqR8aUhzkYui8tlBUjo9ZXh9Xg/1Fn5png+bWlbFaIpdrtpPdP998v660rLs7FpEMqWD3V9ucqR8ucu0Uh5eEtxQfdMwTr+gn5XZMAfqKuwJbj59KUjxbAjrZdLK92Dyq5GLNpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fl3eJlHQZFMshFgkC2xrJbonFmTj/2f/6oZmjaNTYLQ=; b=xPml1aithTSreOdTfNoEjTm3fVC+e7m5yGJaDsogCyD5WGK6Gb5Bs8Arr8Cz7kwV9LsZdkg4s0IzcmlyTaj5nvYQuccNHOOZuRtdEn3VoVWcwzmJ6aVlbiffZevwoM9Tnr4ihQdmxLJxawp1YF/KWjnwh+4X8FcO1PTBM3G5l/Q= Received: from SA0PR11CA0008.namprd11.prod.outlook.com (2603:10b6:806:d3::13) by DM4PR12MB7696.namprd12.prod.outlook.com (2603:10b6:8:100::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.14; Fri, 20 Dec 2024 04:40:18 +0000 Received: from SN1PEPF0002BA4F.namprd03.prod.outlook.com (2603:10b6:806:d3:cafe::c6) by SA0PR11CA0008.outlook.office365.com (2603:10b6:806:d3::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8272.16 via Frontend Transport; Fri, 20 Dec 2024 04:40:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002BA4F.mail.protection.outlook.com (10.167.242.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8251.15 via Frontend Transport; Fri, 20 Dec 2024 04:40:18 +0000 Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Dec 2024 22:40:16 -0600 From: Alex Hung To: , CC: , , , Louis Chauvet Subject: [V7 20/45] drm/vkms: Add tests for CTM handling Date: Thu, 19 Dec 2024 21:33:26 -0700 Message-ID: <20241220043410.416867-21-alex.hung@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220043410.416867-1-alex.hung@amd.com> References: <20241220043410.416867-1-alex.hung@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4F:EE_|DM4PR12MB7696:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fd678e5-80ab-47b4-cd0f-08dd20b067cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: YdyK7ioZv9ZTfDMOO9e2l/55tEYPq248bz/hmt4VIxwGCgB7KwrgullJkt+nwPIqFkqcegn8KnU+k7tresAlRRtjq3o2hwC8uLfwJXfAdKAlCL77ECeheZH54i977mayOqMncVTnF/40kObyx77xNNYHIxq3QNoTrtAttV5vRZk0GIWEWLSA/7CsyVPvb6WBrckHyRbyEH4WoPj4IG7H15Dj8JtygjqhJuMY75TLoqgg+4/26pcUZgY3i4f9K9Kn8zVzP/8hgZWSd5KcdlA8a75y1O0U+j6yo1f0r2XeJn0VvLjq+Zwaosn2T5ksc2uEKag1L+vf5l4jMtzSI17Mn2iq3JRYYXnm63cqhE8X16d1TQBQGo4DDxQJupAVwoeR8MsWqEpm3TrlUtooNAFLeOr7IsdHfRLDh491tz4wWR+Mj2bRTLKHUb4l1EP9R5w9dfmsNzHKkxRnDew/65AqPY0izLwhQV6+8sh00XW8L/W7kHh619QUhNFRZKn/OJPLIFiVc8isnSB6eMZ6XRBba6jSVACbYhZkM42cZGLyfEwg6XBcLoKk44NrJUjo/u0RHR/gwSHYsCNi8kzrfqxPpQDh+29Cg2ya+/hfr58oULl6G+ccipHFBKGUk9WXO9PKYSUSn6JzCzmbzlH67DlPBFvUBbmEKc3U9iKFSTRpLsw74WR0qOvn8aY4B6uZVisFf8dO4ymcjh/mMxHkIBFl8F2VjvaVUDJNhUVwj8fSCxYVW2Q9eXTx/bg5CDYDMtLtTMpp/Yv1M11B5WshJver8GnJB8C5e104OgC0jIPxvUiY6Fnr0+UIHnLX1JtEV9elEzRjC7bmTl+UmlBD6MoNOQWSwCHVZMLpRcbV8FYogCeW7X4Mc6tBg8a1273lcyyUlcWjbsigixbyHWeUB1ioc4ppfDcYGbNLBgEl+SmWSo5k8WBEafA0iCKPRpxxyAzjqHDtvdBT6mI7dwRJIr3THaEkouijpctx6rNhRaYOIygRuSsFIf1VrOOjJ2o5J5PKibSGmwiRGrLlRicSDcbFJQ1AuUMhqm8rytJCOwPVp8rj4Y2DMr6jQMDOxth/ERg7ogft9ZRkKI9QJ0yW0K3dR2iuLvD0d0+KZPtkywS4CXjnyhqHS0a6k0EgRwtgZNpA7ma8gfgA+ujEsvRvQKba9uWoxWKkd2NCiaeH1OE6OjdwnVctKqp8UbnyiYCAnsmzxPX6fhIXqVyZIefTMRlGQ/YsGDwEbJwCgbiuDQGJ3lx1zQYDWdFrIt80nYS6aEtbHyvAwDCFTCBKSBa5Yi03eF8mBSFm87xlhESbeHiRRTcPiU1Fr0PWrAeH4L7m5jXeObjIItxWu+YtJ3CVJ1xSK3ymagRY93jySBJmRD+xBx/GJpcUSFdTf+ln+yBnIgugjl4doWPefRE7YMHC0mr3MGJVQBGuYNw/cEtcr8df7+1vgVKVgyC+ckNuNIxGkzXsWm2clI/sqosxnoxLNKtfM2pXA0HKAsb220k/iKVin8E= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2024 04:40:18.3283 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fd678e5-80ab-47b4-cd0f-08dd20b067cb X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7696 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" From: Harry Wentland A whole slew of tests for CTM handling that greatly helped in debugging the CTM code. The extent of tests might seem a bit silly but they're fast and might someday help save someone else's day when debugging this. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland --- v7: - Fix a checkpatch a long-line warning (Louis Chauvet) v6: - update reference values since we're now rounding v5: - Make apply_3x4_matrix static v4: - Comment on origin of bt709_enc matrix (Pekka) - Use full opaque alpha (Pekka) - Add additional check for Y < 0xffff (Pekka) - Remove unused code (Pekka) drivers/gpu/drm/vkms/tests/vkms_color_test.c | 250 +++++++++++++++++++ drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_composer.h | 1 + 3 files changed, 254 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/tests/vkms_color_test.c b/drivers/gpu/drm/vkms/tests/vkms_color_test.c index d765c5eb5d88..e9bc4380fb88 100644 --- a/drivers/gpu/drm/vkms/tests/vkms_color_test.c +++ b/drivers/gpu/drm/vkms/tests/vkms_color_test.c @@ -190,11 +190,261 @@ static void vkms_color_srgb_inv_srgb(struct kunit *test) } } +#define FIXPT_HALF (DRM_FIXED_ONE >> 1) +#define FIXPT_QUARTER (DRM_FIXED_ONE >> 2) + +static const struct drm_color_ctm_3x4 test_matrix_3x4_50_desat = { { + FIXPT_HALF, FIXPT_QUARTER, FIXPT_QUARTER, 0, + FIXPT_QUARTER, FIXPT_HALF, FIXPT_QUARTER, 0, + FIXPT_QUARTER, FIXPT_QUARTER, FIXPT_HALF, 0 +} }; + +static void vkms_color_ctm_3x4_50_desat(struct kunit *test) +{ + struct pixel_argb_s32 ref, out; + + /* full white */ + ref.a = 0xffff; + ref.r = 0xffff; + ref.g = 0xffff; + ref.b = 0xffff; + + memcpy(&out, &ref, sizeof(out)); + apply_3x4_matrix(&out, &test_matrix_3x4_50_desat); + + KUNIT_EXPECT_MEMEQ(test, &ref, &out, sizeof(out)); + + /* full black */ + ref.a = 0xffff; + ref.r = 0x0; + ref.g = 0x0; + ref.b = 0x0; + + memcpy(&out, &ref, sizeof(out)); + apply_3x4_matrix(&out, &test_matrix_3x4_50_desat); + + KUNIT_EXPECT_MEMEQ(test, &ref, &out, sizeof(out)); + + /* 50% grey */ + ref.a = 0xffff; + ref.r = 0x8000; + ref.g = 0x8000; + ref.b = 0x8000; + + memcpy(&out, &ref, sizeof(out)); + apply_3x4_matrix(&out, &test_matrix_3x4_50_desat); + + KUNIT_EXPECT_MEMEQ(test, &ref, &out, sizeof(out)); + + /* full red to 50% desat */ + ref.a = 0xffff; + ref.r = 0x8000; + ref.g = 0x4000; + ref.b = 0x4000; + + out.a = 0xffff; + out.r = 0xffff; + out.g = 0x0; + out.b = 0x0; + + apply_3x4_matrix(&out, &test_matrix_3x4_50_desat); + + KUNIT_EXPECT_MEMEQ(test, &ref, &out, sizeof(out)); +} + +/* + * BT.709 encoding matrix + * + * Values printed from within IGT when converting + * igt_matrix_3x4_bt709_enc to the fixed-point format expected + * by DRM/KMS. + */ +static const struct drm_color_ctm_3x4 test_matrix_3x4_bt709_enc = { { + 0x00000000366cf400ull, 0x00000000b7175900ull, 0x0000000127bb300ull, 0, + 0x800000001993b3a0ull, 0x800000005609fe80ull, 0x000000006f9db200ull, 0, + 0x000000009d70a400ull, 0x800000008f011100ull, 0x800000000e6f9330ull, 0 +} }; + +static void vkms_color_ctm_3x4_bt709(struct kunit *test) +{ + struct pixel_argb_s32 out; + + /* full white to bt709 */ + out.a = 0xffff; + out.r = 0xffff; + out.g = 0xffff; + out.b = 0xffff; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 255 */ + KUNIT_EXPECT_GT(test, out.r, 0xfe00); + KUNIT_EXPECT_LT(test, out.r, 0x10000); + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x0100); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x0100); + + /* full black to bt709 */ + out.a = 0xffff; + out.r = 0x0; + out.g = 0x0; + out.b = 0x0; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 0 */ + KUNIT_EXPECT_LT(test, out.r, 0x100); + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x0100); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x0100); + + /* gray to bt709 */ + out.a = 0xffff; + out.r = 0x7fff; + out.g = 0x7fff; + out.b = 0x7fff; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 127 */ + KUNIT_EXPECT_GT(test, out.r, 0x7e00); + KUNIT_EXPECT_LT(test, out.r, 0x8000); + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x0100); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x0100); + + /* == red 255 - bt709 enc == */ + out.a = 0xffff; + out.r = 0xffff; + out.g = 0x0; + out.b = 0x0; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 54 */ + KUNIT_EXPECT_GT(test, out.r, 0x3500); + KUNIT_EXPECT_LT(test, out.r, 0x3700); + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x0100); + + /* V 157 */ + KUNIT_EXPECT_GT(test, out.b, 0x9C00); + KUNIT_EXPECT_LT(test, out.b, 0x9E00); + + + /* == green 255 - bt709 enc == */ + out.a = 0xffff; + out.r = 0x0; + out.g = 0xffff; + out.b = 0x0; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 182 */ + KUNIT_EXPECT_GT(test, out.r, 0xB500); + KUNIT_EXPECT_LT(test, out.r, 0xB780); /* laxed by half*/ + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x0100); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x0100); + + /* == blue 255 - bt709 enc == */ + out.a = 0xffff; + out.r = 0x0; + out.g = 0x0; + out.b = 0xffff; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 18 */ + KUNIT_EXPECT_GT(test, out.r, 0x1100); + KUNIT_EXPECT_LT(test, out.r, 0x1300); + + /* U 111 */ + KUNIT_EXPECT_GT(test, out.g, 0x6E00); + KUNIT_EXPECT_LT(test, out.g, 0x7000); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x0100); + + /* == red 140 - bt709 enc == */ + out.a = 0xffff; + out.r = 0x8c8c; + out.g = 0x0; + out.b = 0x0; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 30 */ + KUNIT_EXPECT_GT(test, out.r, 0x1D00); + KUNIT_EXPECT_LT(test, out.r, 0x1F00); + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x100); + + /* V 87 */ + KUNIT_EXPECT_GT(test, out.b, 0x5600); + KUNIT_EXPECT_LT(test, out.b, 0x5800); + + /* == green 140 - bt709 enc == */ + out.a = 0xffff; + out.r = 0x0; + out.g = 0x8c8c; + out.b = 0x0; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 30 */ + KUNIT_EXPECT_GT(test, out.r, 0x6400); + KUNIT_EXPECT_LT(test, out.r, 0x6600); + + /* U 0 */ + KUNIT_EXPECT_LT(test, out.g, 0x100); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x100); + + + /* == blue 140 - bt709 enc == */ + out.a = 0xffff; + out.r = 0x0; + out.g = 0x0; + out.b = 0x8c8c; + + apply_3x4_matrix(&out, &test_matrix_3x4_bt709_enc); + + /* Y 30 */ + KUNIT_EXPECT_GT(test, out.r, 0x900); + KUNIT_EXPECT_LT(test, out.r, 0xB00); + + /* U 61 */ + KUNIT_EXPECT_GT(test, out.g, 0x3C00); + KUNIT_EXPECT_LT(test, out.g, 0x3E00); + + /* V 0 */ + KUNIT_EXPECT_LT(test, out.b, 0x100); + +} + static struct kunit_case vkms_color_test_cases[] = { KUNIT_CASE(vkms_color_test_get_lut_index), KUNIT_CASE(vkms_color_test_lerp), KUNIT_CASE(vkms_color_test_linear), KUNIT_CASE(vkms_color_srgb_inv_srgb), + KUNIT_CASE(vkms_color_ctm_3x4_50_desat), + KUNIT_CASE(vkms_color_ctm_3x4_bt709), {} }; diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index cdcaaf8cdb68..ed43282e22fb 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -159,7 +159,8 @@ static void apply_lut(const struct vkms_crtc_state *crtc_state, struct line_buff } } -static void apply_3x4_matrix(struct pixel_argb_s32 *pixel, const struct drm_color_ctm_3x4 *matrix) +VISIBLE_IF_KUNIT void apply_3x4_matrix(struct pixel_argb_s32 *pixel, + const struct drm_color_ctm_3x4 *matrix) { s64 rf, gf, bf; s64 r, g, b; @@ -187,6 +188,7 @@ static void apply_3x4_matrix(struct pixel_argb_s32 *pixel, const struct drm_colo pixel->g = drm_fixp2int_round(gf); pixel->b = drm_fixp2int_round(bf); } +EXPORT_SYMBOL_IF_KUNIT(apply_3x4_matrix); static void apply_colorop(struct pixel_argb_s32 *pixel, struct drm_colorop *colorop) { diff --git a/drivers/gpu/drm/vkms/vkms_composer.h b/drivers/gpu/drm/vkms/vkms_composer.h index 67ae09913460..afef65a5c3ba 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.h +++ b/drivers/gpu/drm/vkms/vkms_composer.h @@ -21,6 +21,7 @@ u16 lerp_u16(u16 a, u16 b, s64 t); s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value); u16 apply_lut_to_channel_value(const struct vkms_color_lut *lut, u16 channel_value, enum lut_channel channel); +void apply_3x4_matrix(struct pixel_argb_s32 *pixel, const struct drm_color_ctm_3x4 *matrix); #endif #endif /* _VKMS_COMPOSER_H_ */