From: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
To: "Louis Chauvet" <louis.chauvet@bootlin.com>,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Melissa Wen" <melissa.srw@gmail.com>
Cc: Alex Hung <alex.hung@amd.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, 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,
mcanal@igalia.com, kernel@collabora.com, daniels@collabora.com,
leandro.ribeiro@collabora.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
Simona Vetter <simona.vetter@ffwll.ch>
Subject: Re: [PATCH RFC v2 19/20] drm/vkms: Introduce support for post-blend color pipeline
Date: Wed, 10 Dec 2025 18:15:20 -0300 [thread overview]
Message-ID: <4c393a1a-3ded-490c-a6f8-c120dfcf1188@collabora.com> (raw)
In-Reply-To: <951318ca-f43a-48d7-a419-3bd89d135248@bootlin.com>
Louis,
On 9/19/25 9:50 AM, Louis Chauvet wrote:
>
>
> Le 18/09/2025 à 02:43, Nícolas F. R. A. Prado a écrit :
>> Introduce a post-blend color pipeline with the same colorop blocks as
>> the pre-blend color pipeline.
>>
>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>> ---
>> drivers/gpu/drm/vkms/vkms_colorop.c | 98 ++++++++++++++++++++++++++
>> ++++++++++
>> drivers/gpu/drm/vkms/vkms_composer.c | 5 +-
>> drivers/gpu/drm/vkms/vkms_crtc.c | 1 +
>> drivers/gpu/drm/vkms/vkms_drv.h | 1 +
>> 4 files changed, 104 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/vkms/vkms_colorop.c b/drivers/gpu/drm/
>> vkms/vkms_colorop.c
>> index
>> 5924ae2bd40fc904048f99bc9b96308140709e25..54c512db68eef16435d5f79453784f7784d540fb 100644
>> --- a/drivers/gpu/drm/vkms/vkms_colorop.c
>> +++ b/drivers/gpu/drm/vkms/vkms_colorop.c
>> @@ -98,6 +98,86 @@ vkms_initialize_pre_blend_color_pipeline(struct
>> drm_plane *plane,
>> return ret;
>> }
>> +static int
>> +vkms_initialize_post_blend_color_pipeline(struct drm_crtc *crtc,
>> + struct drm_prop_enum_list *list)
>> +{
>> + struct drm_colorop *ops[MAX_COLOR_PIPELINE_OPS];
>> + struct drm_device *dev = crtc->dev;
>> + int ret;
>> + int i = 0;
>> +
>> + memset(ops, 0, sizeof(ops));
>> +
>> + /* 1st op: 1d curve */
>> + ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL);
>> + if (!ops[i]) {
>> + ret = -ENOMEM;
>> + goto cleanup;
>> + }
>> +
>> + ret = drm_crtc_colorop_curve_1d_init(dev, ops[i], crtc,
>> supported_tfs,
>> + DRM_COLOROP_FLAG_ALLOW_BYPASS);
>> + if (ret)
>> + goto cleanup;
>> +
>> + list->type = ops[i]->base.id;
>> + list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", ops[i]-
>> >base.id);
>> +
>> + i++;
>> +
>> + /* 2nd op: 3x4 matrix */
>> + ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL);
>> + if (!ops[i]) {
>> + ret = -ENOMEM;
>> + goto cleanup;
>> + }
>> +
>> + ret = drm_crtc_colorop_ctm_3x4_init(dev, ops[i], crtc,
>> DRM_COLOROP_FLAG_ALLOW_BYPASS);
>> + if (ret)
>> + goto cleanup;
>> +
>> + drm_colorop_set_next_property(ops[i - 1], ops[i]);
>> +
>> + i++;
>> +
>> + /* 3rd op: 3x4 matrix */
>> + ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL);
>> + if (!ops[i]) {
>> + ret = -ENOMEM;
>> + goto cleanup;
>> + }
>> +
>> + ret = drm_crtc_colorop_ctm_3x4_init(dev, ops[i], crtc,
>> DRM_COLOROP_FLAG_ALLOW_BYPASS);
>> + if (ret)
>> + goto cleanup;
>> +
>> + drm_colorop_set_next_property(ops[i - 1], ops[i]);
>> +
>> + i++;
>> +
>> + /* 4th op: 1d curve */
>> + ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL);
>> + if (!ops[i]) {
>> + ret = -ENOMEM;
>> + goto cleanup;
>> + }
>> +
>> + ret = drm_crtc_colorop_curve_1d_init(dev, ops[i], crtc,
>> supported_tfs,
>> + DRM_COLOROP_FLAG_ALLOW_BYPASS);
>> + if (ret)
>> + goto cleanup;
>> +
>> + drm_colorop_set_next_property(ops[i - 1], ops[i]);
>> +
>> + return 0;
>> +
>> +cleanup:
>> + drm_colorop_pipeline_destroy(dev);
>
> Same comment as for pre_blend colorops, it feel strange to destroy all
> the pipelines here.
>
> The suggestion in [1] is better (don't forget to add the kfree).
>
> [1]: https://lore.kernel.org/all/73f01810-df2d-4e39-a20b-
> fc1cec2c5e12@amd.com/
Ack, will be addressed in v3.
Regards,
--
Ariel D'Alessandro
Software Engineer
Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718
next prev parent reply other threads:[~2025-12-10 21:16 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 0:43 [PATCH RFC v2 00/20] Introduce support for post-blend color pipeline Nícolas F. R. A. Prado
2025-09-18 0:43 ` [PATCH RFC v2 01/20] drm/crtc: Add color pipeline to CRTC state Nícolas F. R. A. Prado
2025-09-19 12:45 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 02/20] drm/colorop: Allow parenting colorop to CRTC Nícolas F. R. A. Prado
2025-09-19 12:44 ` Louis Chauvet
2025-12-10 20:49 ` Ariel D'Alessandro
2025-09-18 0:43 ` [PATCH RFC v2 03/20] drm: Factor out common color_pipeline property initialization code Nícolas F. R. A. Prado
2025-09-19 12:43 ` Louis Chauvet
2025-09-29 8:53 ` Harry Wentland
2025-12-10 20:19 ` Ariel D'Alessandro
2025-09-18 0:43 ` [PATCH RFC v2 04/20] drm/crtc: Add COLOR_PIPELINE property Nícolas F. R. A. Prado
2025-09-19 12:43 ` Louis Chauvet
2025-12-10 21:00 ` Ariel D'Alessandro
2025-09-18 0:43 ` [PATCH RFC v2 05/20] drm: Introduce DRM_CAP_POST_BLEND_COLOR_PIPELINE Nícolas F. R. A. Prado
2025-09-19 12:42 ` Louis Chauvet
2025-09-29 9:40 ` Harry Wentland
2025-09-29 16:00 ` Nícolas F. R. A. Prado
2025-09-18 0:43 ` [PATCH RFC v2 06/20] drm: Introduce DRM_CLIENT_CAP_POST_BLEND_COLOR_PIPELINE Nícolas F. R. A. Prado
2025-09-19 12:42 ` Louis Chauvet
2025-09-29 9:48 ` Harry Wentland
2025-12-11 15:26 ` Ariel D'Alessandro
2025-09-18 0:43 ` [PATCH RFC v2 07/20] drm/atomic: Pass post_blend_color_pipeline client cap to atomic check Nícolas F. R. A. Prado
2025-09-19 12:41 ` Louis Chauvet
2025-09-29 9:50 ` Harry Wentland
2025-12-11 15:16 ` Ariel D'Alessandro
2025-09-18 0:43 ` [PATCH RFC v2 08/20] drm/atomic: Print the color pipeline as part of the CRTC state print Nícolas F. R. A. Prado
2025-09-19 12:50 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 09/20] drm/colorop: Factor out common paths from colorops helpers Nícolas F. R. A. Prado
2025-09-19 12:51 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 10/20] drm/colorop: Introduce colorop helpers for crtc Nícolas F. R. A. Prado
2025-09-19 12:44 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 11/20] drm/colorop: Export drm_colorop_cleanup() so drivers can extend it Nícolas F. R. A. Prado
2025-09-18 0:43 ` [PATCH RFC v2 12/20] drm/crtc: Track post-blend color pipeline client cap in drm_crtc_state Nícolas F. R. A. Prado
2025-09-19 12:51 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 13/20] drm/mediatek: Support post-blend colorops for gamma and ctm Nícolas F. R. A. Prado
2025-09-18 0:43 ` [PATCH RFC v2 14/20] drm/mediatek: ccorr: Support post-blend color pipeline API Nícolas F. R. A. Prado
2025-09-18 0:43 ` [PATCH RFC v2 15/20] drm/mediatek: gamma: " Nícolas F. R. A. Prado
2025-09-18 0:43 ` [PATCH RFC v2 16/20] drm/mediatek: Set post-blend color pipeline driver cap Nícolas F. R. A. Prado
2025-09-19 12:50 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 17/20] drm/vkms: Rename existing color pipeline helpers to contain "pre_blend" Nícolas F. R. A. Prado
2025-09-19 12:45 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 18/20] drm/vkms: Prepare pre_blend_color_transform() for post-blend pipelines Nícolas F. R. A. Prado
2025-09-19 12:48 ` Louis Chauvet
2025-09-18 0:43 ` [PATCH RFC v2 19/20] drm/vkms: Introduce support for post-blend color pipeline Nícolas F. R. A. Prado
2025-09-19 12:50 ` Louis Chauvet
2025-12-10 21:15 ` Ariel D'Alessandro [this message]
2025-09-18 0:43 ` [PATCH RFC v2 20/20] drm/vkms: Set post-blend color pipeline driver cap Nícolas F. R. A. Prado
2025-09-19 12:49 ` Louis Chauvet
2025-09-29 10:22 ` [PATCH RFC v2 00/20] Introduce support for post-blend color pipeline Harry Wentland
2025-09-29 12:05 ` Melissa Wen
2025-09-29 14:25 ` 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=4c393a1a-3ded-490c-a6f8-c120dfcf1188@collabora.com \
--to=ariel.dalessandro@collabora.com \
--cc=Liviu.Dudau@arm.com \
--cc=agoins@nvidia.com \
--cc=airlied@gmail.com \
--cc=aleixpol@kde.org \
--cc=alex.hung@amd.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=chunkuang.hu@kernel.org \
--cc=contact@emersion.fr \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=harry.wentland@amd.com \
--cc=jadahl@redhat.com \
--cc=joshua@froggi.es \
--cc=kernel@collabora.com \
--cc=leandro.ribeiro@collabora.com \
--cc=leo.liu@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marcan@marcan.st \
--cc=matthias.bgg@gmail.com \
--cc=mcanal@igalia.com \
--cc=mdaenzer@redhat.com \
--cc=melissa.srw@gmail.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=nfraprado@collabora.com \
--cc=p.zabel@pengutronix.de \
--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=simona.vetter@ffwll.ch \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--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