Skip to content

Commit a9d0eb9

Browse files
committed
drm/i915: Warn on if set frontbuffer return value is not NULL on release
i915_gem_object_set_frontbuffer returns set frontbuffer pointer. When we are releasing frontbuffer we are clearing the pointer from the object. Warn on if return value is not null. v3: Check i915_gem_object_set_frontbuffer return value separately v2: Instead of ignoring do drm_WARN_ON Cc: Rodrigo Vivi <[email protected]> Cc: Jani Nikula <[email protected]> Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f67ff36 commit a9d0eb9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/i915/display/intel_frontbuffer.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,16 @@ static void frontbuffer_retire(struct i915_active *ref)
251251
static void frontbuffer_release(struct kref *ref)
252252
__releases(&intel_bo_to_i915(front->obj)->display.fb_tracking.lock)
253253
{
254-
struct intel_frontbuffer *front =
254+
struct intel_frontbuffer *ret, *front =
255255
container_of(ref, typeof(*front), ref);
256256
struct drm_i915_gem_object *obj = front->obj;
257257

258258
drm_WARN_ON(&intel_bo_to_i915(obj)->drm, atomic_read(&front->bits));
259259

260260
i915_ggtt_clear_scanout(obj);
261261

262-
i915_gem_object_set_frontbuffer(obj, NULL);
262+
ret = i915_gem_object_set_frontbuffer(obj, NULL);
263+
drm_WARN_ON(&intel_bo_to_i915(obj)->drm, ret);
263264
spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
264265

265266
i915_active_fini(&front->write);

0 commit comments

Comments
 (0)