]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/frontbuffer: Handle the dirtyfb cache flush inside intel_frontbuffer_flush()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 16 Oct 2025 18:54:03 +0000 (21:54 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 7 Nov 2025 15:37:31 +0000 (17:37 +0200)
intel_bo_frontbuffer_flush_for_display() is a bit too low level
to be directly in the high level dirtyfb code. Move the calls
into intel_frontbuffer_flush().

There is a slight behavioural change here in that we now skip
the flush if the bo is not a current scanout buffer (front->bits
== 0). But that is fine as the flush will eventually happen via
the fb pinning code if/when the bo becomes a scanout buffer again.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251016185408.22735-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_fb.c
drivers/gpu/drm/i915/display/intel_frontbuffer.c

index 3f185709cd3727446233a89a5fa9b1ad8e0abe41..ee093e5ffbedd2c665ce2ad17aba944be8b56e71 100644 (file)
@@ -2193,7 +2193,6 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
        return ret;
 
 flush:
-       intel_bo_frontbuffer_flush_for_display(front);
        intel_frontbuffer_flush(front, ORIGIN_DIRTYFB);
        return ret;
 }
index 5562801d2ea381f70b6f8f44c4c3ef60281f82ac..bdf8bfa7deb991c33eb51d754ac28b4da201b77b 100644 (file)
@@ -150,6 +150,9 @@ void __intel_fb_flush(struct intel_frontbuffer *front,
 {
        struct intel_display *display = to_intel_display(front->obj->dev);
 
+       if (origin == ORIGIN_DIRTYFB)
+               intel_bo_frontbuffer_flush_for_display(front);
+
        if (origin == ORIGIN_CS) {
                spin_lock(&display->fb_tracking.lock);
                /* Filter out new bits since rendering started. */
@@ -167,7 +170,6 @@ static void intel_frontbuffer_flush_work(struct work_struct *work)
        struct intel_frontbuffer *front =
                container_of(work, struct intel_frontbuffer, flush_work);
 
-       intel_bo_frontbuffer_flush_for_display(front);
        intel_frontbuffer_flush(front, ORIGIN_DIRTYFB);
        intel_frontbuffer_put(front);
 }