From 5b3fe7c78cbefb646b01a1a94e0c1cce674d4c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Thu, 26 Feb 2026 15:01:13 +0200 Subject: [PATCH] drm/i915/overlay: Don't use fetch_and_zero() in display code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't generally want fetch_and_zero() on the display side, so stop using it in the display side intel_overlay_cleanup(). Fortunately we don't really have anything to do here apart from freeing the data. And we'll keep on clearing the pointer, just in case something somewhere cares about it. Note that once i915_overlay_cleanup() is converted to the parent interface we can't call it unconditionally (as xe won't have it). So we need to keep the early bailout for overlay==NULL. v2: Adjust the commit message since we do apparently have fetch_and_zero() in display code as well (Jani) v3: Skip i915_overlay_cleanup() if the overlay wasn't initialized Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20260226130113.16714-1-ville.syrjala@linux.intel.com --- drivers/gpu/drm/i915/display/intel_overlay.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index 10a235ce608e..37c60c08dd56 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -1554,13 +1554,11 @@ static void i915_overlay_cleanup(struct drm_device *drm) void intel_overlay_cleanup(struct intel_display *display) { - struct intel_overlay *overlay; - - overlay = fetch_and_zero(&display->overlay); - if (!overlay) + if (!display->overlay) return; i915_overlay_cleanup(display->drm); - kfree(overlay); + kfree(display->overlay); + display->overlay = NULL; }