From: sashiko-bot@kernel.org
To: "Austin Hu" <austin.hu@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 3/3] drm/i915/fbc: nuke CFB if Plane setting (except for surf addr) changes
Date: Fri, 25 Sep 2026 17:55:53 +0000 [thread overview]
Message-ID: <20260925175553.9ED1A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260925173658.1042048-4-austin.hu@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/i915/fbc: Severe performance regression due to overloaded FBC nuke checks
- [High] drm/i915/fbc: Missing state checks cause visual corruption with FBC dirty rect
--
commit 224f5233b9e570c9b8787cab16713f38059127bf
Author: Austin Hu <austin.hu@intel.com>
drm/i915/fbc: nuke CFB if Plane setting (except for surf addr) changes
When FBC Dirty Rectangle mode is enabled, any non-PLANE_SURF register update
requires fetching the full plane frame buffer from memory to re-compress and
update the CFB in stolen memory. This commit checks plane state attributes
during atomic commits and forces a full CFB nuke if any setting other than
the surface address changes.
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index 3915dea9edb1e..0d3b25e7a9fc1 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
[ ... ]
> @@ -1548,14 +1549,63 @@ static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state,
> intel_fbc_override_cfb_stride(new_plane_state))
> return false;
>
> + if (!HAS_FBC_DIRTY_RECT(display))
> + return true;
> +
> + /*
> + * From BSpec about "FBC Dirty Rectangle", when Dirty Rectangle mode is
> + * active, partial updates only apply to surface address changes. Any other
> + * plane state modification requires Plane to fetch full-plane pixel data
> + * from memory to re-compress and update the entire CFB in stolen memory.
> + * Once fully re-compressed, subsequent atomic commits go ahead with FBC
> + * dirty rectangle updates for smooth visual updates.
> + *
> + * So check other Plane attribute changed except for its surface address by
> + * referring to intel_async_flip_check_hw() which also checks async flip.
> + */
> +
> + /* Includes pixel_blend_mode, color_encoding & color_range checking. */
> + if (old_plane_state->color_ctl != new_plane_state->color_ctl)
> + return false;
[Severity: High]
Does this code miss checks for other plane properties, potentially causing
visual corruption?
The commit dictates that any non-PLANE_SURF register update requires a full CFB
nuke in FBC Dirty Rectangle mode. However, intel_fbc_can_flip_nuke() misses
checks for plane_state->ccval (Clear Color Value), plane_state->ctl (Plane
Control), and plane_state->scaler_id.
If an unprivileged DRM client updates these properties (e.g., changing the
clear color via fast clear), the function returns true, skipping the full
dirty rect expansion. The hardware would then fail to re-compress the new
pixel data, leaving artifacts on the display.
> +
> + if (!drm_rect_equals(&old_plane_state->uapi.src,
> + &new_plane_state->uapi.src) ||
> + !drm_rect_equals(&old_plane_state->uapi.dst,
> + &new_plane_state->uapi.dst))
> + return false;
[ ... ]
> @@ -1573,7 +1623,15 @@ __intel_fbc_prepare_dirty_rect(const struct intel_plane_state *plane_state,
> return;
> }
>
> - if (drm_rect_visible(damage)) {
> + if (!intel_fbc_can_flip_nuke(state, crtc, plane)) {
> + if (HAS_FBC_DIRTY_RECT(display))
> + drm_dbg_kms(display->drm,
> + "[PLANE:%d:%s] Non surf addr changed for FBC DIRTY RECT\n",
> + plane->base.base.id, plane->base.name);
> +
> + /* compress the entire region due to non PLANE_SURF updating. */
> + *fbc_dirty_rect = DRM_RECT_INIT(0, y_offset, width, height);
> + } else if (drm_rect_visible(damage)) {
[Severity: High]
Could reusing intel_fbc_can_flip_nuke() here cause a severe performance
degradation due to unnecessary vblank stalls during atomic plane updates?
When FBC Dirty Rect mode is enabled (Display Version 30+), changing plane
properties (like moving a window, modifying alpha, or color bounds) causes
intel_fbc_can_flip_nuke() to return false.
This will cause intel_fbc_deactivate() to be triggered in
__intel_fbc_pre_update() (which checks intel_fbc_can_flip_nuke()), which sets
need_vblank_wait = true.
It seems the dirty rect expansion is inadvertently coupled with the FBC
deactivation logic. This is reachable by any userspace application performing
non-surface address plane updates (like window dragging), leading to constant
vblank stalls and visual stuttering.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260925173658.1042048-1-austin.hu@intel.com?part=3
next prev parent reply other threads:[~2026-09-25 17:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 17:36 [PATCH v4 0/3] drm/i915/fbc: Dirty rectangle bounding and CFB Austin Hu
2026-09-25 17:36 ` [PATCH v4 1/3] drm/i915/display/fbc: Move intel_fbc_can_flip_nuke() higher up Austin Hu
2026-09-25 17:36 ` [PATCH v4 2/3] drm/i915/fbc: fbc_dirty_rect restrictions and logging Austin Hu
2026-09-25 17:52 ` sashiko-bot
2026-09-25 17:36 ` [PATCH v4 3/3] drm/i915/fbc: nuke CFB if Plane setting (except for surf addr) changes Austin Hu
2026-09-25 17:55 ` sashiko-bot [this message]
2026-09-25 19:00 ` ✓ CI.KUnit: success for drm/i915/fbc: Dirty rectangle bounding and CFB Patchwork
2026-09-25 19:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-26 4:54 ` ✗ Xe.CI.FULL: failure " 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=20260925175553.9ED1A1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=austin.hu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox