All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/2] drm/connector: Introduce "min bpc" connector property
Date: Wed, 29 Jul 2026 12:25:33 +0000	[thread overview]
Message-ID: <20260729122533.A99081F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260729-min-bpc-v2-1-7d0036ef437c@collabora.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing generic bounds validation for `min_requested_bpc` against `max_bpc` in core DRM atomic check.
- [Low] The newly introduced 'min_requested_bpc' field is not printed in debugfs atomic state dumps.
--

--- Patch [1]: [PATCH v2 1/2] drm/connector: Introduce "min bpc" connector property ---
commit c6fed32ee27d744d2ae9e2fb7635ec916f3ea61f
Author: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

    drm/connector: Introduce "min bpc" connector property
    
    Add a new KMS connector property called "min bpc". Its purpose is to
    allow userspace to mandate that the output bit depth ends up greater
    than or equal to a specified depth, or else have the commit fail. This
    is useful for checking for output depth degradation in combination with
    atomic test commits.

> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index a0cf0268de483..35f395d46f6b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1267,6 +1267,11 @@ struct drm_connector_state {
>  	 */
>  	u8 max_requested_bpc;
>  
> +	/**
> +	 * @min_requested_bpc: Minimum output bit depth requested by userspace
> +	 */
> +	u8 min_requested_bpc;
> +

[Severity: Low]
Does this omit printing the newly added min_requested_bpc?

When a developer or user reads /sys/kernel/debug/dri/*/state to inspect the
atomic KMS configuration, drm_atomic_connector_print_state() in
drivers/gpu/drm/drm_atomic.c prints max_requested_bpc but doesn't seem to
print min_requested_bpc, which could lead to incomplete state dumps.

[Severity: Medium]
Does the DRM core need to validate that min_requested_bpc <= max_bpc?

The core drm_atomic_connector_check() function in drivers/gpu/drm/drm_atomic.c
calculates state->max_bpc but doesn't verify that
state->min_requested_bpc <= state->max_bpc. 

If userspace sets the "min bpc" property to a value higher than max_bpc and
issues an atomic commit, this impossible constraint isn't rejected by the DRM
core.

This forces every driver implementing this property to manually check for this
contradiction. If a driver fails to do so, it may silently configure a bit
depth lower than min_requested_bpc, violating the explicit uAPI contract
that the commit must fail if the minimum bit depth cannot be met.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260729-min-bpc-v2-0-7d0036ef437c@collabora.com?part=1

  reply	other threads:[~2026-07-29 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 12:13 [PATCH v2 0/2] Add a "min bpc" connector property Nicolas Frattaroli
2026-07-29 12:13 ` [PATCH v2 1/2] drm/connector: Introduce " Nicolas Frattaroli
2026-07-29 12:25   ` sashiko-bot [this message]
2026-07-29 12:13 ` [PATCH v2 2/2] drm/connector: hdmi: Implement "min bpc" property Nicolas Frattaroli
2026-07-29 12:23   ` 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=20260729122533.A99081F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nicolas.frattaroli@collabora.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.