dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Harry Wentland" <harry.wentland@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX
Date: Wed, 22 Jul 2026 13:55:11 +0000	[thread overview]
Message-ID: <20260722135512.124141F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722134607.136293-2-harry.wentland@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Validation check for a 64-bit bitmask on 32-bit platforms incorrectly uses the 32-bit `BIT()` macro, causing upper bits to be silently ignored.
--

--- Patch [1]: [PATCH v4 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX ---
commit e2a1cc91ee8bca2062d87fc6c62ee5b47046aaf8
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Subject: drm/colorop: Add DRM_COLOROP_FIXED_MATRIX

This commit introduces DRM_COLOROP_FIXED_MATRIX, a new colorop type
representing hardware that performs a fixed matrix operation. It adds a new
FIXED_MATRIX_TYPE enum property to select predefined hardware modes instead
of using programmable coefficients.

> diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
> index 682fcc6515259..e7ccf7d053b89 100644
> --- a/drivers/gpu/drm/drm_colorop.c
> +++ b/drivers/gpu/drm/drm_colorop.c
[ ... ]
> +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)
> +{
[ ... ]
> +	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]
Since supported_fm is a u64, will this check properly mask the upper 32 bits on
32-bit platforms where BIT() evaluates to a 32-bit unsigned long?

When -BIT(DRM_COLOROP_FM_COUNT) is promoted to 64 bits for the bitwise AND, it
will be zero-extended, causing the upper 32 bits of the mask to be zero. This
could allow invalid upper bits in supported_fm to pass validation silently.

Should this use BIT_ULL() instead?

> +		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/20260722134607.136293-1-harry.wentland@amd.com?part=1

  reply	other threads:[~2026-07-22 13:55 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 13:45 [PATCH v4 00/11] YUV conversion colorop with amdgpu and VKMS Harry Wentland
2026-07-22 13:45 ` [PATCH v4 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX Harry Wentland
2026-07-22 13:55   ` sashiko-bot [this message]
2026-07-25  6:02   ` Alex Hung
2026-07-28 15:02   ` Robert Mader
2026-07-28 16:00     ` Borah, Chaitanya Kumar
2026-07-30 14:27       ` Pekka Paalanen
2026-07-30 14:45         ` Borah, Chaitanya Kumar
2026-07-31 10:01         ` Robert Mader
2026-08-03  9:42           ` Borah, Chaitanya Kumar
2026-07-28 15:31   ` Robert Mader
2026-07-30 10:59   ` Pekka Paalanen
2026-07-30 20:27     ` Harry Wentland
2026-07-31  4:34       ` Borah, Chaitanya Kumar
2026-07-22 13:45 ` [PATCH v4 02/11] drm/vkms: Fix limited-range YCbCr to RGB conversion scaling Harry Wentland
2026-07-25  6:02   ` Alex Hung
2026-07-28 15:11   ` Robert Mader
2026-07-30 13:46   ` Pekka Paalanen
2026-07-31 15:30     ` Harry Wentland
2026-07-22 13:45 ` [PATCH v4 03/11] drm/vkms: Add KUnit test for YCbCr to RGB conversion matrices Harry Wentland
2026-07-22 14:01   ` sashiko-bot
2026-07-25  6:02   ` Alex Hung
2026-07-28 15:17   ` Robert Mader
2026-07-30 14:19     ` Pekka Paalanen
2026-07-31 15:32       ` Harry Wentland
2026-07-22 13:46 ` [PATCH v4 04/11] drm/vkms: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-22 13:46 ` [PATCH v4 05/11] drm/vkms: Add atomic check and matrix handling for fixed matrix colorop Harry Wentland
2026-07-22 13:59   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 06/11] drm/amd/display: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-22 14:03   ` sashiko-bot
2026-07-28 16:00   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 07/11] drm/amd/display: Implement fixed matrix colorop color space mapping Harry Wentland
2026-07-22 14:14   ` sashiko-bot
2026-07-28 16:01   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 08/11] drm/amd/display: Use GAMCOR for first TF if YUV conversion is needed Harry Wentland
2026-07-25  6:07   ` Alex Hung
2026-07-28 16:01   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 09/11] drm/amd/display: Check actual state during commit_tail Harry Wentland
2026-07-22 14:08   ` sashiko-bot
2026-07-28 16:02   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 10/11] drm/amd/display: Set color_space to plane_infos Harry Wentland
2026-07-22 14:13   ` sashiko-bot
2026-07-28 16:03   ` Robert Mader
2026-07-22 13:46 ` [PATCH v4 11/11] drm/amd/display: Force GAMCOR for subsampled surfaces with PQ/Gamma22/HLG Harry Wentland
2026-07-25  6:11   ` Alex Hung
2026-07-28 16:04   ` Robert Mader
2026-07-28 14:58 ` [PATCH v4 00/11] YUV conversion colorop with amdgpu and VKMS Robert Mader

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=20260722135512.124141F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.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