From: sashiko-bot@kernel.org
To: "Chaitanya Kumar Borah" <chaitanya.kumar.borah@intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [CI v4 01/14] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX
Date: Mon, 13 Jul 2026 05:48:42 +0000 [thread overview]
Message-ID: <20260713054843.5435A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260713051516.4087420-2-chaitanya.kumar.borah@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `u64 supported_fm` bitmask is incorrectly validated using the 32-bit `BIT()` macro, causing the validation to ignore invalid high bits on 32-bit systems.
--
--- Patch [1]: [CI v4 01/14] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX ---
commit c09a55528ad3801e2bc4cab04c676078a00cc4e2
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
drm/colorop: Add DRM_COLOROP_FIXED_MATRIX
Introduce DRM_COLOROP_FIXED_MATRIX, a new colorop type representing a
hardware that performs a fixed matrix operation. Userspace selects one of
the predefined hardware modes via a new FIXED_MATRIX_TYPE enum property.
> diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
> index 682fcc6515259..483defad699c0 100644
> --- a/drivers/gpu/drm/drm_colorop.c
> +++ b/drivers/gpu/drm/drm_colorop.c
[ ... ]
> @@ -453,6 +462,80 @@ int drm_plane_colorop_3dlut_init(struct drm_device *dev, struct drm_colorop *col
> }
> EXPORT_SYMBOL(drm_plane_colorop_3dlut_init);
>
> +/**
> + * drm_plane_colorop_fixed_matrix_init - Initialize a DRM_COLOROP_FIXED_MATRIX
> + *
> + * @dev: DRM device
> + * @colorop: The drm_colorop object to initialize
> + * @plane: The associated drm_plane
> + * @funcs: control functions for the new colorop
> + * @supported_fm: A bitfield of supported drm_colorop_fixed_matrix_type enum values,
> + * created using BIT(fixed_matrix_type) and combined with the OR '|'
> + * operator.
> + * @flags: bitmask of misc, see DRM_COLOROP_FLAG_* defines.
> + * @return zero on success, -E value on failure
> + */
> +int drm_plane_colorop_fixed_matrix_init(struct drm_device *dev, struct drm_colorop *colorop,
> + struct drm_plane *plane,
> + const struct drm_colorop_funcs *funcs,
> + u64 supported_fm, uint32_t flags)
> +{
> + struct drm_prop_enum_list enum_list[DRM_COLOROP_FM_COUNT];
> + int i, len;
> + struct drm_property *prop;
> + int ret;
> +
> + if (!supported_fm) {
> + drm_err(dev,
> + "No supported FM type op for new Fixed Matrix colorop on [PLANE:%d:%s]\n",
> + plane->base.id, plane->name);
> + return -EINVAL;
> + }
> +
> + if ((supported_fm & -BIT(DRM_COLOROP_FM_COUNT)) != 0) {
[Severity: Medium]
Will this check ignore invalid high bits in supported_fm on 32-bit systems?
Since supported_fm is a u64, using the 32-bit BIT() macro on a 32-bit
architecture means -BIT(DRM_COLOROP_FM_COUNT) will result in a 32-bit
unsigned long (e.g., 0xFFFFFFE0UL). When bitwise-ANDed with a u64, this mask
zero-extends to 0x00000000FFFFFFE0ULL, causing any invalid bits set in the
upper 32 bits to be silently ignored instead of returning -EINVAL.
Would it be safer to use BIT_ULL() or GENMASK_ULL() here?
> + drm_err(dev, "Unknown Fixed Matrix provided on [PLANE:%d:%s]\n",
> + plane->base.id, plane->name);
> + return -EINVAL;
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260713051516.4087420-1-chaitanya.kumar.borah@intel.com?part=1
next prev parent reply other threads:[~2026-07-13 5:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 5:15 [CI v4 00/14] drm/i915/color: Enable SDR plane color pipeline Chaitanya Kumar Borah
2026-07-13 5:15 ` [CI v4 01/14] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX Chaitanya Kumar Borah
2026-07-13 5:48 ` sashiko-bot [this message]
2026-07-13 5:15 ` [CI v4 02/14] drm/i915/color: Add CSC on SDR plane color pipeline Chaitanya Kumar Borah
2026-07-13 6:01 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 03/14] drm/i915/display: extract glk_plane_color_ctl_input_csc helper Chaitanya Kumar Borah
2026-07-13 5:15 ` [CI v4 04/14] drm/i915/display: simplify glk_plane_color_ctl_input_csc Chaitanya Kumar Borah
2026-07-13 5:15 ` [CI v4 05/14] drm/i915/display: Track CSC mode in intel plane state Chaitanya Kumar Borah
2026-07-13 5:59 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 06/14] drm/i915/display: Program input CSC on SDR planes Chaitanya Kumar Borah
2026-07-13 6:01 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 07/14] drm/i915/color: Add YCbCr limited-to-full range color block support Chaitanya Kumar Borah
2026-07-13 5:55 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 08/14] drm/i915/color: Add YUV range correction to SDR plane pipeline Chaitanya Kumar Borah
2026-07-13 5:55 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 09/14] drm/i915/color: Add support for 1D LUT in SDR planes Chaitanya Kumar Borah
2026-07-13 5:56 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 10/14] drm/i915/color: Extract HDR pre-CSC LUT programming to helper function Chaitanya Kumar Borah
2026-07-13 5:15 ` [CI v4 11/14] drm/i915/color: Program Pre-CSC registers for SDR Chaitanya Kumar Borah
2026-07-13 5:15 ` [CI v4 12/14] drm/i915/color: Extract HDR post-CSC LUT programming to helper function Chaitanya Kumar Borah
2026-07-13 5:15 ` [CI v4 13/14] drm/i915/color: Program Plane Post CSC registers for SDR planes Chaitanya Kumar Borah
2026-07-13 6:05 ` sashiko-bot
2026-07-13 5:15 ` [CI v4 14/14] drm/i915/color: Add color pipeline support " Chaitanya Kumar Borah
2026-07-13 5:59 ` sashiko-bot
2026-07-13 5:50 ` ✓ CI.KUnit: success for drm/i915/color: Enable SDR plane color pipeline (rev5) Patchwork
2026-07-13 6:34 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-13 6:51 ` ✓ i915.CI.BAT: " Patchwork
2026-07-13 8:29 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-13 10:24 ` ✗ i915.CI.Full: " Patchwork
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=20260713054843.5435A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=chaitanya.kumar.borah@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.