[Intel-gfx] [PATCH] drm/i915: Don't complain when there is no workaround.

Dave Gordon david.s.gordon at intel.com
Thu Dec 18 08:26:14 PST 2014


On 18/12/14 08:16, Daniel Vetter wrote:
> On Wed, Dec 17, 2014 at 08:34:41AM -0800, Rodrigo Vivi wrote:
>> When we don't have any workaround to emit we should celebrate, not bother.
> 
> Well except that on the platforms where this fires we really should have
> some, most likely. This is in a way similar to all the other WARN_ON cases
> we have to make sure nothing gets lost in platform enabling.
> -Daniel

You could have a convention that
	(count == 0)
means "I haven't filled this in yet" (and generates a warning), whereas
	(count == I915_NO_WORKAROUNDS_REQUIRED)
(which can be defined as (~0)) means "I haven't forgotten, there really
aren't any workarounds" and suppresses the warning.

Of course, any /other/ value > I915_MAX_WA_REGS should definitely give a
warning, preferably at compile time!

.Dave

>>
>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_lrc.c        | 2 +-
>>  drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
>> index 7670a0f..0bb50f6 100644
>> --- a/drivers/gpu/drm/i915/intel_lrc.c
>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>> @@ -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_ONCE(w->count == 0))
>> +	if (w->count == 0)
>>  		return 0;
>>  
>>  	ring->gpu_caches_dirty = true;
>> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
>> index 12a36f0..3d99bb1 100644
>> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
>> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
>> @@ -682,7 +682,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_ONCE(w->count == 0))
>> +	if (w->count == 0)
>>  		return 0;
>>  
>>  	ring->gpu_caches_dirty = true;
>> -- 
>> 1.9.3
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 



More information about the Intel-gfx mailing list