summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_frontbuffer.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2021-02-09 05:19:18 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2021-02-10 01:40:01 +0300
commit5ffb9afaa909f1a254adab67f2d0557a5cead2e9 (patch)
treed607995e005bdb485714b4715ebb32a177d9c1cc /drivers/gpu/drm/i915/display/intel_frontbuffer.c
parent553c23bdb4775130f333f07a51b047276bc53f79 (diff)
downloadlinux-5ffb9afaa909f1a254adab67f2d0557a5cead2e9.tar.xz
drm/i915: Warn when releasing a frontbuffer while in use
Let's scream if we are about to release a frontbuffer which is still in use. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210209021918.16234-3-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_frontbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_frontbuffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index d898b370d7a4..b2744c5c3653 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -224,6 +224,8 @@ static void frontbuffer_release(struct kref *ref)
struct drm_i915_gem_object *obj = front->obj;
struct i915_vma *vma;
+ drm_WARN_ON(obj->base.dev, atomic_read(&front->bits));
+
spin_lock(&obj->vma.lock);
for_each_ggtt_vma(vma, obj)
vma->display_alignment = I915_GTT_MIN_ALIGNMENT;