All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hanson Wang" <hanson.wang@ugreen.com>, intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/bw: sync global BW after non-atomic plane disable
Date: Wed, 18 Nov 2026 04:00:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-220061@kernel.org> (raw)
In-Reply-To: <20261118033312.902366-1-hanson.wang@ugreen.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/display: stale cdclk state after
  intel_plane_disable_noatomic()
--

commit cc04b14ee64b615dd833441addacb0b2def5e98d
Author: Hanson Wang <hanson.wang@ugreen.com>

drm/i915/bw: sync global BW after non-atomic plane disable

This commit updates the global intel_bw_state and intel_dbuf_bw_state
when a plane is disabled via intel_plane_disable_noatomic() so that
subsequent atomic checks do not retain stale plane bandwidth accounting.

Link: https://lore.kernel.org/intel-gfx/20261016014704.3876294-1-hanson.wang@ugreen.com

> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f79caeb5a82ec..c5a043ade54ff 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c

[ ... ]

> @@ -679,6 +680,14 @@ void intel_plane_disable_noatomic(struct intel_crtc *crtc,
>  
>  	skl_wm_plane_disable_noatomic(crtc, plane);
>  
> +	/*
> +	 * Keep the global bandwidth states in sync with the updated
> +	 * CRTC-local plane and DDB state. Otherwise a later atomic check
> +	 * may skip the update when its old and new inputs are identical.
> +	 */
> +	intel_bw_crtc_update_noatomic(crtc);
> +	intel_dbuf_bw_crtc_update_noatomic(crtc);
> +
>  	if ((crtc_state->active_planes & ~BIT(PLANE_CURSOR)) == 0 &&
>  	    hsw_ips_disable(crtc_state)) {
>  		crtc_state->ips_enabled = false;

[Severity: Medium]
Does updating display->dbuf_bw.obj.state here without also updating
display->cdclk.obj.state and crtc_state->min_cdclk leave
cdclk_state->dbuf_bw_min_cdclk and cdclk_state->min_cdclk[pipe] stuck at
their pre-sanitization values?

During hardware readout, intel_cdclk_update_hw_state() caches
crtc_state->min_cdclk in cdclk_state->min_cdclk[pipe] and caches
intel_dbuf_bw_min_cdclk(display, dbuf_bw_state) in
cdclk_state->dbuf_bw_min_cdclk.  When skl_dbuf_sanitize() then disables
the plane through intel_plane_disable_noatomic(),
intel_dbuf_bw_crtc_update_noatomic() zeroes the pipe's entry in
dbuf_bw_state, so a subsequent atomic modeset on that pipe sees both
old_dbuf_bw and new_dbuf_bw as zero and skips
intel_cdclk_update_dbuf_bw_min_cdclk() in intel_dbuf_bw_calc_min_cdclk():

drivers/gpu/drm/i915/display/intel_dbuf_bw.c:intel_dbuf_bw_calc_min_cdclk() {
	...
	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state) {
		struct intel_dbuf_bw old_dbuf_bw, new_dbuf_bw;

		skl_crtc_calc_dbuf_bw(&old_dbuf_bw, old_crtc_state);
		skl_crtc_calc_dbuf_bw(&new_dbuf_bw, new_crtc_state);

		if (!intel_dbuf_bw_changed(display, &old_dbuf_bw, &new_dbuf_bw))
			continue;
	...
	if (!old_dbuf_bw_state)
		return 0;
}

Similarly, intel_plane_set_invisible() zeroes plane_min_cdclk[plane->id]
and hsw_ips_disable() clears ips_enabled without recomputing
crtc_state->min_cdclk or cdclk_state->min_cdclk[pipe];
intel_initial_commit() then updates crtc_state->min_cdclk while
allow_cdclk_decrease is false, so later modesets where min_cdclk does not
change return early in intel_cdclk_update_crtc_min_cdclk() on
new_min_cdclk == old_min_cdclk, keeping minimum CDCLK artificially
elevated.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118033312.902366-1-hanson.wang@ugreen.com?part=1

  reply	other threads:[~2026-11-18  4:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  3:33 [PATCH] drm/i915/bw: sync global BW after non-atomic plane disable Hanson Wang
2026-11-18  4:00 ` sashiko-bot [this message]
2026-11-18  4:03 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-11-18  4:38 ` [PATCH] " Ville Syrjälä

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-220061@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hanson.wang@ugreen.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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.