From: Austin Hu <austin.hu@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com,
vinod.govindapillai@intel.com, huchao426@gmail.com
Subject: [PATCH v3 1/3] drm/i915/display/fbc: Move intel_fbc_can_flip_nuke() higher up
Date: Wed, 23 Sep 2026 10:28:01 -0700 [thread overview]
Message-ID: <20260923172803.1011636-2-austin.hu@intel.com> (raw)
In-Reply-To: <20260812215350.3753102-1-austin.hu@intel.com>
Move intel_fbc_can_flip_nuke() above __intel_fbc_prepare_dirty_rect()
to allow its usage in FBC dirty rectangle checks without introducing a
forward declaration.
No functional change.
Signed-off-by: Austin Hu <austin.hu@intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 90 ++++++++++++------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 5694d20773f8..c6f9e6506f63 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -1506,6 +1506,51 @@ static bool intel_fbc_is_ok(const struct intel_plane_state *plane_state)
intel_fbc_is_cfb_ok(plane_state);
}
+static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state,
+ struct intel_crtc *crtc,
+ struct intel_plane *plane)
+{
+ const struct intel_crtc_state *new_crtc_state =
+ intel_atomic_get_new_crtc_state(state, crtc);
+ const struct intel_plane_state *old_plane_state =
+ intel_atomic_get_old_plane_state(state, plane);
+ const struct intel_plane_state *new_plane_state =
+ intel_atomic_get_new_plane_state(state, plane);
+ const struct drm_framebuffer *old_fb = old_plane_state->hw.fb;
+ const struct drm_framebuffer *new_fb = new_plane_state->hw.fb;
+
+ if (intel_crtc_needs_modeset(new_crtc_state))
+ return false;
+
+ if (!intel_fbc_is_ok(old_plane_state) ||
+ !intel_fbc_is_ok(new_plane_state))
+ return false;
+
+ if (old_fb->format->format != new_fb->format->format)
+ return false;
+
+ if (old_fb->modifier != new_fb->modifier)
+ return false;
+
+ if (intel_fbc_plane_stride(old_plane_state) !=
+ intel_fbc_plane_stride(new_plane_state))
+ return false;
+
+ if (intel_fbc_cfb_stride(old_plane_state) !=
+ intel_fbc_cfb_stride(new_plane_state))
+ return false;
+
+ if (intel_fbc_cfb_size(old_plane_state) !=
+ intel_fbc_cfb_size(new_plane_state))
+ return false;
+
+ if (intel_fbc_override_cfb_stride(old_plane_state) !=
+ intel_fbc_override_cfb_stride(new_plane_state))
+ return false;
+
+ return true;
+}
+
static void
__intel_fbc_prepare_dirty_rect(const struct intel_plane_state *plane_state,
const struct intel_crtc_state *crtc_state)
@@ -1755,51 +1800,6 @@ int intel_fbc_min_cdclk(const struct intel_crtc_state *crtc_state)
return min_cdclk;
}
-static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state,
- struct intel_crtc *crtc,
- struct intel_plane *plane)
-{
- const struct intel_crtc_state *new_crtc_state =
- intel_atomic_get_new_crtc_state(state, crtc);
- const struct intel_plane_state *old_plane_state =
- intel_atomic_get_old_plane_state(state, plane);
- const struct intel_plane_state *new_plane_state =
- intel_atomic_get_new_plane_state(state, plane);
- const struct drm_framebuffer *old_fb = old_plane_state->hw.fb;
- const struct drm_framebuffer *new_fb = new_plane_state->hw.fb;
-
- if (intel_crtc_needs_modeset(new_crtc_state))
- return false;
-
- if (!intel_fbc_is_ok(old_plane_state) ||
- !intel_fbc_is_ok(new_plane_state))
- return false;
-
- if (old_fb->format->format != new_fb->format->format)
- return false;
-
- if (old_fb->modifier != new_fb->modifier)
- return false;
-
- if (intel_fbc_plane_stride(old_plane_state) !=
- intel_fbc_plane_stride(new_plane_state))
- return false;
-
- if (intel_fbc_cfb_stride(old_plane_state) !=
- intel_fbc_cfb_stride(new_plane_state))
- return false;
-
- if (intel_fbc_cfb_size(old_plane_state) !=
- intel_fbc_cfb_size(new_plane_state))
- return false;
-
- if (intel_fbc_override_cfb_stride(old_plane_state) !=
- intel_fbc_override_cfb_stride(new_plane_state))
- return false;
-
- return true;
-}
-
static bool __intel_fbc_pre_update(struct intel_atomic_state *state,
struct intel_crtc *crtc,
struct intel_plane *plane)
--
2.34.1
next prev parent reply other threads:[~2026-09-23 17:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 21:53 [PATCH 0/2] drm/i915/fbc: Dirty rectangle bounds enforcement and CFB nuke handling Austin Hu
2026-08-12 21:53 ` [PATCH 1/2] drm/i915/fbc: fbc_dirty_rect restrictions and logging Austin Hu
2026-08-12 22:08 ` sashiko-bot
2026-08-12 21:53 ` [PATCH 2/2] drm/i915/fbc: nuke CFB if Plane setting (except for surf addr) changes Austin Hu
2026-08-12 22:10 ` sashiko-bot
2026-08-12 22:57 ` ✗ i915.CI.BAT: failure for drm/i915/fbc: Dirty rectangle bounds enforcement and CFB nuke handling Patchwork
2026-08-25 16:56 ` [PATCH v2 0/2] drm/i915/fbc: Dirty rectangle bounding " Austin Hu
2026-08-25 16:56 ` [PATCH v2 1/2] drm/i915/fbc: fbc_dirty_rect restrictions and logging Austin Hu
2026-08-25 17:16 ` sashiko-bot
2026-08-25 16:56 ` [PATCH v2 2/2] drm/i915/fbc: nuke CFB if Plane setting (except for surf addr) changes Austin Hu
2026-08-25 17:13 ` sashiko-bot
2026-09-07 11:28 ` Jani Nikula
2026-09-23 17:28 ` [PATCH v3 0/3] drm/i915/fbc: Dirty rectangle bounding and CFB Austin Hu
2026-09-24 11:25 ` Jani Nikula
2026-09-25 21:59 ` Hu, Austin
2026-09-23 17:28 ` Austin Hu [this message]
2026-09-23 17:28 ` [PATCH v3 2/3] drm/i915/fbc: fbc_dirty_rect restrictions and logging Austin Hu
2026-09-23 17:44 ` sashiko-bot
2026-09-23 17:28 ` [PATCH v3 3/3] drm/i915/fbc: nuke CFB if Plane setting (except for surf addr) changes Austin Hu
2026-09-23 17:45 ` sashiko-bot
2026-09-24 0:56 ` ✗ Fi.CI.BUILD: failure for drm/i915/fbc: Dirty rectangle bounds enforcement and CFB nuke handling 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=20260923172803.1011636-2-austin.hu@intel.com \
--to=austin.hu@intel.com \
--cc=huchao426@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=ville.syrjala@linux.intel.com \
--cc=vinod.govindapillai@intel.com \
/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