Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mario Limonciello (AMD)" <superm1@kernel.org>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v11 10/12] drm/gud: add connector luminance support
Date: Tue, 03 Nov 2026 22:59:21 +0000	[thread overview]
Message-ID: <sashiko-outbox-196165@kernel.org> (raw)
In-Reply-To: <20261103-superm1-backlight-property-v11-10-00cce7b2ba22@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/gud: LUMINANCE updates in gud_connector_atomic_check() require modeset
--

commit 8034990b85e36e57451a40c677e5ac4037438eda
Author: Mario Limonciello <mario.limonciello@amd.com>

drm/gud: add connector luminance support

This commit exposes GUD display brightness through the connector LUMINANCE
property when CONFIG_DRM_LUMINANCE is enabled, mirroring luminance changes
into tv.brightness during atomic check.

> diff --git a/drivers/gpu/drm/gud/gud_connector.c b/drivers/gpu/drm/gud/gud_connector.c
> index ddbf3b3ebbca8..bfb298bbc9b51 100644
> --- a/drivers/gpu/drm/gud/gud_connector.c
> +++ b/drivers/gpu/drm/gud/gud_connector.c
> @@ -292,10 +292,19 @@ static int gud_connector_atomic_check(struct drm_connector *connector,
>  	struct drm_connector_state *old_state;
>  
>  	new_state = drm_atomic_get_new_connector_state(state, connector);
> +	old_state = drm_atomic_get_old_connector_state(state, connector);
> +
> +	/*
> +	 * LUMINANCE is sent to the device as tv.brightness in the same commit,
> +	 * the brightness change below then triggers GUD_REQ_SET_STATE_CHECK.
> +	 */
> +	if (connector->luminance_property &&
> +	    old_state->luminance != new_state->luminance)
> +		new_state->tv.brightness = new_state->luminance;

[Severity: High]
Will mirroring new_state->luminance into new_state->tv.brightness here cause
non-modeset atomic commits that update LUMINANCE to fail with -EINVAL?

In gud_connector_atomic_check(), changing new_state->tv.brightness sets
new_crtc_state->connectors_changed:

	if (old_state->tv.margins.left != new_state->tv.margins.left ||
	    ...
	    old_state->tv.brightness != new_state->tv.brightness ||
	    ...)
		new_crtc_state->connectors_changed = true;

When a userspace compositor updates LUMINANCE in a normal atomic commit
without DRM_MODE_ATOMIC_ALLOW_MODESET:

drm_mode_atomic_ioctl()
  -> drm_atomic_check_only()
    -> drm_atomic_helper_check()
      -> drm_atomic_helper_check_modeset()
        -> gud_connector_atomic_check()
      -> drm_atomic_helper_check_planes()
        -> gud_plane_atomic_check()

gud_plane_atomic_check() sees crtc_state->connectors_changed and sends
GUD_REQ_SET_STATE_CHECK to the USB device, but drm_atomic_check_only() then
rejects the commit because drm_atomic_crtc_needs_modeset(new_crtc_state) is
true when connectors_changed is set:

	if (!state->allow_modeset) {
		for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
			if (drm_atomic_crtc_needs_modeset(new_crtc_state)) {
				drm_dbg_atomic(dev, "[CRTC:%d:%s] requires full modeset\n",
					       crtc->base.id, crtc->name);
				return -EINVAL;
			}
		}
	}

Even if DRM_MODE_ATOMIC_ALLOW_MODESET is passed, wouldn't setting
connectors_changed force a full CRTC modeset on every brightness adjustment?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-superm1-backlight-property-v11-0-00cce7b2ba22@kernel.org?part=10

  reply	other threads:[~2026-11-03 22:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 22:42 [PATCH v11 00/12] Add support for a DRM backlight capability Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 01/12] drm: add connector LUMINANCE property Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 02/12] drm/amd/display: Pass up errors reading actual brightness Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 03/12] drm/amdgpu: Check bios_scratch_reg_offset in backlight level helper Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 04/12] drm/amd: add luminance property support Mario Limonciello (AMD)
2026-11-03 23:13   ` sashiko-bot
2026-11-03 22:42 ` [PATCH v11 05/12] drm/i915/display: " Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 06/12] drm/bridge: add connector luminance operations Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 07/12] drm/panel: add connector luminance forwarding Mario Limonciello (AMD)
2026-11-03 22:55   ` sashiko-bot
2026-11-03 22:42 ` [PATCH v11 08/12] drm/bridge_connector: add luminance support Mario Limonciello (AMD)
2026-11-03 22:42 ` [PATCH v11 09/12] drm/nouveau: add connector " Mario Limonciello (AMD)
2026-11-03 23:09   ` sashiko-bot
2026-11-03 22:42 ` [PATCH v11 10/12] drm/gud: " Mario Limonciello (AMD)
2026-11-03 22:59   ` sashiko-bot [this message]
2026-11-03 22:42 ` [PATCH v11 11/12] drm/bridge: add PS8622 " Mario Limonciello (AMD)
2026-11-03 23:02   ` sashiko-bot
2026-11-03 22:42 ` [PATCH v11 12/12] drm/solomon: add SSD130x " Mario Limonciello (AMD)
2026-11-04 16:18 ` ✓ CI.KUnit: success for Add support for a DRM backlight capability Patchwork
2026-11-04 16:34 ` ✗ CI.checksparse: warning " Patchwork
2026-11-04 16:52 ` ✓ Xe.CI.BAT: success " 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=sashiko-outbox-196165@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=superm1@kernel.org \
    /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