[RFC PATCH 17/22] drm/i915/display: Move checking frontbuffer bits

Jouni Högander jouni.hogander at intel.com
Fri Mar 24 11:25:00 UTC 2023


Check frontbuffer bits in frontbuffer_flush to cover also user of
frontbuffer_flush.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_frontbuffer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index 40673e47c483..3bd48504c678 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -80,6 +80,9 @@ void frontbuffer_flush(struct drm_i915_private *i915,
 {
 	trace_intel_frontbuffer_flush(i915, frontbuffer_bits);
 
+	if (!frontbuffer_bits)
+		return;
+
 	might_sleep();
 	intel_drrs_flush(i915, frontbuffer_bits);
 	intel_psr_flush(i915, frontbuffer_bits);
@@ -105,8 +108,6 @@ void intel_frontbuffer_flush(struct intel_framebuffer *fb)
 	i915 = to_i915(fb->base.dev);
 
 	frontbuffer_bits = atomic_read(&fb->bits);
-	if (!frontbuffer_bits)
-		return;
 
 	frontbuffer_flush(i915, frontbuffer_bits);
 }
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list