]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/overlay: Extract i915_overlay_cleanup()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 26 Feb 2026 10:07:29 +0000 (12:07 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 Feb 2026 08:41:35 +0000 (10:41 +0200)
Pull the i915 specific bits of the overlay cleanup into
a separate function (i915_overlay_cleanup()) to accommodate
the upcoming parent vs. display driver split.

For now we'll also have to pass in the overlay struct, but
that will disappear once the i915 vs. display split is completed.

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

index 1b84790a63b2d05e844f5594b46f5b6ccbca0bd7..1edc0ae09c68c5b2629b6c89ceb8b0e9e21ce50c 100644 (file)
@@ -1490,23 +1490,29 @@ bool intel_overlay_available(struct intel_display *display)
        return display->overlay;
 }
 
-void intel_overlay_cleanup(struct intel_display *display)
+static void i915_overlay_cleanup(struct drm_device *drm,
+                                struct intel_overlay *overlay)
 {
-       struct intel_overlay *overlay;
-
-       overlay = fetch_and_zero(&display->overlay);
-       if (!overlay)
-               return;
-
        /*
         * The bo's should be free'd by the generic code already.
         * Furthermore modesetting teardown happens beforehand so the
         * hardware should be off already.
         */
-       drm_WARN_ON(display->drm, i915_overlay_is_active(display->drm));
+       drm_WARN_ON(drm, i915_overlay_is_active(drm));
 
        i915_gem_object_put(overlay->reg_bo);
        i915_active_fini(&overlay->last_flip);
+}
+
+void intel_overlay_cleanup(struct intel_display *display)
+{
+       struct intel_overlay *overlay;
+
+       overlay = fetch_and_zero(&display->overlay);
+       if (!overlay)
+               return;
+
+       i915_overlay_cleanup(display->drm, overlay);
 
        kfree(overlay);
 }