From: Daniel Vetter Subject: Re: [PATCH v3 07/12] drm/virtio: remove ttm calls from in virtio_gpu_object_{reserve,unreserve} Date: Wed, 19 Jun 2019 11:57:08 +0200 Message-ID: <20190619095708.GL12905@phenom.ffwll.local> References: <20190619090420.6667-1-kraxel@redhat.com> <20190619090420.6667-8-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190619090420.6667-8-kraxel@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Gerd Hoffmann Cc: dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , "open list:VIRTIO GPU DRIVER" , open list List-Id: dri-devel@lists.freedesktop.org On Wed, Jun 19, 2019 at 11:04:15AM +0200, Gerd Hoffmann wrote: > Call reservation_object_* directly instead > of using ttm_bo_{reserve,unreserve}. > > v3: check for EINTR too. > > Signed-off-by: Gerd Hoffmann > Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/virtio/virtgpu_drv.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h > index 06cc0e961df6..77ac69a8e6cc 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_drv.h > +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h > @@ -402,9 +402,9 @@ static inline int virtio_gpu_object_reserve(struct virtio_gpu_object *bo) > { > int r; > > - r = ttm_bo_reserve(&bo->tbo, true, false, NULL); > + r = reservation_object_lock_interruptible(bo->gem_base.resv, NULL); > if (unlikely(r != 0)) { > - if (r != -ERESTARTSYS) { > + if (r != -ERESTARTSYS && r != -EINTR) { You only need to check for EINTR I think. ttm_bo_reserv does the EINVAL -> ERESTARTSYS remapping. -Daniel > struct virtio_gpu_device *qdev = > bo->gem_base.dev->dev_private; > dev_err(qdev->dev, "%p reserve failed\n", bo); > @@ -416,7 +416,7 @@ static inline int virtio_gpu_object_reserve(struct virtio_gpu_object *bo) > > static inline void virtio_gpu_object_unreserve(struct virtio_gpu_object *bo) > { > - ttm_bo_unreserve(&bo->tbo); > + reservation_object_unlock(bo->gem_base.resv); > } > > /* virgl debufs */ > -- > 2.18.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch