[RFC PATCH 20/22] drm/i915/fbc: Remove frontbuffer bits from flush callback
Jouni Högander
jouni.hogander at intel.com
Mon Mar 27 12:37:30 UTC 2023
We are following new strategy to rely purely on dirtyfb callback. FBC
was using frontbuffer bits to keep track of update between
invalidates and flush. Now as we have only flush we can remove
frontbuffer bits track keeping from FBC.
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 33 +++----------------
drivers/gpu/drm/i915/display/intel_fbc.h | 3 +-
.../gpu/drm/i915/display/intel_frontbuffer.c | 2 +-
3 files changed, 7 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 02ced74a0c51..788127720c85 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -91,7 +91,6 @@ struct intel_fbc {
* with stolen_lock.
*/
struct mutex lock;
- unsigned int busy_bits;
struct drm_mm_node compressed_fb;
struct drm_mm_node compressed_llb;
@@ -1290,7 +1289,6 @@ static void __intel_fbc_disable(struct intel_fbc *fbc)
fbc->state.plane = NULL;
fbc->flip_pending = false;
- fbc->busy_bits = 0;
}
static void __intel_fbc_post_update(struct intel_fbc *fbc)
@@ -1299,10 +1297,7 @@ static void __intel_fbc_post_update(struct intel_fbc *fbc)
fbc->flip_pending = false;
- if (!fbc->busy_bits)
- intel_fbc_activate(fbc);
- else
- intel_fbc_deactivate(fbc, "frontbuffer write");
+ intel_fbc_activate(fbc);
}
void intel_fbc_post_update(struct intel_atomic_state *state,
@@ -1327,45 +1322,27 @@ void intel_fbc_post_update(struct intel_atomic_state *state,
}
}
-static unsigned int intel_fbc_get_frontbuffer_bit(struct intel_fbc *fbc)
-{
- if (fbc->state.plane)
- return fbc->state.plane->frontbuffer_bit;
- else
- return 0;
-}
-
-static void __intel_fbc_flush(struct intel_fbc *fbc,
- unsigned int frontbuffer_bits)
+static void __intel_fbc_flush(struct intel_fbc *fbc)
{
mutex_lock(&fbc->lock);
- frontbuffer_bits &= intel_fbc_get_frontbuffer_bit(fbc);
- if (!frontbuffer_bits)
- goto out;
-
- fbc->busy_bits &= ~frontbuffer_bits;
-
- if (fbc->busy_bits || fbc->flip_pending)
+ if (fbc->flip_pending)
goto out;
if (fbc->active)
intel_fbc_nuke(fbc);
- else
- intel_fbc_activate(fbc);
out:
mutex_unlock(&fbc->lock);
}
-void intel_fbc_flush(struct drm_i915_private *i915,
- unsigned int frontbuffer_bits)
+void intel_fbc_flush(struct drm_i915_private *i915)
{
struct intel_fbc *fbc;
enum intel_fbc_id fbc_id;
for_each_intel_fbc(i915, fbc, fbc_id)
- __intel_fbc_flush(fbc, frontbuffer_bits);
+ __intel_fbc_flush(fbc);
}
int intel_fbc_atomic_check(struct intel_atomic_state *state)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.h b/drivers/gpu/drm/i915/display/intel_fbc.h
index ba2e10fb82ba..330e3b246abb 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.h
+++ b/drivers/gpu/drm/i915/display/intel_fbc.h
@@ -38,8 +38,7 @@ void intel_fbc_disable(struct intel_crtc *crtc);
void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
unsigned int frontbuffer_bits,
enum fb_op_origin origin);
-void intel_fbc_flush(struct drm_i915_private *dev_priv,
- unsigned int frontbuffer_bits);
+void intel_fbc_flush(struct drm_i915_private *dev_priv);
void intel_fbc_add_plane(struct intel_fbc *fbc, struct intel_plane *plane);
void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *i915);
void intel_fbc_reset_underrun(struct drm_i915_private *i915);
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index 36b867b938a4..f160e64274cc 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -86,7 +86,7 @@ void frontbuffer_flush(struct drm_i915_private *i915,
might_sleep();
intel_drrs_flush(i915, frontbuffer_bits);
intel_psr_flush(i915);
- intel_fbc_flush(i915, frontbuffer_bits);
+ intel_fbc_flush(i915);
}
/**
--
2.34.1
More information about the Intel-gfx-trybot
mailing list