[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c393a1a-3ded-490c-a6f8-c120dfcf1188@collabora.com>
Date: Wed, 10 Dec 2025 18:15:20 -0300
From: Ariel D'Alessandro <ariel.dalessandro@...labora.com>
To: Louis Chauvet <louis.chauvet@...tlin.com>,
Nícolas F. R. A. Prado <nfraprado@...labora.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Melissa Wen <melissa.srw@...il.com>
Cc: Alex Hung <alex.hung@....com>, wayland-devel@...ts.freedesktop.org,
harry.wentland@....com, leo.liu@....com, ville.syrjala@...ux.intel.com,
pekka.paalanen@...labora.com, contact@...rsion.fr, mwen@...lia.com,
jadahl@...hat.com, sebastian.wick@...hat.com, shashank.sharma@....com,
agoins@...dia.com, joshua@...ggi.es, mdaenzer@...hat.com, aleixpol@....org,
xaver.hugl@...il.com, victoria@...tem76.com, uma.shankar@...el.com,
quic_naseer@...cinc.com, quic_cbraga@...cinc.com, quic_abhinavk@...cinc.com,
marcan@...can.st, Liviu.Dudau@....com, sashamcintosh@...gle.com,
chaitanya.kumar.borah@...el.com, mcanal@...lia.com, kernel@...labora.com,
daniels@...labora.com, leandro.ribeiro@...labora.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
Simona Vetter <simona.vetter@...ll.ch>
Subject: Re: [PATCH RFC v2 19/20] drm/vkms: Introduce support for post-blend
color pipeline
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@...labora.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@....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
Powered by blists - more mailing lists