From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/4] drm/virtio: pass gem reservation object to ttm init Date: Mon, 17 Jun 2019 16:08:25 +0200 Message-ID: <20190617140825.GD12905@phenom.ffwll.local> References: <20190617111406.14765-1-kraxel@redhat.com> <20190617111406.14765-2-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190617111406.14765-2-kraxel@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Gerd Hoffmann Cc: David Airlie , open list , Daniel Vetter , dri-devel@lists.freedesktop.org, "open list:VIRTIO GPU DRIVER" List-Id: virtualization@lists.linuxfoundation.org On Mon, Jun 17, 2019 at 01:14:03PM +0200, Gerd Hoffmann wrote: > With this gem and ttm will use the same reservation object, > so mixing and matching ttm / gem reservation helpers should > work fine. > > Signed-off-by: Gerd Hoffmann While doing my prime doc+cleanup series I wondered whether we should do this for everyone, and perhaps even remove ttm_bo.ttm_resv. Only driver which doesn't yet have a gem_bo embedded in the same allocation is vmwgfx, and that would be easy to fix by adding a vmwgfx_resv somehwere. Anyway, looks like a solid start into the convergence story. Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/virtio/virtgpu_object.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c > index b2da31310d24..242766d644a7 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_object.c > +++ b/drivers/gpu/drm/virtio/virtgpu_object.c > @@ -132,7 +132,8 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev, > virtio_gpu_init_ttm_placement(bo); > ret = ttm_bo_init(&vgdev->mman.bdev, &bo->tbo, params->size, > ttm_bo_type_device, &bo->placement, 0, > - true, acc_size, NULL, NULL, > + true, acc_size, NULL, > + bo->gem_base.resv, > &virtio_gpu_ttm_bo_destroy); > /* ttm_bo_init failure will call the destroy */ > if (ret != 0) > -- > 2.18.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch