[Intel-gfx] [CI 1/3] drm/i915/gt: Skip rmw for masked registers

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 31 13:18:28 UTC 2020


Quoting Mika Kuoppala (2020-01-31 13:14:38)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > Quoting Mika Kuoppala (2020-01-31 11:51:44)
> >> Chris Wilson <chris at chris-wilson.co.uk> writes:
> >> 
> >> > A masked register does not need rmw to update, and it is best not to use
> >> > such a sequence.
> >> >
> >> > Reported-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> >> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >> > Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/gt/intel_workarounds.c | 32 ++++++++++++++-------
> >> >  1 file changed, 21 insertions(+), 11 deletions(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> >> > index 5a7db279f702..e4c2b6d42f46 100644
> >> > --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> >> > +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> >> > @@ -116,7 +116,8 @@ static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
> >> >               } else {
> >> >                       wa_ = &wal->list[mid];
> >> >  
> >> > -                     if ((wa->mask & ~wa_->mask) == 0) {
> >> > +                     if ((wa->mask | wa_->mask) &&
> >> 
> >> Don't we want to discard if someone tries to demote a masked
> >> one into a plain?
> >
> > That should throw the error, right?
> >
> > If either used a mask and now we don't, then 0 & x == 0 => DRM_ERROR.
> 
> Yes, it will throw the error. My mistake.
> 
> But if we have a mask, we should not allow nonmasked additions
> aswell? So mask == 0 would always be masked register and you
> can't mix.

Indeed. We do not want rmw on masked registers. Some might say wa->mask
is a misnomer ;)
-Chris


More information about the Intel-gfx mailing list