drm/i915: Warn about missing context state workarounds only once
authorMichel Thierry <michel.thierry@intel.com>
Wed, 26 Nov 2014 14:21:02 +0000 (14:21 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 16 Dec 2014 09:39:12 +0000 (10:39 +0100)
Otherwise, new platforms without workarounds will hit this warning for
every new context created.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c

index 4dc6d42..7670a0f 100644 (file)
@@ -1096,7 +1096,7 @@ static int intel_logical_ring_workarounds_emit(struct intel_engine_cs *ring,
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct i915_workarounds *w = &dev_priv->workarounds;
 
-       if (WARN_ON(w->count == 0))
+       if (WARN_ON_ONCE(w->count == 0))
                return 0;
 
        ring->gpu_caches_dirty = true;
index f1ce169..3cad32a 100644 (file)
@@ -679,7 +679,7 @@ static int intel_ring_workarounds_emit(struct intel_engine_cs *ring,
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct i915_workarounds *w = &dev_priv->workarounds;
 
-       if (WARN_ON(w->count == 0))
+       if (WARN_ON_ONCE(w->count == 0))
                return 0;
 
        ring->gpu_caches_dirty = true;