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);
}