Re: [CI 1/3] drm/i915/gt: Skip rmw for masked registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Mika Kuoppala (2020-01-31 13:14:38)
> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:
> 
> > Quoting Mika Kuoppala (2020-01-31 11:51:44)
> >> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx>
> >> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> >> > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> >> > Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> >> > ---
> >> >  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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux