From patchwork Thu Oct 3 20:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13821515 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 9132DCF34C7 for ; Thu, 3 Oct 2024 20:02:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFAB310E948; Thu, 3 Oct 2024 20:01:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="qlirlWRO"; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id 818EB10E90E; Thu, 3 Oct 2024 20:01:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T4iXOWJ7MLoT5CWfDLxI/iJRS94xYBZ/GVF20khwNSjxpKbD5a8voUqke+KqOMdyBzpD/F2CRHELV5WJQopA1hvIKgvRHePZNcCZ6bemNRsRRxDAOEE62BWL/CNWWSqvAW4L13hAZ8J8j067/5eJayJMoW9VVAd5O1vUNj5FJ86oYprPNgg902Nx6BmoOwuDF+5EW/qGoveMdgm3Yv3pfaIYHqJKkqZQfSa5dYjhZ0lzGLgGYB85d7W0Utyy9J/m1fcuEhcIIhSQpMyoj9PyMk+/Swm7ZYvQ8cD+nmh5auEKdVYg1TA8GNfQEU1UsD4Mh56YA+j+LNwvXqKWANo74A== 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=MGyqgMWYwW7qlhPYpJtvyScSYzWSzKiGH8lFTqQkAX4=; b=nie4Zm6IZQMCq7KSbDA+gNVYKKm3YnLx0oRswLapyyr236wZq7DIQ04g2547ya3AIha+5wuEhaCTuCcvIH1OLrLSo1DH0c3mhkyUCll3xzdoHZ3srgcovgx6XCAWHFGI57ye/67qNEZlTzdkEqRhz3fmGifCCrT8W+WpIQoO/1iCfHZXk9zI0UYzmJhCLBULmZfWIlrQuMsSi01hRsEk+oEcc9h2I+2iRcMlZvKHTEiSep2FgoLn61Y7+sY2RPKVLckWboMoSNoosoXfB9/sV0OLnhZEyqmoc+9B9BkoTk8SSRL8dSG48c28y4Cf4DAT31hCyCqBSRvLWiGDChhnQg== 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=MGyqgMWYwW7qlhPYpJtvyScSYzWSzKiGH8lFTqQkAX4=; b=qlirlWRObK/Y3G3oQ+ATTMhdvVMl4ecfHXa27oAEdpIBUfhRnmPoIcvSGlua2dhJ0WT/x5RqIY9BVC2w2QTmqvq/yw/220DZmEDm1r48jPVC/iEjodCviTBxlrWnL2QUAGU8A12eLte9qg3Yuw1zFhwWcy5ZRN51oYlRo2OSHvE= Received: from CH2PR14CA0046.namprd14.prod.outlook.com (2603:10b6:610:56::26) by CY5PR12MB6429.namprd12.prod.outlook.com (2603:10b6:930:3b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Thu, 3 Oct 2024 20:01:46 +0000 Received: from DS2PEPF0000343E.namprd02.prod.outlook.com (2603:10b6:610:56:cafe::a2) by CH2PR14CA0046.outlook.office365.com (2603:10b6:610:56::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.17 via Frontend Transport; Thu, 3 Oct 2024 20:01:46 +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 DS2PEPF0000343E.mail.protection.outlook.com (10.167.18.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Thu, 3 Oct 2024 20:01:46 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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, 3 Oct 2024 15:01:44 -0500 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 3 Oct 2024 15:01:44 -0500 From: Harry Wentland To: , CC: , Harry Wentland Subject: [PATCH v6 21/44] drm/vkms: Add tests for CTM handling Date: Thu, 3 Oct 2024 16:01:03 -0400 Message-ID: <20241003200129.1732122-22-harry.wentland@amd.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003200129.1732122-1-harry.wentland@amd.com> References: <20241003200129.1732122-1-harry.wentland@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: harry.wentland@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343E:EE_|CY5PR12MB6429:EE_ X-MS-Office365-Filtering-Correlation-Id: cb198991-6b62-4c77-700a-08dce3e635d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: mckMhzSvrXVGY9HFcL/ycyHi0ETB8O5ubyrmrF80ZWhJWontILh90LXNtZRMa+RuZl8rapJRQHCYfG4eMGNHb3A3SflyQ6/dCuuvN9/4VARbaXsFJZROpGMMQ5vrTOtBkona6UsR3MGn+wuh6FDCzjbY27RaD0dNB4RjpAG1BasEZSD1NBr8YyHONXiO3NfTM+nXeUcdble8Jkoj0z0HnPjyBgBRmeXOtXVZVHOdXxYw7cpqo6lU5OSBhon0oMboHpxpo0SjUdqfWpdxRqx6gI6jhrumFqsdkwBdcHDX7Jva9G7kIxtDHQpKO68HCLAbvCUlnykAAB0j5Ujrxc85I+zhT4KPGbb78CuMC4iqErOaRjhUCHCVJPR8F9E0WEhSZk4U/ezSVYPDPFbzV+F3dRA7ISmXC/0m0KsBmFG1zp1wW6deFmzO1rUwfNrdfb9pG2TPty/5+HuxPtqw4qgVfgtLiu8DFvyOEMshJpqtcELKQOvOWVJqlO/JoSRawoaT5B/yJUUZF0eOplATVxA5tUo+QajYDgvgl7Y6qO6TRD8slROdb1rSuZalaGHJjcqACS3Z4hDgVQsccfxzn6sz1UvQpUP03LIrz3w02PbOFAM6GltL8DUYucoOTuIoaSChjhFNTYqV6tqA27sZ1+73CmdnM6txhghIbAgoEbS3497edIfq5ra7iiBO7+8SBaOg7C8wo3+Roge6XV3sPxztT+MceJnn6bMlQ6Gl5vLC1Dt8kQJQ3quwduR3k8H2W4OmCSKab1kCvNB8tB813t8BWUrCux/DDaeu+9yIZ+EUfZZY2oVFCp7wxfoDqngNT+69rEhG/G2bZOsO7oLSkNcFXVvqV3yJTMGKSmlm9nVCrMHLOl6eqVMolUhCk5WPuuZptaV8Os/cpsB96Z2Hlv1hxNIEYRP4Mmra7Q0RyzbMiDITAVEGlQMXZ9Dq2YaSkBLGsZc+QKdnUXK5BvdYmMtvSiHhc4imdbHrKClxchdoVOiuLwwfSSzTE0l+FOke2/RbRUNscacPM4pyCwXMQL+KyEvIrbKqKmSV47wtmWYEL73nKdAKRSogkhRK6Aa1m1Pw5eh+rIL7SVaMyCgjBKGevgQkdIbBmEEjNQr8RNY4kL/gYbbyMdShcIXHn3e/GqQMTqw8FbeGn/6bO7+Sm1yaoLalOTKDnE+BBeI3YQeYCrQf+xeoUlcS1YVRMrZIRzjqdMaHKx6PTCYi1eBGLj0nitLE31/QleFu18m5sIv1JI5Vnp+pHmXck0Uzgm1djgC3EPxrijEQicm33+hoSjlU1eu8TVbKI6SkioYm1Qq5IUO+RfkPKuboSwz6ux/pbNO+qoW+zSqCZclKRgYK+aSeu20F9bJYwsYJo2Y+rbXh9vglPCSHAnCEgSDhLSMtrF9P 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)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2024 20:01:46.3943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb198991-6b62-4c77-700a-08dce3e635d9 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: DS2PEPF0000343E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6429 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" 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. Signed-off-by: Harry Wentland Reviewed-by: 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) - Rename red, green, blue to Y, U, V where applicable drivers/gpu/drm/vkms/tests/vkms_color_test.c | 250 +++++++++++++++++++ drivers/gpu/drm/vkms/vkms_composer.c | 3 +- drivers/gpu/drm/vkms/vkms_composer.h | 1 + 3 files changed, 253 insertions(+), 1 deletion(-) -- 2.46.2 diff --git a/drivers/gpu/drm/vkms/tests/vkms_color_test.c b/drivers/gpu/drm/vkms/tests/vkms_color_test.c index c36e67c7909e..d5eb1e4e9b67 100644 --- a/drivers/gpu/drm/vkms/tests/vkms_color_test.c +++ b/drivers/gpu/drm/vkms/tests/vkms_color_test.c @@ -187,11 +187,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) + +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. + */ +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 c8b9b9d7f78f..daee7d56abb7 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -159,7 +159,7 @@ 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 +187,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_ */