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

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 31 11:55:00 UTC 2020


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.
-Chris


More information about the Intel-gfx mailing list