[PATCH v7 5/7] drm/i915/xe3: avoid calling fbc activate if fbc is active
Vinod Govindapillai
vinod.govindapillai at intel.com
Wed Feb 12 13:14:18 UTC 2025
If FBC is already active, we don't need to call FBC activate
routine again. This is more relevant in case of dirty rect
support in FBC. Xe doesn't support legacy fences. Hence fence
programming also not required as part of this fbc_hw_activate.
Any FBC related register updates done after enabling the dirty
rect support in xe3 will trigger nuke by FBC HW. So avoid
calling fbc activate routine again if the FBC is already active.
The front buffer rendering sequence will call intel_fbc_flush()
and which will call intel_fbc_nuke() or intel_fbc_activate()
based on FBC status explicitly and won't get impacted by this
change.
v2: use HAS_FBC_DIRTY_RECT()
move this functionality within intel_fbc_activate()
Signed-off-by: Vinod Govindapillai <vinod.govindapillai at intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index df05904bac8a..951dc81b7b97 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -739,8 +739,19 @@ static void intel_fbc_nuke(struct intel_fbc *fbc)
static void intel_fbc_activate(struct intel_fbc *fbc)
{
+ struct intel_display *display = fbc->display;
+
lockdep_assert_held(&fbc->lock);
+ /*
+ * When dirty rectangle is enabled, any updates to FBC registers will
+ * trigger nuke. So avoid calling intel_fbc_activate if fbc is already
+ * active and for XE3 cases. Xe doesn't support legacy fences. So
+ * no need to update the fences as well.
+ */
+ if (HAS_FBC_DIRTY_RECT(display) && fbc->active)
+ return;
+
intel_fbc_hw_activate(fbc);
intel_fbc_nuke(fbc);
--
2.43.0
More information about the dri-devel
mailing list