Re: [PATCH] drm/etnaviv: Use dma_resv locking wrappers

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

 



On Mon, Dec 16, 2019 at 04:14:34PM +0100, Lucas Stach wrote:
> On Sa, 2019-12-14 at 01:09 +0100, Daniel Vetter wrote:
> > I'll add more fancy logic to them soon, so everyone really has to use
> > them. Plus they already provide some nice additional debug
> > infrastructure on top of direct ww_mutex usage for the fences tracked
> > by dma_resv.
> > 
> > v2: Fix the lost _interruptible (Michael)
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
> > Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> > Cc: Russell King <linux+etnaviv@xxxxxxxxxxxxxxx>
> > Cc: Christian Gmeiner <christian.gmeiner@xxxxxxxxx>
> > Cc: etnaviv@xxxxxxxxxxxxxxxxxxxxx
> > Cc: "Ruhl, Michael J" <michael.j.ruhl@xxxxxxxxx>
> 
> Reviewed-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> 
> If you want to stack other stuff on top of this before the next merge
> window feel free to take it through drm-misc. Otherwise I'm going to
> pick it up with the next sweep.

I expect a fair amount of stacking in the dma-buf area in the near future
, so applied all (except the i915 one, that's already superseeded with
i915 specific work) to drm-misc-next.

Thanks for review.
-Daniel

> 
> Regards,
> Lucas
> 
> > ---
> >  drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> > index aa3e4c3b063a..3b0afa156d92 100644
> > --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> > @@ -113,7 +113,7 @@ static void submit_unlock_object(struct etnaviv_gem_submit *submit, int i)
> >  	if (submit->bos[i].flags & BO_LOCKED) {
> >  		struct drm_gem_object *obj = &submit->bos[i].obj->base;
> >  
> > -		ww_mutex_unlock(&obj->resv->lock);
> > +		dma_resv_unlock(obj->resv);
> >  		submit->bos[i].flags &= ~BO_LOCKED;
> >  	}
> >  }
> > @@ -133,8 +133,7 @@ static int submit_lock_objects(struct etnaviv_gem_submit *submit,
> >  		contended = i;
> >  
> >  		if (!(submit->bos[i].flags & BO_LOCKED)) {
> > -			ret = ww_mutex_lock_interruptible(&obj->resv->lock,
> > -							  ticket);
> > +			ret = dma_resv_lock_interruptible(obj->resv, ticket);
> >  			if (ret == -EALREADY)
> >  				DRM_ERROR("BO at index %u already on submit list\n",
> >  					  i);
> > @@ -161,8 +160,7 @@ static int submit_lock_objects(struct etnaviv_gem_submit *submit,
> >  		obj = &submit->bos[contended].obj->base;
> >  
> >  		/* we lost out in a seqno race, lock and retry.. */
> > -		ret = ww_mutex_lock_slow_interruptible(&obj->resv->lock,
> > -						       ticket);
> > +		ret = dma_resv_lock_slow_interruptible(obj->resv, ticket);
> >  		if (!ret) {
> >  			submit->bos[contended].flags |= BO_LOCKED;
> >  			slow_locked = contended;
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux