summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2026-02-26 13:07:29 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2026-02-27 11:41:35 +0300
commitdc1d78b6198822f7fbda273a0beb5236d6dc5989 (patch)
treebd5fcf559181b50d7b7723af034307cb8636c841
parent8f7bf40ce24969b93c1b086caefb545082f27aab (diff)
downloadlinux-dc1d78b6198822f7fbda273a0beb5236d6dc5989.tar.xz
drm/i915/overlay: Extract i915_overlay_cleanup()
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
-rw-r--r--drivers/gpu/drm/i915/display/intel_overlay.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index 1b84790a63b2..1edc0ae09c68 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -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);
}