Skip to content

Commit

Permalink
drm/i915: Warn about missing context state workarounds only once
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michel Thierry authored and Daniel Vetter committed Dec 16, 2014
1 parent 2f82bbd commit e6c1abb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e6c1abb

Please sign in to comment.