From: Harry Wentland <harry.wentland@amd.com>
To: Alex Hung <alex.hung@amd.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: wayland-devel@lists.freedesktop.org, leo.liu@amd.com,
ville.syrjala@linux.intel.com, pekka.paalanen@collabora.com,
contact@emersion.fr, mwen@igalia.com, jadahl@redhat.com,
sebastian.wick@redhat.com, shashank.sharma@amd.com,
agoins@nvidia.com, joshua@froggi.es, mdaenzer@redhat.com,
aleixpol@kde.org, xaver.hugl@gmail.com, victoria@system76.com,
daniel@ffwll.ch, uma.shankar@intel.com, quic_naseer@quicinc.com,
quic_cbraga@quicinc.com, quic_abhinavk@quicinc.com,
marcan@marcan.st, Liviu.Dudau@arm.com, sashamcintosh@google.com,
chaitanya.kumar.borah@intel.com, louis.chauvet@bootlin.com,
mcanal@igalia.com, nfraprado@collabora.com,
arthurgrillo@riseup.net
Subject: Re: [PATCH V12 46/49] drm/amd/display: Ensure 3D LUT for color pipeline
Date: Thu, 13 Nov 2025 14:40:28 -0500 [thread overview]
Message-ID: <6d14a4c8-1f74-4c30-ac1e-ec4777bdb8cd@amd.com> (raw)
In-Reply-To: <20251030034349.2309829-47-alex.hung@amd.com>
On 2025-10-29 23:42, Alex Hung wrote:
> Check dpp.hw_3d_lut before creating shaper tf/lut and 3dlut colorops in
> colorpipeline and handling these colorops.
>
> Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> v10:
> - Check dpp.hw_3d_lut before creating shaper tf/lut and 3dlut colorops
> (Melissa Wen)
>
> .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 47 ++++----
> .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 103 +++++++++---------
> 2 files changed, 78 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> index e6da42e7fcb3..c3ddf136dbc8 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> @@ -1868,6 +1868,7 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state,
> {
> struct drm_colorop *colorop = plane_state->color_pipeline;
> struct drm_device *dev = plane_state->plane->dev;
> + struct amdgpu_device *adev = drm_to_adev(dev);
> int ret;
>
> /* 1D Curve - DEGAM TF */
> @@ -1900,32 +1901,34 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state,
> if (ret)
> return ret;
>
> - /* 1D Curve & LUT - SHAPER TF & LUT */
> - colorop = colorop->next;
> - if (!colorop) {
> - drm_dbg(dev, "no Shaper TF colorop found\n");
> - return -EINVAL;
> - }
> + if (adev->dm.dc->caps.color.dpp.hw_3d_lut) {
> + /* 1D Curve & LUT - SHAPER TF & LUT */
> + colorop = colorop->next;
> + if (!colorop) {
> + drm_dbg(dev, "no Shaper TF colorop found\n");
> + return -EINVAL;
> + }
>
> - ret = __set_dm_plane_colorop_shaper(plane_state, dc_plane_state, colorop);
> - if (ret)
> - return ret;
> + ret = __set_dm_plane_colorop_shaper(plane_state, dc_plane_state, colorop);
> + if (ret)
> + return ret;
>
> - /* Shaper LUT colorop is already handled, just skip here */
> - colorop = colorop->next;
> - if (!colorop)
> - return -EINVAL;
> + /* Shaper LUT colorop is already handled, just skip here */
> + colorop = colorop->next;
> + if (!colorop)
> + return -EINVAL;
>
> - /* 3D LUT */
> - colorop = colorop->next;
> - if (!colorop) {
> - drm_dbg(dev, "no 3D LUT colorop found\n");
> - return -EINVAL;
> - }
> + /* 3D LUT */
> + colorop = colorop->next;
> + if (!colorop) {
> + drm_dbg(dev, "no 3D LUT colorop found\n");
> + return -EINVAL;
> + }
>
> - ret = __set_dm_plane_colorop_3dlut(plane_state, dc_plane_state, colorop);
> - if (ret)
> - return ret;
> + ret = __set_dm_plane_colorop_3dlut(plane_state, dc_plane_state, colorop);
> + if (ret)
> + return ret;
> + }
>
> /* 1D Curve & LUT - BLND TF & LUT */
> colorop = colorop->next;
> 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 f89a887c6b14..f205f3c31f6a 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
> @@ -31,6 +31,7 @@
>
> #include "amdgpu.h"
> #include "amdgpu_dm_colorop.h"
> +#include "dc.h"
>
> const u64 amdgpu_dm_supported_degam_tfs =
> BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) |
> @@ -55,6 +56,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
> {
> struct drm_colorop *ops[MAX_COLOR_PIPELINE_OPS];
> struct drm_device *dev = plane->dev;
> + struct amdgpu_device *adev = drm_to_adev(dev);
> int ret;
> int i = 0;
>
> @@ -108,57 +110,58 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
>
> i++;
>
> - /* 1D curve - SHAPER TF */
> - ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> - if (!ops[i]) {
> - ret = -ENOMEM;
> - goto cleanup;
> - }
> -
> - ret = drm_plane_colorop_curve_1d_init(dev, ops[i], plane,
> - amdgpu_dm_supported_shaper_tfs,
> - DRM_COLOROP_FLAG_ALLOW_BYPASS);
> - if (ret)
> - goto cleanup;
> -
> - drm_colorop_set_next_property(ops[i-1], ops[i]);
> -
> - i++;
> -
> - /* 1D LUT - SHAPER LUT */
> - ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> - if (!ops[i]) {
> - ret = -ENOMEM;
> - goto cleanup;
> + if (adev->dm.dc->caps.color.dpp.hw_3d_lut) {
> + /* 1D curve - SHAPER TF */
> + ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> + if (!ops[i]) {
> + ret = -ENOMEM;
> + goto cleanup;
> + }
> +
> + ret = drm_plane_colorop_curve_1d_init(dev, ops[i], plane,
> + amdgpu_dm_supported_shaper_tfs,
> + DRM_COLOROP_FLAG_ALLOW_BYPASS);
> + if (ret)
> + goto cleanup;
> +
> + drm_colorop_set_next_property(ops[i-1], ops[i]);
> +
> + i++;
> +
> + /* 1D LUT - SHAPER LUT */
> + ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> + if (!ops[i]) {
> + ret = -ENOMEM;
> + goto cleanup;
> + }
> +
> + ret = drm_plane_colorop_curve_1d_lut_init(dev, ops[i], plane, MAX_COLOR_LUT_ENTRIES,
> + DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,
> + DRM_COLOROP_FLAG_ALLOW_BYPASS);
> + if (ret)
> + goto cleanup;
> +
> + drm_colorop_set_next_property(ops[i-1], ops[i]);
> +
> + i++;
> +
> + /* 3D LUT */
> + ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> + if (!ops[i]) {
> + ret = -ENOMEM;
> + goto cleanup;
> + }
> +
> + ret = drm_plane_colorop_3dlut_init(dev, ops[i], plane, LUT3D_SIZE,
> + DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL,
> + DRM_COLOROP_FLAG_ALLOW_BYPASS);
> + if (ret)
> + goto cleanup;
> +
> + drm_colorop_set_next_property(ops[i-1], ops[i]);
> +
> + i++;
> }
> -
> - ret = drm_plane_colorop_curve_1d_lut_init(dev, ops[i], plane, MAX_COLOR_LUT_ENTRIES,
> - DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,
> - DRM_COLOROP_FLAG_ALLOW_BYPASS);
> - if (ret)
> - goto cleanup;
> -
> - drm_colorop_set_next_property(ops[i-1], ops[i]);
> -
> - i++;
> -
> - /* 3D LUT */
> - ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> - if (!ops[i]) {
> - ret = -ENOMEM;
> - goto cleanup;
> - }
> -
> - ret = drm_plane_colorop_3dlut_init(dev, ops[i], plane, LUT3D_SIZE,
> - DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL,
> - DRM_COLOROP_FLAG_ALLOW_BYPASS);
> - if (ret)
> - goto cleanup;
> -
> - drm_colorop_set_next_property(ops[i-1], ops[i]);
> -
> - i++;
> -
> /* 1D curve - BLND TF */
> ops[i] = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
> if (!ops[i]) {
next prev parent reply other threads:[~2025-11-13 19:40 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 3:42 [PATCH V12 00/49] Color Pipeline API w/ VKMS Alex Hung
2025-10-30 3:42 ` [PATCH V12 01/49] drm: Add helper for conversion from signed-magnitude Alex Hung
2025-10-30 3:42 ` [PATCH V12 02/49] drm/vkms: Add kunit tests for VKMS LUT handling Alex Hung
2025-10-30 14:50 ` Louis Chauvet
2025-10-31 0:01 ` Alex Hung
2025-10-30 3:42 ` [PATCH V12 03/49] drm/doc/rfc: Describe why prescriptive color pipeline is needed Alex Hung
2025-10-30 3:42 ` [PATCH V12 04/49] drm/colorop: Introduce new drm_colorop mode object Alex Hung
2025-10-30 3:42 ` [PATCH V12 05/49] drm/colorop: Add TYPE property Alex Hung
2025-10-30 3:42 ` [PATCH V12 06/49] drm/colorop: Add 1D Curve subtype Alex Hung
2025-10-30 3:42 ` [PATCH V12 07/49] drm/colorop: Add BYPASS property Alex Hung
2025-10-30 3:42 ` [PATCH V12 08/49] drm/colorop: Add NEXT property Alex Hung
2025-10-30 3:42 ` [PATCH V12 09/49] drm/colorop: Add atomic state print for drm_colorop Alex Hung
2025-10-30 3:42 ` [PATCH V12 10/49] drm/plane: Add COLOR PIPELINE property Alex Hung
2025-10-30 3:42 ` [PATCH V12 11/49] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE Alex Hung
2025-10-30 3:42 ` [PATCH V12 12/49] Documentation/gpu: document drm_colorop Alex Hung
2025-10-30 3:42 ` [PATCH V12 13/49] drm/colorop: Add destroy functions for color pipeline Alex Hung
2025-10-30 3:42 ` [PATCH V12 14/49] drm/vkms: Add enumerated 1D curve colorop Alex Hung
2025-10-30 14:50 ` Louis Chauvet
2025-10-31 0:04 ` Alex Hung
2025-10-31 10:15 ` Louis Chauvet
2025-10-31 22:28 ` Alex Hung
2025-10-30 3:42 ` [PATCH V12 15/49] drm/vkms: Add kunit tests for linear and sRGB LUTs Alex Hung
2025-10-30 3:42 ` [PATCH V12 16/49] drm/colorop: Add 3x4 CTM type Alex Hung
2025-10-30 3:42 ` [PATCH V12 17/49] drm/vkms: Use s32 for internal color pipeline precision Alex Hung
2025-10-30 3:42 ` [PATCH V12 18/49] drm/vkms: add 3x4 matrix in color pipeline Alex Hung
2025-10-30 3:42 ` [PATCH V12 19/49] drm/tests: Add a few tests around drm_fixed.h Alex Hung
2025-10-30 3:42 ` [PATCH V12 20/49] drm/vkms: Add tests for CTM handling Alex Hung
2025-10-30 3:42 ` [PATCH V12 21/49] drm/colorop: pass plane_color_pipeline client cap to atomic check Alex Hung
2025-10-30 3:42 ` [PATCH V12 22/49] drm/colorop: define a new macro for_each_new_colorop_in_state Alex Hung
2025-10-30 3:42 ` [PATCH V12 23/49] drm/amd/display: Ignore deprecated props when plane_color_pipeline set Alex Hung
2025-10-30 3:42 ` [PATCH V12 24/49] drm/amd/display: Add bypass COLOR PIPELINE Alex Hung
2025-10-30 3:42 ` [PATCH V12 25/49] drm/amd/display: Skip color pipeline initialization for cursor plane Alex Hung
2025-10-30 3:42 ` [PATCH V12 26/49] drm/amd/display: Add support for sRGB EOTF in DEGAM block Alex Hung
2025-10-30 3:42 ` [PATCH V12 27/49] drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER block Alex Hung
2025-10-30 3:42 ` [PATCH V12 28/49] drm/amd/display: Add support for sRGB EOTF in BLND block Alex Hung
2025-10-30 3:42 ` [PATCH V12 29/49] drm/colorop: Add PQ 125 EOTF and its inverse Alex Hung
2025-10-30 3:42 ` [PATCH V12 30/49] drm/amd/display: Enable support for PQ 125 EOTF and Inverse Alex Hung
2025-10-30 3:42 ` [PATCH V12 31/49] drm/colorop: add BT2020/BT709 OETF and Inverse OETF Alex Hung
2025-10-30 3:42 ` [PATCH V12 32/49] drm/amd/display: Add support for BT.709 and BT.2020 TFs Alex Hung
2025-10-30 3:42 ` [PATCH V12 33/49] drm: Add Enhanced LUT precision structure Alex Hung
2025-10-30 3:42 ` [PATCH V12 34/49] drm: Add helper to extract lut from struct drm_color_lut32 Alex Hung
2025-10-30 3:42 ` [PATCH V12 35/49] drm/colorop: Add 1D Curve Custom LUT type Alex Hung
2025-10-30 3:42 ` [PATCH V12 36/49] drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT Alex Hung
2025-10-30 3:42 ` [PATCH V12 37/49] drm/amd/display: add 3x4 matrix colorop Alex Hung
2025-10-30 3:42 ` [PATCH V12 38/49] drm/colorop: Add multiplier type Alex Hung
2025-10-30 3:42 ` [PATCH V12 39/49] drm/amd/display: add multiplier colorop Alex Hung
2025-10-30 3:42 ` [PATCH V12 40/49] drm/amd/display: Swap matrix and multiplier Alex Hung
2025-10-30 3:42 ` [PATCH V12 41/49] drm/colorop: Define LUT_1D interpolation Alex Hung
2025-10-30 3:42 ` [PATCH V12 42/49] drm/colorop: allow non-bypass colorops Alex Hung
2025-10-30 3:42 ` [PATCH V12 43/49] drm/colorop: Add 3D LUT support to color pipeline Alex Hung
2025-10-30 3:42 ` [PATCH V12 44/49] drm/amd/display: add 3D LUT colorop Alex Hung
2025-10-30 3:42 ` [PATCH V12 45/49] drm/amd/display: Add AMD color pipeline doc Alex Hung
2025-10-30 3:42 ` [PATCH V12 46/49] drm/amd/display: Ensure 3D LUT for color pipeline Alex Hung
2025-11-13 19:40 ` Harry Wentland [this message]
2025-10-30 3:42 ` [PATCH V12 47/49] drm/amd/display: Disable CRTC degamma when color pipeline is enabled Alex Hung
2025-11-13 19:46 ` Harry Wentland
2025-10-30 3:42 ` [PATCH V12 48/49] drm/colorop: Add DRM_COLOROP_1D_CURVE_GAMMA22 to 1D Curve Alex Hung
2025-11-13 19:47 ` Harry Wentland
2025-10-30 3:42 ` [PATCH V12 49/49] drm/amd/display: Enable support for Gamma 2.2 Alex Hung
2025-11-13 19:50 ` 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=6d14a4c8-1f74-4c30-ac1e-ec4777bdb8cd@amd.com \
--to=harry.wentland@amd.com \
--cc=Liviu.Dudau@arm.com \
--cc=agoins@nvidia.com \
--cc=aleixpol@kde.org \
--cc=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=arthurgrillo@riseup.net \
--cc=chaitanya.kumar.borah@intel.com \
--cc=contact@emersion.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jadahl@redhat.com \
--cc=joshua@froggi.es \
--cc=leo.liu@amd.com \
--cc=louis.chauvet@bootlin.com \
--cc=marcan@marcan.st \
--cc=mcanal@igalia.com \
--cc=mdaenzer@redhat.com \
--cc=mwen@igalia.com \
--cc=nfraprado@collabora.com \
--cc=pekka.paalanen@collabora.com \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_cbraga@quicinc.com \
--cc=quic_naseer@quicinc.com \
--cc=sashamcintosh@google.com \
--cc=sebastian.wick@redhat.com \
--cc=shashank.sharma@amd.com \
--cc=uma.shankar@intel.com \
--cc=victoria@system76.com \
--cc=ville.syrjala@linux.intel.com \
--cc=wayland-devel@lists.freedesktop.org \
--cc=xaver.hugl@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox