Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66868606A320 for ; Tue, 1 Dec 2026 19:04:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=c7wxUBmO Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 033B010FC2A; Tue, 1 Dec 2026 19:03:57 +0000 (UTC) Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012015.outbound.protection.outlook.com [40.107.209.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id B4A6D10FC2E for ; Tue, 1 Dec 2026 19:03:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T5qtspTydmkxbeQJuwRNWXHtBiZQkCleoW0zdXoDp/b6JQC14bmWv5R8E3WT75uhhaPeVm6DB9sfy8hdwBXFEylZx5IqmoCgUvYKn7C/YQrryjUVKNoKm8Wn6lZlpHrZ0krEc1B89yB7Z2K1wvh6x6S4fNejC3VzCfYg72xkqgMG7cOYexqtoezLfjZ7ASTQmN+UhJ/xah2JeWtgbChHJeFwUXKF48OhuzVvsrN00cUTRtJf1tEPG4w0xGpZqyTTAAW2SbCKrMjsETbxSHfPxF1rjNp1P6qKEX59V6ZQ7AWg+PT/+Ec5tHf73kiq6GyrnQ3yPph5fc+MWWG+R39cFA== 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=0ZQSZa3RWYLFd4LWxYa4k9j8m8/FHBpeNnn7aJ92ArA=; b=fJYkLnGDAkRTpsLUVqYpQciOYZJesy9628wFED7aup98nQ+kJaJRFkSMlkJWSO/L2RrQ7Y8BcYNe0GTeA27WAtdEbGYOjVI6k2VjQECEmQejt2Ql0+GVKxtjpe7Fvj2n5xnm+ko2kxda4cT3lA94j0Px2aHHjyVj5rgTkWPwTuqcAo2ykxTuZEl5gp06Hsc4xzKZRqZc1UbT2VywHm9c8q/HjE81AMsa09u7eU58ek+YmtK5EruiljcHnowvwwf4MQPOqpOaMlg/uPPk8Z/TQdi4jjj4iVm/2hFpd31lRra55a1ulDBrYdpSUzBniIBeSzkVg5QlIDsPDjRBYbJgqw== 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=0ZQSZa3RWYLFd4LWxYa4k9j8m8/FHBpeNnn7aJ92ArA=; b=c7wxUBmOLHHA2o9FErCgegATjnsa8m4FsSSmM/giTtby3FEBXEF4vP7jttxCfb8JDtBkXCreUI/Ja9KPeoPhJm/pmfNvChCp6dEzxR1BB/DKQf9tFjMEKg3pOEYHiapUCYf8WKjgnbrVtnxgYBUCOZX/cWisMzLbLkjAIMEeJMk= Received: from DS1PR02CA0011.namprd02.prod.outlook.com (2603:10b6:8:452::19) by IA1PR12MB9500.namprd12.prod.outlook.com (2603:10b6:208:596::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Tue, 1 Dec 2026 19:03:34 +0000 Received: from DM3PEPF000265B0.namprd02.prod.outlook.com (2603:10b6:8:452:cafe::1e) by DS1PR02CA0011.outlook.office365.com (2603:10b6:8:452::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 19:03:33 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; 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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by DM3PEPF000265B0.mail.protection.outlook.com (10.167.23.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 19:03:33 +0000 Received: from georzhanmkm.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 13:03:20 -0600 From: George Zhang To: CC: Harry Wentland , Leo Li , Aurabindo Pillai , Roman Li , Wayne Lin , Tom Chung , "Fangzhi Zuo" , Dan Wheeler , Ray Wu , Ivan Lipski , Alex Hung , James Lin , Chenyu Chen , George Zhang Subject: [PATCH 16/30] drm/amd/display: cover gamma 2.4 and 2.6 on the wide curve Date: Tue, 1 Dec 2026 13:57:52 -0500 Message-ID: <20261201190245.360906-17-george.zhang@amd.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201190245.360906-1-george.zhang@amd.com> References: <20261201190245.360906-1-george.zhang@amd.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM3PEPF000265B0:EE_|IA1PR12MB9500:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e26349e-ffab-4971-3549-08df4fddcc01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|1800799024|23010399003|82310400026|376014|261021121427099003|10067099003|56012099006|261021123027099003|261102123227099003|261009223027099003|22082099003|18002099003|11063799006|3023799007; X-Microsoft-Antispam-Message-Info: tuJbdWqDVTO7uCf0HoEar0/z/drwkbe01Znyvneyl55PuQHJ9BCINX3Gd9LmqyMxZs86TJzhKgtenbcT01d0kzFbnbFY3+/pbLPCecUeyn0zllEZ7Evm+yqtKnnggl47YbpbywVg6bfAfAjQSofq/s1VyGXwPS3WIG1i2niFtV7ifFz1QRHFWZj+AgzFFevIlTUscq28yhT/SQBdQJNPB7sY9qNOrDXJMswOjA2iltTbowlmxnULTtZJJp8qx2vkwPcRSzWIrGDjRAWdvPdRomabNmaix1fM5z60L9pxYTwYTin1vRP4FQJTkpmujGjJHtvJaPZvS5n1kqpqG3s6nhWhH51TLowKdu40i2KwyqMElDWKu8Ru/QvdBb432riR+fHZOooZ1APq8CbFf3FTvNYvTKNJzHQNAw3NT6Ovwy9Jd9hQNc9c0nX5OXiO2XQqkb6ETOoj6aGCeDuBoa8FuZykUvao0J7eI6TL+AYCJsJJXI2QhX6Ei74x2EOfHYOnTUQGBEImayihUVYNOtUZAGET1Yv0qdQ1xtABzCGQ+/FP/D70zuMvdpmJh9mVHRdjsz26ylQTLQj/C4yFgYG2MtJJaB6Pf3eC1/r8US9RE7oQQ/nKSIGqdtreQ9vT5923lDrKRAP8SkPdGUKNssp2MaJtaPk0Z6uMgHGKRZB8rmqXAF3utCm7irMgceSWsKg9l25BQPcDPhwEWOtdSSsd9Q== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(1800799024)(23010399003)(82310400026)(376014)(261021121427099003)(10067099003)(56012099006)(261021123027099003)(261102123227099003)(261009223027099003)(22082099003)(18002099003)(11063799006)(3023799007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4eW4jwg7PWCweO1BEpMyUIvdCAiyW7D5ELT/zh4lQIqn3U9aPG6ly0R1n7kr5jZ1qJwvaAww6NYgmegQhCMrbs2jOWnNG/Rl4/bjXrLaJesPPCmvdcIoIpvzPAKrVq652OOa6KUKmaHEOszapSUkbioJmIFIZeoYB4xcwFrkPKpqJ2VeiOKIrGHS8/FZqZag5i1OZHgwp2ljwkKHLt7GC7CAoJPuTJJSZjh1hw/CGHwUaTu2dKZP24yymfv48SNwmoiaW9MnTMalcUMIeR+e5+g6yTOt+0i1W0nEkmlMZZOCn/jjIbzh3UQArYJ2fCbSkq8WldmFXpi2DIRcp3lPENC5UdjH8GxidDWzs1yft58GmFE6qHO735GZxbpLLNvIfNoGuWchkgd+cX/Nxdm2owB5p+Oqp0eHuYfFeDV1VHQ+qMZxR/rX/JvokakqJEOH X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 19:03:33.8471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e26349e-ffab-4971-3549-08df4fddcc01 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM3PEPF000265B0.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB9500 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Harry Wentland cm3_helper_translate_curve_to_hw_format() puts PQ, gamma 2.2, and HLG on 32 regions from 2^-25 to 2^7. Gamma 2.4 and 2.6 used the other layout, 12 regions from 2^-12 to 2^0. cm_helper_translate_curve_to_hw_format() has the same split, for PQ and gamma 2.2 only. DCN 2.0, 2.01, 2.1, 3.0, 3.01, 3.1, and 3.14 program the plane shaper through dcn20_set_shaper_3dlut(), which calls that helper. The same helper also programs stream output regamma on DCN 1.0, output gamma and the blend LUT on DCN 2.x, the DCN 3.0 writeback (DWB) path, and the stream shaper on DCN 3.0 and 3.2. The inverse curve is the shaper, and its input is linear light from degamma. A 10-bit code v becomes (v/1023)^g. That is below 2^-12 for v = 1..31 at gamma 2.4 and v = 1..41 at gamma 2.6, so those codes come back as 0. On a gray ramp the round trip then misses the IGT bracket of 13. Gamma 2.4 needs a bracket of 33 and gamma 2.6 needs 41. Gamma 2.2 already uses the wide curve and its round trip is exact. Use the 32-region curve for gamma 2.4 and 2.6 in both helpers. Its low end is 2^-25, which covers those dark codes. On DCN 4.0.1 the gamma 2.4 round trip is exact and gamma 2.6 is off by one 10-bit code, so the original bracket of 13 passes. Only the DCN 4.0.1 plane shaper path was tested; the DCN 1.x, 2.x and 3.x paths listed above were not. Cc: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: George Zhang --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 4 +++- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c index 502a2d9b155f..6b3cc0d81e34 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c @@ -355,7 +355,9 @@ bool cm_helper_translate_curve_to_hw_format(struct dc_context *ctx, memset(lut_params, 0, sizeof(struct pwl_params)); memset(seg_distr, 0, sizeof(seg_distr)); - if (output_tf->tf == TRANSFER_FUNCTION_PQ || output_tf->tf == TRANSFER_FUNCTION_GAMMA22) { + if (output_tf->tf == TRANSFER_FUNCTION_PQ || output_tf->tf == TRANSFER_FUNCTION_GAMMA22 || + output_tf->tf == TRANSFER_FUNCTION_GAMMA24 || + output_tf->tf == TRANSFER_FUNCTION_GAMMA26) { /* 32 segments * segments are from 2^-25 to 2^7 */ diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c index eb299f7f9c41..8a76e985d359 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c @@ -133,6 +133,8 @@ bool cm3_helper_translate_curve_to_hw_format(struct dc_context *ctx, memset(seg_distr, 0, sizeof(seg_distr)); if (output_tf->tf == TRANSFER_FUNCTION_PQ || output_tf->tf == TRANSFER_FUNCTION_GAMMA22 || + output_tf->tf == TRANSFER_FUNCTION_GAMMA24 || + output_tf->tf == TRANSFER_FUNCTION_GAMMA26 || output_tf->tf == TRANSFER_FUNCTION_HLG) { /* 32 segments * segments are from 2^-25 to 2^7 -- 2.56.1