AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: ariel.dalessandro@collabora.com,
	wayland-devel@lists.freedesktop.org, harry.wentland@amd.com,
	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,
	arthurgrillo@riseup.net, Daniel Stone <daniels@collabora.com>
Subject: Re: [PATCH V13 06/51] drm/colorop: Add 1D Curve subtype
Date: Tue, 16 Dec 2025 18:06:19 -0700	[thread overview]
Message-ID: <083e313e-ab8b-4a38-b40d-9b416b8d162b@amd.com> (raw)
In-Reply-To: <492878007a02ffa87d0cff301571ffd100bc9c94.camel@collabora.com>



On 12/16/25 11:19, Nícolas F. R. A. Prado wrote:
> On Fri, 2025-11-14 at 17:01 -0700, Alex Hung wrote:
>> From: Harry Wentland <harry.wentland@amd.com>
>>
>> Add a new drm_colorop with DRM_COLOROP_1D_CURVE with two subtypes:
>> DRM_COLOROP_1D_CURVE_SRGB_EOTF and
>> DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF.
>>
>> Reviewed-by: Simon Ser <contact@emersion.fr>
>> Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
>> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
>> Co-developed-by: Alex Hung <alex.hung@amd.com>
>> Signed-off-by: Alex Hung <alex.hung@amd.com>
>> Reviewed-by: Daniel Stone <daniels@collabora.com>
>> Reviewed-by: Melissa Wen <mwen@igalia.com>
>> Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
>> ---
> [..]
>> diff --git a/drivers/gpu/drm/drm_colorop.c
>> b/drivers/gpu/drm/drm_colorop.c
>> index 1459a28c7e7b..6fbc3c284d33 100644
>> --- a/drivers/gpu/drm/drm_colorop.c
>> +++ b/drivers/gpu/drm/drm_colorop.c
> [..]
>> +static int drm_plane_colorop_init(struct drm_device *dev, struct
>> drm_colorop *colorop,
>> +			    struct drm_plane *plane, enum
>> drm_colorop_type type)
>> +{
>> +	struct drm_mode_config *config = &dev->mode_config;
>> +	struct drm_property *prop;
>> +	int ret = 0;
>> +
>> +	ret = drm_mode_object_add(dev, &colorop->base,
>> DRM_MODE_OBJECT_COLOROP);
>> +	if (ret)
>> +		return ret;
>> +
>> +	colorop->base.properties = &colorop->properties;
>> +	colorop->dev = dev;
>> +	colorop->type = type;
>> +	colorop->plane = plane;
>> +
>> +	list_add_tail(&colorop->head, &config->colorop_list);
>> +	colorop->index = config->num_colorop++;
> 
> Hi Alex,
> 
> I know this series has already been merged, but I was looking through
> the code together with Ariel and we noticed that while this init
> function adds the colorop to the list in the drm_mode_config, it
> doesn't remove it in the error paths below, and I believe it should.
> 
> Does that make sense?
> 

Hi Nicolas,

drm_colorop_pipeline_destroy() calls drm_colorop_cleanup() to delete it. 
After drm_colorop_pipeline_destroy is called the entire pipeline will be 
freed.

void drm_colorop_cleanup(struct drm_colorop *colorop)
{
	...
	list_del(&colorop->head);
	config->num_colorop--;
	...
}

For example, amdgpu calls drm_plane_colorop_*_init functions (which call 
drm_plane_colorop_init themselves) to create a pipeline. If any of 
colorop creation fails, amdgpu calls drm_colorop_pipeline_destroy to 
destroy the entire pipeline.

In the end, we either have a good pipeline or none.

> Thanks,
> Nicolas
> 
>> +
>> +	/* add properties */
>> +
>> +	/* type */
>> +	prop = drm_property_create_enum(dev,
>> +					DRM_MODE_PROP_IMMUTABLE,
>> +					"TYPE",
>> drm_colorop_type_enum_list,
>> +					ARRAY_SIZE(drm_colorop_type_
>> enum_list));
>> +
>> +	if (!prop)
>> +		return -ENOMEM;
>> +
>> +	colorop->type_property = prop;
>> +
>> +	drm_object_attach_property(&colorop->base,
>> +				   colorop->type_property,
>> +				   colorop->type);
>> +
>> +	return ret;
>> +}


  reply	other threads:[~2025-12-17  1:06 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-15  0:01 [PATCH V13 00/51][FINAL] Color Pipeline API w/ VKMS Alex Hung
2025-11-15  0:01 ` [PATCH V13 01/51] drm: Add helper for conversion from signed-magnitude Alex Hung
2025-11-15  0:01 ` [PATCH V13 02/51] drm/vkms: Add kunit tests for VKMS LUT handling Alex Hung
2025-11-15  0:01 ` [PATCH V13 03/51] drm/doc/rfc: Describe why prescriptive color pipeline is needed Alex Hung
2025-11-15  0:01 ` [PATCH V13 04/51] drm/colorop: Introduce new drm_colorop mode object Alex Hung
2025-11-15  0:01 ` [PATCH V13 05/51] drm/colorop: Add TYPE property Alex Hung
2025-11-15  0:01 ` [PATCH V13 06/51] drm/colorop: Add 1D Curve subtype Alex Hung
2025-12-16 18:19   ` Nícolas F. R. A. Prado
2025-12-17  1:06     ` Alex Hung [this message]
2025-12-19 13:18       ` Borah, Chaitanya Kumar
2025-11-15  0:01 ` [PATCH V13 07/51] drm/colorop: Add BYPASS property Alex Hung
2025-11-15  0:01 ` [PATCH V13 08/51] drm/colorop: Add NEXT property Alex Hung
2025-11-15  0:01 ` [PATCH V13 09/51] drm/colorop: Add atomic state print for drm_colorop Alex Hung
2025-11-15  0:01 ` [PATCH V13 10/51] drm/plane: Add COLOR PIPELINE property Alex Hung
2025-11-15  0:01 ` [PATCH V13 11/51] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE Alex Hung
2025-11-15  0:01 ` [PATCH V13 12/51] Documentation/gpu: document drm_colorop Alex Hung
2025-11-15  0:01 ` [PATCH V13 13/51] drm/colorop: Add destroy functions for color pipeline Alex Hung
2025-11-15  0:01 ` [PATCH V13 14/51] drm/vkms: Pass plane_cfg to plane initialization Alex Hung
2025-11-15  0:01 ` [PATCH V13 15/51] drm/vkms: Add enumerated 1D curve colorop Alex Hung
2025-12-16 18:26   ` Nícolas F. R. A. Prado
2025-12-17  1:10     ` Alex Hung
2025-11-15  0:01 ` [PATCH V13 16/51] drm/vkms: Add config for default plane pipeline Alex Hung
2025-11-15  0:01 ` [PATCH V13 17/51] drm/vkms: Add kunit tests for linear and sRGB LUTs Alex Hung
2025-11-15  0:01 ` [PATCH V13 18/51] drm/colorop: Add 3x4 CTM type Alex Hung
2025-11-15  0:01 ` [PATCH V13 19/51] drm/vkms: Use s32 for internal color pipeline precision Alex Hung
2025-11-15  0:01 ` [PATCH V13 20/51] drm/vkms: add 3x4 matrix in color pipeline Alex Hung
2025-11-15  0:01 ` [PATCH V13 21/51] drm/tests: Add a few tests around drm_fixed.h Alex Hung
2025-11-15  0:01 ` [PATCH V13 22/51] drm/vkms: Add tests for CTM handling Alex Hung
2025-11-15  0:01 ` [PATCH V13 23/51] drm/colorop: pass plane_color_pipeline client cap to atomic check Alex Hung
2025-11-15  0:01 ` [PATCH V13 24/51] drm/colorop: define a new macro for_each_new_colorop_in_state Alex Hung
2025-11-15  0:01 ` [PATCH V13 25/51] drm/amd/display: Ignore deprecated props when plane_color_pipeline set Alex Hung
2025-11-15  0:01 ` [PATCH V13 26/51] drm/amd/display: Add bypass COLOR PIPELINE Alex Hung
2025-11-15  0:01 ` [PATCH V13 27/51] drm/amd/display: Skip color pipeline initialization for cursor plane Alex Hung
2025-11-15  0:01 ` [PATCH V13 28/51] drm/amd/display: Add support for sRGB EOTF in DEGAM block Alex Hung
2025-11-15  0:01 ` [PATCH V13 29/51] drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER block Alex Hung
2025-11-15  0:01 ` [PATCH V13 30/51] drm/amd/display: Add support for sRGB EOTF in BLND block Alex Hung
2025-11-15  0:01 ` [PATCH V13 31/51] drm/colorop: Add PQ 125 EOTF and its inverse Alex Hung
2025-11-15  0:01 ` [PATCH V13 32/51] drm/amd/display: Enable support for PQ 125 EOTF and Inverse Alex Hung
2025-11-15  0:01 ` [PATCH V13 33/51] drm/colorop: add BT2020/BT709 OETF and Inverse OETF Alex Hung
2025-11-15  0:01 ` [PATCH V13 34/51] drm/amd/display: Add support for BT.709 and BT.2020 TFs Alex Hung
2025-11-15  0:02 ` [PATCH V13 35/51] drm: Add Enhanced LUT precision structure Alex Hung
2025-11-15  0:02 ` [PATCH V13 36/51] drm: Add helper to extract lut from struct drm_color_lut32 Alex Hung
2025-11-15  0:02 ` [PATCH V13 37/51] drm/colorop: Add 1D Curve Custom LUT type Alex Hung
2025-11-15  0:02 ` [PATCH V13 38/51] drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT Alex Hung
2025-11-15  0:02 ` [PATCH V13 39/51] drm/amd/display: add 3x4 matrix colorop Alex Hung
2025-12-19 12:41   ` Tvrtko Ursulin
2025-12-19 13:10     ` Borah, Chaitanya Kumar
2025-11-15  0:02 ` [PATCH V13 40/51] drm/colorop: Add multiplier type Alex Hung
2025-11-15  0:02 ` [PATCH V13 41/51] drm/amd/display: add multiplier colorop Alex Hung
2025-11-15  0:02 ` [PATCH V13 42/51] drm/amd/display: Swap matrix and multiplier Alex Hung
2025-11-15  0:02 ` [PATCH V13 43/51] drm/colorop: Define LUT_1D interpolation Alex Hung
2025-11-15  0:02 ` [PATCH V13 44/51] drm/colorop: allow non-bypass colorops Alex Hung
2025-11-15  0:02 ` [PATCH V13 45/51] drm/colorop: Add 3D LUT support to color pipeline Alex Hung
2025-11-15  0:02 ` [PATCH V13 46/51] drm/amd/display: add 3D LUT colorop Alex Hung
2025-11-15  0:02 ` [PATCH V13 47/51] drm/amd/display: Add AMD color pipeline doc Alex Hung
2025-11-15  0:02 ` [PATCH V13 48/51] drm/amd/display: Ensure 3D LUT for color pipeline Alex Hung
2025-11-15  0:02 ` [PATCH V13 49/51] drm/amd/display: Disable CRTC degamma when color pipeline is enabled Alex Hung
2026-02-10 10:52   ` Michel Dänzer
2025-11-15  0:02 ` [PATCH V13 50/51] drm/colorop: Add DRM_COLOROP_1D_CURVE_GAMMA22 to 1D Curve Alex Hung
2025-11-15  0:02 ` [PATCH V13 51/51] drm/amd/display: Enable support for Gamma 2.2 Alex Hung
2025-11-20 20:11 ` [PATCH V13 00/51][FINAL] Color Pipeline API w/ VKMS Harry Wentland
2025-11-21  9:13   ` Louis Chauvet
2025-11-21 13:53     ` Harry Wentland
2025-11-24 14:59       ` Alex Deucher
2025-11-25 18:43       ` Harry Wentland
2025-11-26 10:53         ` Louis Chauvet
2025-11-26 15:20           ` Harry Wentland
2025-11-26 22:39             ` Simon Ser
2025-11-26 22:47               ` Harry Wentland
2025-11-26 22:38           ` Simon Ser
2025-11-26 22:46             ` Harry Wentland
2025-11-27  8:36             ` Louis Chauvet
2025-11-21 17:50   ` Xaver Hugl
2025-11-26 11:07   ` Daniel Stone
2025-11-26 22: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=083e313e-ab8b-4a38-b40d-9b416b8d162b@amd.com \
    --to=alex.hung@amd.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=agoins@nvidia.com \
    --cc=aleixpol@kde.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=ariel.dalessandro@collabora.com \
    --cc=arthurgrillo@riseup.net \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --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