From: sashiko-bot@kernel.org
To: "Melissa Wen" <mwen@igalia.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 11/19] drm/colorop: Introduce colorop helpers for crtc
Date: Tue, 24 Nov 2026 18:36:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-231832@kernel.org> (raw)
In-Reply-To: <20261124181652.1333986-12-mwen@igalia.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] drm/colorop: missing @funcs doc in
drm_crtc_colorop_curve_1d_lut_init()
- [Low] drm/colorop: hardcoded PLANE log prefix in
drm_colorop_has_supported_tf()
It also noticed 1 related pre-existing issue this patch does not
introduce:
- [High] drm/colorop: missing error cleanup in drm_plane_colorop_init()
[1]
--
commit 31c092228a64133171c742733eb09f34d70d27f6
Author: Nícolas F. R. A. Prado <nfraprado@collabora.com>
drm/colorop: Introduce colorop helpers for crtc
This commit adds CRTC-based colorop initialization helpers for post-blend
1D curve, 1D LUT, and 3x4 CTM color pipelines.
> diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
> index baef70460da93..2f62050524b2c 100644
> --- a/drivers/gpu/drm/drm_colorop.c
> +++ b/drivers/gpu/drm/drm_colorop.c
[ ... ]
> @@ -313,6 +328,26 @@ int drm_plane_colorop_curve_1d_init(struct drm_device *dev,
> }
> EXPORT_SYMBOL(drm_plane_colorop_curve_1d_init);
>
> +int drm_crtc_colorop_curve_1d_init(struct drm_device *dev,
> + struct drm_colorop *colorop,
> + struct drm_crtc *crtc,
> + const struct drm_colorop_funcs *funcs,
> + u64 supported_tfs, uint32_t flags)
> +{
> + int ret;
> +
> + ret = drm_colorop_has_supported_tf(dev, &crtc->base, crtc->name, supported_tfs);
> + if (ret)
> + return ret;
[Severity: Low]
When drm_colorop_has_supported_tf() rejects supported_tfs here, does it
log the CRTC with a [PLANE:%d:%s] prefix? Both drm_err() messages in
drm_colorop_has_supported_tf() hardcode [PLANE:%d:%s].
> +
> + ret = drm_crtc_colorop_init(dev, colorop, crtc, funcs, DRM_COLOROP_1D_CURVE, flags);
> + if (ret)
> + return ret;
> +
> + return drm_common_colorop_curve_1d_init(dev, colorop, supported_tfs, flags);
> +}
> +EXPORT_SYMBOL(drm_crtc_colorop_curve_1d_init);
[Severity: High]
This problem wasn't introduced by this patch, but if property creation
fails in drm_common_colorop_init() or in a subtype helper such as
drm_common_colorop_curve_1d_init() [1], does it leave colorop
registered in dev->mode_config.object_idr and linked in
config->colorop_list with colorop->state still NULL?
drm_common_colorop_init() calls drm_mode_object_add() and adds
colorop->head to config->colorop_list before creating the base properties,
while colorop->state is only allocated at the end of the subtype helper by
drm_colorop_reset():
drivers/gpu/drm/drm_colorop.c:drm_common_colorop_init() {
ret = drm_mode_object_add(dev, &colorop->base, DRM_MODE_OBJECT_COLOROP);
if (ret)
return ret;
...
list_add_tail(&colorop->head, &config->colorop_list);
colorop->index = config->num_colorop++;
...
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;
}
If any property allocation fails, neither drm_common_colorop_init() nor
the subtype helpers unwind the registration, so querying the published
mode object via DRM_IOCTL_MODE_OBJ_GETPROPERTIES will hit a NULL pointer
dereference on colorop->state in drm_atomic_colorop_get_property().
> @@ -402,6 +437,37 @@ drm_plane_colorop_curve_1d_lut_init(struct drm_device *dev,
> }
> EXPORT_SYMBOL(drm_plane_colorop_curve_1d_lut_init);
>
> +/**
> + * drm_crtc_colorop_curve_1d_lut_init - Initialize a DRM_COLOROP_1D_LUT
> + *
> + * @dev: DRM device
> + * @colorop: The drm_colorop object to initialize
> + * @crtc: The associated drm_crtc
> + * @lut_size: LUT size supported by driver
> + * @interpolation: 1D LUT interpolation type
> + * @flags: bitmask of misc, see DRM_COLOROP_FLAG_* defines.
> + * @return zero on success, -E value on failure
> + */
> +int
> +drm_crtc_colorop_curve_1d_lut_init(struct drm_device *dev,
> + struct drm_colorop *colorop,
> + struct drm_crtc *crtc,
> + const struct drm_colorop_funcs *funcs,
[Severity: Low]
The kernel-doc comment for drm_crtc_colorop_curve_1d_lut_init() omits the
@funcs parameter description (and uses @return instead of Return:), which
triggers a scripts/kernel-doc warning when building documentation or with
W=1.
[1] https://sashiko.dev/#/bug/linux-e4f43398-10d0-4ccc-944b-469733dc5b85
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124181652.1333986-1-mwen@igalia.com?part=11
next prev parent reply other threads:[~2026-11-24 18:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 18:03 [PATCH v3 00/19] drm/drm_colorop: add post-blend colorop support to AMD display driver Melissa Wen
2026-11-24 18:03 ` [PATCH v3 01/19] drm/crtc: Add color pipeline to CRTC state Melissa Wen
2026-11-24 18:03 ` [PATCH v3 02/19] drm/colorop: Allow parenting colorop to CRTC Melissa Wen
2026-11-24 18:03 ` [PATCH v3 03/19] drm/atomic: handle CRTC colorops in drm_atomic_commit_set_colorop_state() Melissa Wen
2026-11-24 18:03 ` [PATCH v3 04/19] drm/atomic: duplicate CRTC colorop states Melissa Wen
2026-11-24 18:03 ` [PATCH v3 05/19] drm: Factor out common color_pipeline property initialization code Melissa Wen
2026-11-24 18:03 ` [PATCH v3 06/19] drm/crtc: Add COLOR_PIPELINE property Melissa Wen
2026-11-24 18:03 ` [PATCH v3 07/19] drm/atomic: track individual CRTC colorop updates Melissa Wen
2026-11-24 18:03 ` [PATCH v3 08/19] drm: Introduce DRM_CLIENT_CAP_CRTC_COLOR_PIPELINE Melissa Wen
2026-11-24 18:03 ` [PATCH v3 09/19] drm/atomic: Print the color pipeline as part of the CRTC state print Melissa Wen
2026-11-24 18:03 ` [PATCH v3 10/19] drm/colorop: Factor out common paths from colorops helpers Melissa Wen
2026-11-24 18:36 ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 11/19] drm/colorop: Introduce colorop helpers for crtc Melissa Wen
2026-11-24 18:36 ` sashiko-bot [this message]
2026-11-24 18:03 ` [PATCH v3 12/19] drm/colorop: distinguish whether a colorop belongs to a plane or a CRTC Melissa Wen
2026-11-24 18:03 ` [PATCH v3 13/19] drm/drm_mode_object: hide deprecated CRTC color mgmt props if colorop is set Melissa Wen
2026-11-24 18:03 ` [PATCH v3 14/19] drm/atomic: set hidden CRTC color mgmt model to default values Melissa Wen
2026-11-24 18:42 ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 15/19] drm/drm_ioctl: guard DRM_CLIENT_CAP_CRTC_COLOR_PIPELINE Melissa Wen
2026-11-24 18:03 ` [PATCH v3 16/19] drm/amd/display: move CRTC CTM color mgmt prop to check helper Melissa Wen
2026-11-24 18:03 ` [PATCH v3 17/19] drm/amd/display: enable post-blend CTM colorop Melissa Wen
2026-11-24 18:46 ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 18/19] drm/amd/display: add support to post-blend 1D-Curve colorop Melissa Wen
2026-11-24 18:42 ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 19/19] drm/amd/display: add support to post-blend 1D-LUT colorop Melissa Wen
2026-11-24 18:38 ` sashiko-bot
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-231832@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mwen@igalia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox