All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Louis Chauvet" <louis.chauvet@bootlin.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 21/38] drm/vkms: Introduce configfs for plane color range
Date: Sat, 27 Jun 2026 03:45:43 +0000	[thread overview]
Message-ID: <20260627034543.81FB11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260627-vkms-all-config-v5-21-854aa0840926@bootlin.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] ConfigFS store callbacks enforce base 10 parsing, which rejects documented hexadecimal bitmask inputs.
- [Low] kstrtouint() is called with an 'int *' instead of 'unsigned int *', generating an incompatible pointer type warning.
- [Low] ConfigFS 'show' callbacks omit a trailing newline.
--

commit 75e6ca29907842441c00bd1bce2c7956d8a33c79
Author: Louis Chauvet <louis.chauvet@bootlin.com>

drm/vkms: Introduce configfs for plane color range
    
To allows the userspace to test many hardware configuration, introduce a
new interface to configure the available color ranges per planes. VKMS
supports multiple color ranges, so the userspace can choose any
combination.

> diff --git a/Documentation/ABI/testing/configfs-vkms b/Documentation/ABI/testing/configfs-vkms
> index a9ee05fe0c66a..ef0c3da6b3ca1 100644
> --- a/Documentation/ABI/testing/configfs-vkms
> +++ b/Documentation/ABI/testing/configfs-vkms

[ ... ]

> @@ -132,6 +132,21 @@ Description:
>  	Default color encoding presented to userspace, same
>  	values as supported_color_encoding.
>  
> +What:		/sys/kernel/config/vkms/<device>/planes/<plane>/supported_color_ranges
> +Date:		Nov 2025
> +Contact:	dri-devel@lists.freedesktop.org
> +Description:
> +	Available color ranges for the plane, as a bitmask:
> +	0x1 - DRM_COLOR_YCBCR_LIMITED_RANGE,
> +	0x2 - DRM_COLOR_YCBCR_FULL_RANGE.
> +
> +What:		/sys/kernel/config/vkms/<device>/planes/<plane>/default_color_range
> +Date:		Nov 2025
> +Contact:	dri-devel@lists.freedesktop.org
> +Description:
> +	Default color range presented to userspace, same
> +	values as supported_color_ranges.
> +

[ ... ]

> diff --git a/drivers/gpu/drm/vkms/vkms_configfs.c b/drivers/gpu/drm/vkms/vkms_configfs.c
> index c1d1841b2c5a5..56a0c542a143f 100644
> --- a/drivers/gpu/drm/vkms/vkms_configfs.c
> +++ b/drivers/gpu/drm/vkms/vkms_configfs.c

[ ... ]

> @@ -410,6 +417,85 @@ static ssize_t plane_default_rotation_store(struct config_item *item,
>  	return count;
>  }
>  
> +static ssize_t plane_supported_color_ranges_show(struct config_item *item, char *page)
> +{
> +	struct vkms_configfs_plane *plane = plane_item_to_vkms_configfs_plane(item);
> +	unsigned int supported_color_ranges;
> +
> +	scoped_guard(mutex, &plane->dev->lock)
> +		supported_color_ranges = vkms_config_plane_get_supported_color_ranges(plane->config);
> +
> +	return sprintf(page, "%u", supported_color_ranges);

[Severity: Low]
Does this configfs show callback omit a trailing newline? Usually, configfs 
attributes include a newline in their format string for better readability 
with standard userspace tools.

> +}
> +
> +static ssize_t plane_supported_color_ranges_store(struct config_item *item,
> +						  const char *page, size_t count)
> +{
> +	struct vkms_configfs_plane *plane = plane_item_to_vkms_configfs_plane(item);
> +	int ret, val = 0;
> +
> +	ret = kstrtouint(page, 10, &val);

[Severity: Low]
Is this passing an int pointer to kstrtouint() instead of an unsigned int 
pointer? Will this mismatch generate a compiler warning about incompatible 
pointer types in plane_supported_color_ranges_store()?

[Severity: Medium]
Will this base 10 parsing reject the hexadecimal values documented in the ABI?
The documentation above suggests inputs like 0x1 and 0x2, but using base 10 
here will cause kstrtouint() to reject strings prefixed with 0x. Should this 
use base 0 instead?

> +	if (ret)
> +		return ret;
> +
> +	/* Should be a supported value */
> +	if (val & ~VKMS_SUPPORTED_COLOR_RANGES)
> +		return -EINVAL;
> +	/* Should at least provide one color range */
> +	if ((val & VKMS_SUPPORTED_COLOR_RANGES) == 0)
> +		return -EINVAL;
> +
> +	scoped_guard(mutex, &plane->dev->lock) {
> +		if (plane->dev->enabled)
> +			return -EBUSY;
> +
> +		vkms_config_plane_set_supported_color_ranges(plane->config, val);
> +	}
> +
> +	return count;
> +}
> +
> +static ssize_t plane_default_color_range_show(struct config_item *item, char *page)
> +{
> +	struct vkms_configfs_plane *plane = plane_item_to_vkms_configfs_plane(item);
> +	unsigned int default_color_range;
> +
> +	scoped_guard(mutex, &plane->dev->lock)
> +		default_color_range = vkms_config_plane_get_default_color_range(plane->config);
> +
> +	return sprintf(page, "%lu", BIT(default_color_range));

[Severity: Low]
Is it missing a newline character here as well?

> +}
> +
> +static ssize_t plane_default_color_range_store(struct config_item *item,
> +					       const char *page, size_t count)
> +{
> +	struct vkms_configfs_plane *plane = plane_item_to_vkms_configfs_plane(item);
> +	int ret, val = 0;
> +
> +	ret = kstrtouint(page, 10, &val);

[Severity: Low]
Does this code have the same pointer type mismatch issue as above in 
plane_default_color_range_store(), passing an int pointer to a function 
expecting an unsigned int pointer?

[Severity: Medium]
Also, does this base 10 parsing conflict with the hexadecimal inputs shown in
the ABI documentation?

> +	if (ret)
> +		return ret;
> +
> +	/* Should be a supported value */

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260627-vkms-all-config-v5-0-854aa0840926@bootlin.com?part=21

  reply	other threads:[~2026-06-27  3:45 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-27  3:30 [PATCH v5 00/38] VKMS: Introduce multiple configFS attributes Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 01/38] drm/drm_mode_config: Add helper to get plane type name Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 02/38] drm/blend: Get a rotation name from it's bitfield Louis Chauvet
2026-06-27  3:41   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 03/38] drm/drm_color_mgmt: Expose drm_get_color_encoding_name Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 04/38] drm/drm_color_mgmt: Expose drm_get_color_range_name Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 05/38] drm/connector: Export drm_get_colorspace_name Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 06/38] drm/drm_atomic_state_helper: Properly load default value for rotation Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 07/38] Documentation: ABI: vkms: Add current VKMS ABI documentation Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 08/38] drm/vkms: Add error handling in plane config creation Louis Chauvet
2026-06-27  3:41   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 09/38] drm/vkms: Simplify plane_release code Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 10/38] drm/vkms: Explicitly display plane type Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 11/38] drm/vkms: Use enabled/disabled instead of 1/0 for debug Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 12/38] drm/vkms: Explicitly display connector status Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 13/38] drm/vkms: Introduce config for plane name Louis Chauvet
2026-06-27  3:46   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 14/38] drm/vkms: Use plane folder name as " Louis Chauvet
2026-06-27  3:43   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 15/38] drm/vkms: Introduce config for plane rotation Louis Chauvet
2026-06-27  3:42   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 16/38] drm/vkms: Use DRM_ROTATION_FMT macros for rotation display Louis Chauvet
2026-06-27  3:39   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 17/38] drm/vkms: Introduce configfs for plane rotation Louis Chauvet
2026-06-27  3:46   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 18/38] drm/vkms: Introduce config for plane color encoding Louis Chauvet
2026-06-27  3:43   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 19/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:49   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 20/38] drm/vkms: Introduce config for plane color range Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 21/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:45   ` sashiko-bot [this message]
2026-06-27  3:30 ` [PATCH v5 22/38] drm/vkms: Introduce config for plane format Louis Chauvet
2026-06-27  3:46   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 23/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:45   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 24/38] drm/vkms: Properly render plane using their zpos Louis Chauvet
2026-06-27  3:44   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 25/38] drm/vkms: Introduce config for plane zpos property Louis Chauvet
2026-06-27  3:41   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 26/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:46   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 27/38] drm/vkms: Introduce config for connector type Louis Chauvet
2026-06-27  3:45   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 28/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:45   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 29/38] drm/vkms: Rename vkms_connector_init to vkms_connector_init_static Louis Chauvet
2026-06-27  3:30 ` [PATCH v5 30/38] drm/vkms: Introduce config for connector supported colorspace Louis Chauvet
2026-06-27  3:58   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 31/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:48   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 32/38] drm/vkms: Introduce config for connector EDID Louis Chauvet
2026-06-27  3:48   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 33/38] drm/vkms: Introduce configfs " Louis Chauvet
2026-06-27  3:50   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 34/38] drm/vkms: Store the enabled/disabled status for connector Louis Chauvet
2026-06-27  3:48   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 35/38] drm/vkms: Allow to hot-add connectors Louis Chauvet
2026-06-27  3:50   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 36/38] drm/vkms: Introduce configfs for dynamic connector creation Louis Chauvet
2026-06-27  3:55   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 37/38] drm/vkms: Add connector parent configuration in vkms_config Louis Chauvet
2026-06-27  3:57   ` sashiko-bot
2026-06-27  3:30 ` [PATCH v5 38/38] drm/vkms: Add ConfigFS interface for connector parent and port_id Louis Chauvet
2026-06-27  3:45   ` 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=20260627034543.81FB11F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=louis.chauvet@bootlin.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 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.