All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Harry Wentland" <harry.wentland@amd.com>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v1 3/4] drm/amd/display: Add support for 2.4 and 2.6 Gamma and its Inverse
Date: Thu, 19 Nov 2026 16:13:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-223492@kernel.org> (raw)
In-Reply-To: <20261119155427.2494007-4-harry.wentland@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/amd/display: missing Gamma 2.4/2.6 wide curve in
  cm_helper_translate_curve_to_hw_format()
--

commit 9ada1f8d824096557c1dda5282f2d0aa09bccdb4
Author: Harry Wentland <harry.wentland@amd.com>

drm/amd/display: Add support for 2.4 and 2.6 Gamma and its Inverse

This commit maps the Gamma 2.4 and 2.6 1D curve types to the
corresponding DC transfer functions and advertises them in the supported
degamma, shaper, and blend transfer function masks.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
> index d32bf2bf28478..935c041c1d316 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
> @@ -38,21 +38,27 @@ const u64 amdgpu_dm_supported_degam_tfs =
>  	BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) |
>  	BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) |
>  	BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF) |
> -	BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
> +	BIT(DRM_COLOROP_1D_CURVE_GAMMA22) |
> +	BIT(DRM_COLOROP_1D_CURVE_GAMMA24) |
> +	BIT(DRM_COLOROP_1D_CURVE_GAMMA26);
>  EXPORT_IF_KUNIT(amdgpu_dm_supported_degam_tfs);
>  
>  const u64 amdgpu_dm_supported_shaper_tfs =
>  	BIT(DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) |
>  	BIT(DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF) |
>  	BIT(DRM_COLOROP_1D_CURVE_BT2020_OETF) |
> -	BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
> +	BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV) |
> +	BIT(DRM_COLOROP_1D_CURVE_GAMMA24_INV) |
> +	BIT(DRM_COLOROP_1D_CURVE_GAMMA26_INV);
>  EXPORT_IF_KUNIT(amdgpu_dm_supported_shaper_tfs);

[Severity: Medium]
Should cm_helper_translate_curve_to_hw_format() also select the wide
32-region curve for TRANSFER_FUNCTION_GAMMA24 and
TRANSFER_FUNCTION_GAMMA26?

While commit "drm/amd/display: Use the wide CM3 curve for gamma 2.4 and
2.6" updated cm3_helper_translate_curve_to_hw_format() (used on DCN 3.2
and 4.01), DCN 3.0, 3.01, 3.1, and 3.14 wire set_shaper_3dlut to
dcn20_set_shaper_3dlut(), which translates plane_state->cm.shaper_func via
cm_helper_translate_curve_to_hw_format():

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c:cm_helper_translate_curve_to_hw_format() {
	...
	if (output_tf->tf == TRANSFER_FUNCTION_PQ || output_tf->tf == TRANSFER_FUNCTION_GAMMA22) {
		...
	} else {
		corner_points[0].red.x = dc_fixpt_from_fraction(1, 4096);
	...
}

When userspace configures DRM_COLOROP_1D_CURVE_GAMMA24_INV or
DRM_COLOROP_1D_CURVE_GAMMA26_INV on the plane shaper colorop on DCN
3.0..3.14, the shaper LUT falls back to the 12-region (2^-12 to 2^0)
curve and crushes dark linear values below 2^-12 to zero.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119155427.2494007-1-harry.wentland@amd.com?part=3

  reply	other threads:[~2026-11-19 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 15:54 [PATCH v1 0/4] drm/amd/display: Add Gamma 2.4 and 2.6 colorop support Harry Wentland
2026-11-19 15:54 ` [PATCH v1 1/4] drm/colorop: Define Gamma 2.4 and 2.6 and its Inverse Harry Wentland
2026-11-19 15:54 ` [PATCH v1 2/4] drm/amd/display: Use the wide CM3 curve for gamma 2.4 and 2.6 Harry Wentland
2026-11-19 15:54 ` [PATCH v1 3/4] drm/amd/display: Add support for 2.4 and 2.6 Gamma and its Inverse Harry Wentland
2026-11-19 16:13   ` sashiko-bot [this message]
2026-11-19 15:54 ` [PATCH v1 4/4] drm/amd/display: Add KUnit cases for gamma 2.4 and 2.6 colorops Harry Wentland

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=sashiko-outbox-223492@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.