@@ -167,11 +167,15 @@ void intel_frontbuffer_flip(struct drm_i915_private *i915,
frontbuffer_flush(i915, frontbuffer_bits, ORIGIN_FLIP);
}
-void __intel_fb_invalidate(struct intel_frontbuffer *front,
- enum fb_op_origin origin,
- unsigned int frontbuffer_bits)
+bool __intel_frontbuffer_invalidate(struct intel_frontbuffer *front,
+ enum fb_op_origin origin)
{
struct drm_i915_private *i915 = intel_bo_to_i915(front->obj);
+ unsigned int frontbuffer_bits;
+
+ frontbuffer_bits = atomic_read(&front->bits);
+ if (!frontbuffer_bits)
+ return false;
if (origin == ORIGIN_CS) {
spin_lock(&i915->display.fb_tracking.lock);
@@ -186,13 +190,19 @@ void __intel_fb_invalidate(struct intel_frontbuffer *front,
intel_psr_invalidate(i915, frontbuffer_bits, origin);
intel_drrs_invalidate(i915, frontbuffer_bits);
intel_fbc_invalidate(i915, frontbuffer_bits, origin);
+
+ return true;
}
-void __intel_fb_flush(struct intel_frontbuffer *front,
- enum fb_op_origin origin,
- unsigned int frontbuffer_bits)
+void __intel_frontbuffer_flush(struct intel_frontbuffer *front,
+ enum fb_op_origin origin)
{
struct drm_i915_private *i915 = intel_bo_to_i915(front->obj);
+ unsigned int frontbuffer_bits;
+
+ frontbuffer_bits = atomic_read(&front->bits);
+ if (!frontbuffer_bits)
+ return;
if (origin == ORIGIN_CS) {
spin_lock(&i915->display.fb_tracking.lock);
@@ -79,9 +79,8 @@ void intel_frontbuffer_put(struct intel_frontbuffer *front);
struct intel_frontbuffer *
intel_frontbuffer_get(struct drm_i915_gem_object *obj);
-void __intel_fb_invalidate(struct intel_frontbuffer *front,
- enum fb_op_origin origin,
- unsigned int frontbuffer_bits);
+bool __intel_frontbuffer_invalidate(struct intel_frontbuffer *front,
+ enum fb_op_origin origin);
/**
* intel_frontbuffer_invalidate - invalidate frontbuffer object
@@ -97,22 +96,14 @@ void __intel_fb_invalidate(struct intel_frontbuffer *front,
static inline bool intel_frontbuffer_invalidate(struct intel_frontbuffer *front,
enum fb_op_origin origin)
{
- unsigned int frontbuffer_bits;
-
if (!front)
return false;
- frontbuffer_bits = atomic_read(&front->bits);
- if (!frontbuffer_bits)
- return false;
-
- __intel_fb_invalidate(front, origin, frontbuffer_bits);
- return true;
+ return __intel_frontbuffer_invalidate(front, origin);
}
-void __intel_fb_flush(struct intel_frontbuffer *front,
- enum fb_op_origin origin,
- unsigned int frontbuffer_bits);
+void __intel_frontbuffer_flush(struct intel_frontbuffer *front,
+ enum fb_op_origin origin);
/**
* intel_frontbuffer_flush - flush frontbuffer object
@@ -125,16 +116,10 @@ void __intel_fb_flush(struct intel_frontbuffer *front,
static inline void intel_frontbuffer_flush(struct intel_frontbuffer *front,
enum fb_op_origin origin)
{
- unsigned int frontbuffer_bits;
-
if (!front)
return;
- frontbuffer_bits = atomic_read(&front->bits);
- if (!frontbuffer_bits)
- return;
-
- __intel_fb_flush(front, origin, frontbuffer_bits);
+ __intel_frontbuffer_flush(front, origin);
}
void intel_frontbuffer_queue_flush(struct intel_frontbuffer *front);
Move frontbuffer bits read and check from intel_frontbuffer.h inline functions to intel_frontbuffer.c, in preparation for making struct intel_frontbuffer opaque. Rename __intel_fb_* to __intel_frontbuffer_* while at it, because fb sounds like framebuffer more than frontbuffer. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- .../gpu/drm/i915/display/intel_frontbuffer.c | 22 ++++++++++----- .../gpu/drm/i915/display/intel_frontbuffer.h | 27 +++++-------------- 2 files changed, 22 insertions(+), 27 deletions(-)