[RFC PATCH 09/22] drm/i915/display: Add a new frontbuffer tracking interface for intel_overlay

Jouni Högander jouni.hogander at intel.com
Fri Mar 24 08:07:29 UTC 2023


Intel_overlay doesn't know anything about intel_framebuffer. Add a new
interface for intel_overlay which takes frontbuffer bits
directly. Also drop __intel_fb_flush as unneeded.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 .../gpu/drm/i915/display/intel_frontbuffer.c  | 28 +------------------
 .../gpu/drm/i915/display/intel_frontbuffer.h  | 11 +++++---
 2 files changed, 8 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index 2031daa24e79..83507bdef382 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -76,18 +76,10 @@
  *
  * Can be called without any locks held.
  */
-static void frontbuffer_flush(struct drm_i915_private *i915,
+void frontbuffer_flush(struct drm_i915_private *i915,
 			      unsigned int frontbuffer_bits,
 			      enum fb_op_origin origin)
 {
-	/* Delay flushing when rings are still busy.*/
-	spin_lock(&i915->display.fb_tracking.lock);
-	frontbuffer_bits &= ~i915->display.fb_tracking.busy_bits;
-	spin_unlock(&i915->display.fb_tracking.lock);
-
-	if (!frontbuffer_bits)
-		return;
-
 	trace_intel_frontbuffer_flush(i915, frontbuffer_bits, origin);
 
 	might_sleep();
@@ -163,24 +155,6 @@ void intel_frontbuffer_flip(struct drm_i915_private *i915,
 	frontbuffer_flush(i915, frontbuffer_bits, ORIGIN_FLIP);
 }
 
-void __intel_fb_flush(struct intel_framebuffer *fb,
-		      enum fb_op_origin origin,
-		      unsigned int frontbuffer_bits)
-{
-	struct drm_i915_private *i915 = to_i915(fb->base.dev);
-
-	if (origin == ORIGIN_CS) {
-		spin_lock(&i915->display.fb_tracking.lock);
-		/* Filter out new bits since rendering started. */
-		frontbuffer_bits &= i915->display.fb_tracking.busy_bits;
-		i915->display.fb_tracking.busy_bits &= ~frontbuffer_bits;
-		spin_unlock(&i915->display.fb_tracking.lock);
-	}
-
-	if (frontbuffer_bits)
-		frontbuffer_flush(i915, frontbuffer_bits, origin);
-}
-
 /**
  * intel_frontbuffer_track - update frontbuffer tracking
  * @old: current buffer for the frontbuffer slots
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.h b/drivers/gpu/drm/i915/display/intel_frontbuffer.h
index 9aebd7b8e0cf..4bfc7f9c54d1 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.h
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.h
@@ -64,9 +64,9 @@ void intel_frontbuffer_flip_complete(struct drm_i915_private *i915,
 void intel_frontbuffer_flip(struct drm_i915_private *i915,
 			    unsigned frontbuffer_bits);
 
-void __intel_fb_flush(struct intel_framebuffer *fb,
-		      enum fb_op_origin origin,
-		      unsigned int frontbuffer_bits);
+void frontbuffer_flush(struct drm_i915_private *i915,
+			      unsigned int frontbuffer_bits,
+		       enum fb_op_origin origin);
 
 /**
  * intel_frontbuffer_flush - flush frontbuffer object
@@ -79,16 +79,19 @@ void __intel_fb_flush(struct intel_framebuffer *fb,
 static inline void intel_frontbuffer_flush(struct intel_framebuffer *fb,
 					   enum fb_op_origin origin)
 {
+	struct drm_i915_private *i915;
 	unsigned int frontbuffer_bits;
 
 	if (!fb)
 		return;
 
+	i915 = to_i915(fb->base.dev);
+
 	frontbuffer_bits = atomic_read(&fb->bits);
 	if (!frontbuffer_bits)
 		return;
 
-	__intel_fb_flush(fb, origin, frontbuffer_bits);
+	frontbuffer_flush(i915, origin, frontbuffer_bits);
 }
 
 void intel_frontbuffer_track(struct intel_framebuffer *old,
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list