All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hanson Wang <hanson.wang@ugreen.com>
Cc: intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com,
	rodrigo.vivi@intel.com, joonas.lahtinen@linux.intel.com,
	tursulin@ursulin.net, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/display: Refresh global state after non-atomic sanitization
Date: Thu, 26 Nov 2026 02:21:27 +0200	[thread overview]
Message-ID: <awd7hxapYj36Muid@intel.com> (raw)
In-Reply-To: <20261124142627.4082596-1-hanson.wang@ugreen.com>

On Tue, Nov 24, 2026 at 10:26:27PM +0800, Hanson Wang wrote:
> Hardware state readout accounts firmware planes in the global bandwidth
> state before sanitization. skl_dbuf_sanitize() may subsequently disable
> those planes through intel_plane_disable_noatomic(), which clears the
> CRTC-local plane data but leaves the global bandwidth entries unchanged.
> A later atomic check can see identical, already cleared old and new
> CRTC-local inputs and skip the global update. The stale data rate and
> plane count then remain part of the QGV bandwidth check.
> 
> The issue was reproduced on an N5105 system running mainline.
> After DBUF sanitization had cleared pipe B's local plane state,
> the global bandwidth state still accounted for 196000 kB/s and
> one plane.
> 
> Add intel_display_update_hw_state() to group the existing bandwidth,
> DBUF bandwidth and CDCLK state updates. Keep the initial update after
> hardware readout, and repeat it after intel_wm_sanitize(), once the
> non-atomic CRTC and plane sanitization is complete. Update DBUF bandwidth
> before CDCLK, which derives a minimum clock requirement from that state.
> 
> Also refresh the global state after intel_initial_plane_config(): failure
> to reconstruct a BIOS framebuffer can disable a primary plane after the
> main sanitization sequence has finished.
> 
> Reuse the existing accounting helpers so logically enabled but inactive
> CRTCs retain their memory bandwidth reservations.
> 
> Fixes: 15512021eb39 ("drm/i915: Workaround broken BIOS DBUF configuration on TGL/RKL")
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Link: https://lore.kernel.org/intel-gfx/20261118033312.902366-1-hanson.wang@ugreen.com
> Signed-off-by: Hanson Wang <hanson.wang@ugreen.com>

Patchwork looks to be hopelessly confused about this series.
Please resend this again, not as a reply-to. Maybe then
patchwork will pick it up correctly and we can get CI to
test it.

> ---
> Changes in v2:
> - Add intel_display_update_hw_state() as suggested by Ville, reusing
>   the existing BW, DBUF bandwidth and CDCLK update helpers.
> - Refresh global accounting after the complete modeset sanitization
>   sequence, including intel_wm_sanitize(), instead of adding per-CRTC
>   update helpers to intel_plane_disable_noatomic().
> - Also cover non-atomic plane disable on BIOS framebuffer takeover
>   failure in intel_initial_plane_config().
> - Preserve the initial readout update and the existing intermediate
>   CRTC-disable bookkeeping used during sanitization.
> - Add a Fixes tag for the DBUF sanitization path.
> 
> Testing:
> - W=1 compilation of both changed C files for i915 and Xe display.
> - Strict checkpatch passed.
> - Boot-tested v2 on an affected N5105 system with HDMI connected,
>   based on 666539eecdf4 (7.4.0-rc3+). The original DBUF sanitization
>   path was reproduced, and pipe B's global accounting changed from
>   196000 kB/s and one plane to 0 kB/s and zero planes after
>   intel_wm_sanitize().
> - Post-boot inspection confirmed that pipe B contributed no bandwidth
>   or planes to the global BW and DBUF bandwidth states. Subsequent
>   QGV checks no longer included the stale contribution.
> - This was a v1-to-v2 boot test, not an unpatched-versus-patched
>   comparison.
> - The original high-bandwidth workload, HDMI hotplug, suspend/resume,
>   cold boot, enabled-but-inactive transitions and BIOS framebuffer
>   reconstruction failure were not tested with v2.
> 
>  .../drm/i915/display/intel_initial_plane.c    |  4 ++++
>  .../drm/i915/display/intel_modeset_setup.c    | 24 ++++++++++++++++---
>  .../drm/i915/display/intel_modeset_setup.h    |  1 +
>  3 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_initial_plane.c b/drivers/gpu/drm/i915/display/intel_initial_plane.c
> index 7427f41e4d7e..022798baf7e0 100644
> --- a/drivers/gpu/drm/i915/display/intel_initial_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_initial_plane.c
> @@ -15,6 +15,7 @@
>  #include "intel_fb.h"
>  #include "intel_frontbuffer.h"
>  #include "intel_initial_plane.h"
> +#include "intel_modeset_setup.h"
>  #include "intel_parent.h"
>  #include "intel_plane.h"
>  
> @@ -237,4 +238,7 @@ void intel_initial_plane_config(struct intel_display *display)
>  
>  		plane_config_fini(display, plane_config);
>  	}
> +
> +	/* Failure to reconstruct the BIOS framebuffer may disable a plane. */
> +	intel_display_update_hw_state(display);
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> index 6aed88173770..bb8f3acd3595 100644
> --- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> +++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> @@ -14,6 +14,7 @@
>  #include "i9xx_wm.h"
>  #include "intel_atomic.h"
>  #include "intel_bw.h"
> +#include "intel_cdclk.h"
>  #include "intel_cmtg.h"
>  #include "intel_color.h"
>  #include "intel_crtc.h"
> @@ -37,6 +38,22 @@
>  #include "intel_wm.h"
>  #include "skl_watermark.h"
>  
> +/**
> + * intel_display_update_hw_state - synchronize global display accounting
> + * @display: display instance
> + *
> + * Update the global state from the current CRTC and plane state during
> + * hardware state setup, with atomic commits excluded. Call this again
> + * after non-atomic sanitization has changed the local state.
> + */
> +void intel_display_update_hw_state(struct intel_display *display)
> +{
> +	intel_bw_update_hw_state(display);
> +	/* CDCLK requirements depend on the DBUF bandwidth state. */
> +	intel_dbuf_bw_update_hw_state(display);
> +	intel_cdclk_update_hw_state(display);
> +}
> +
>  static void intel_crtc_disable_noatomic_begin(struct intel_crtc *crtc,
>  					      struct drm_modeset_acquire_ctx *ctx)
>  {
> @@ -877,9 +894,7 @@ static void intel_modeset_readout_hw_state(struct intel_display *display)
>  	if (DISPLAY_VER(display) >= 9)
>  		intel_wm_get_hw_state(display);
>  
> -	intel_bw_update_hw_state(display);
> -	intel_dbuf_bw_update_hw_state(display);
> -	intel_cdclk_update_hw_state(display);
> +	intel_display_update_hw_state(display);
>  
>  	intel_pmdemand_init_pmdemand_params(display, pmdemand_state);
>  }
> @@ -995,6 +1010,9 @@ void intel_modeset_setup_hw_state(struct intel_display *display,
>  		intel_wm_get_hw_state(display);
>  	intel_wm_sanitize(display);
>  
> +	/* Sanitization may have disabled planes without an atomic commit. */
> +	intel_display_update_hw_state(display);
> +
>  	for_each_intel_crtc(display, crtc) {
>  		struct intel_crtc_state *crtc_state =
>  			to_intel_crtc_state(crtc->base.state);
> diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.h b/drivers/gpu/drm/i915/display/intel_modeset_setup.h
> index f5e6f3ae9572..28a9165f7fca 100644
> --- a/drivers/gpu/drm/i915/display/intel_modeset_setup.h
> +++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.h
> @@ -9,6 +9,7 @@
>  struct drm_modeset_acquire_ctx;
>  struct intel_display;
>  
> +void intel_display_update_hw_state(struct intel_display *display);
>  void intel_modeset_setup_hw_state(struct intel_display *display,
>  				  struct drm_modeset_acquire_ctx *ctx);
>  
> 
> base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
> -- 
> 2.34.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-11-26  0:21 UTC|newest]

Thread overview: 10+ 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
2026-11-18 13:41   ` Hanson Wang
2026-11-18  4:03 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-11-18  4:38 ` [PATCH] " Ville Syrjälä
2026-11-18 15:22 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-11-24 14:26 ` [PATCH v2] drm/i915/display: Refresh global state after non-atomic sanitization Hanson Wang
2026-11-26  0:21   ` Ville Syrjälä [this message]
2026-11-25  1:34 ` ✗ LGCI.VerificationFailed: failure for drm/i915/bw: sync global BW after non-atomic plane disable (rev2) Patchwork
2026-11-25 15:22 ` 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=awd7hxapYj36Muid@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hanson.wang@ugreen.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tursulin@ursulin.net \
    /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.