From: Alex Hung <alex.hung@amd.com>
To: Harry Wentland <harry.wentland@amd.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 2/4] drm/amd/display: Use the wide curve for gamma 2.4 and 2.6
Date: Tue, 24 Nov 2026 21:42:52 -0600 [thread overview]
Message-ID: <ba6644ce-ee2f-42d6-aec2-3a29c0d897ac@amd.com> (raw)
In-Reply-To: <20261119195158.2546927-3-harry.wentland@amd.com>
On 11/19/26 13:51, Harry Wentland wrote:
> 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 3.0, 3.01, 3.1, and 3.14 program the plane
> shaper through dcn20_set_shaper_3dlut(), which calls that helper.
>
> 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. The DCN 3.0 family path was not
> tested.
>
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> ---
> 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) {
nitpick - it is better if new code can be aligned to above.
> /* 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 ||
nitpick - it is better if new code can be aligned to above.
> output_tf->tf == TRANSFER_FUNCTION_HLG) {
> /* 32 segments
> * segments are from 2^-25 to 2^7
next prev parent reply other threads:[~2026-11-25 3:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:51 [PATCH v2 0/4] drm/amd/display: Add Gamma 2.4 and 2.6 colorop support Harry Wentland
2026-11-19 19:51 ` [PATCH v2 1/4] drm/colorop: Define Gamma 2.4 and 2.6 and its Inverse Harry Wentland
2026-11-30 21:16 ` Harry Wentland
2026-11-19 19:51 ` [PATCH v2 2/4] drm/amd/display: Use the wide curve for gamma 2.4 and 2.6 Harry Wentland
2026-11-25 3:42 ` Alex Hung [this message]
2026-11-19 19:51 ` [PATCH v2 3/4] drm/amd/display: Add support for 2.4 and 2.6 Gamma and its Inverse Harry Wentland
2026-11-19 19:51 ` [PATCH v2 4/4] drm/amd/display: Add KUnit cases for gamma 2.4 and 2.6 colorops Harry Wentland
2026-11-20 20:57 ` [PATCH v2 0/4] drm/amd/display: Add Gamma 2.4 and 2.6 colorop support Robert Mader
2026-11-25 3:43 ` Alex Hung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba6644ce-ee2f-42d6-aec2-3a29c0d897ac@amd.com \
--to=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.