search for: drm_gem_unlock_reservations

Displaying 20 results from an estimated 24 matches for "drm_gem_unlock_reservations".

2019 Jun 28
1
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...flist) { > > + for (i = 0; i < exbuf->num_bo_handles; i++) > > + reservation_object_add_excl_fence(buflist->objs[i]->resv, > > + &out_fence->f); > > + drm_gem_unlock_reservations(buflist->objs, buflist->nents, > > + &ticket); > > + } > We used to unlock after virtio_gpu_cmd_submit. > > I guess, the fence is considered signaled (because its seqno is still > 0) until after virtio_gpu_cmd_submit...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...ic int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, fd_install(out_fence_fd, sync_file->file); } + if (buflist) { + for (i = 0; i < exbuf->num_bo_handles; i++) + reservation_object_add_excl_fence(buflist->objs[i]->resv, + &out_fence->f); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, + &ticket); + } + virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, - vfpriv->ctx_id, out_fence); - - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); - - /* fence the command bo */ - virtio_gpu_unref_l...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...ic int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, fd_install(out_fence_fd, sync_file->file); } + if (buflist) { + for (i = 0; i < exbuf->num_bo_handles; i++) + reservation_object_add_excl_fence(buflist->objs[i]->resv, + &out_fence->f); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, + &ticket); + } + virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, - vfpriv->ctx_id, out_fence); - - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); - - /* fence the command bo */ - virtio_gpu_unref_l...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
..._submit(vgdev, buf, exbuf->size, vfpriv->ctx_id, out_fence); - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); + for (i = 0; i < exbuf->num_bo_handles; i++) + reservation_object_add_excl_fence(buflist[i]->resv, &out_fence->f); + drm_gem_unlock_reservations(buflist, exbuf->num_bo_handles, &ticket); - /* fence the command bo */ - virtio_gpu_unref_list(&validate_list); + for (i = 0; i < exbuf->num_bo_handles; i++) + if (buflist[i]) + drm_gem_object_put_unlocked(buflist[i]); kvfree(buflist); return 0; out_memdup: kfree(buf)...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
..._submit(vgdev, buf, exbuf->size, vfpriv->ctx_id, out_fence); - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); + for (i = 0; i < exbuf->num_bo_handles; i++) + reservation_object_add_excl_fence(buflist[i]->resv, &out_fence->f); + drm_gem_unlock_reservations(buflist, exbuf->num_bo_handles, &ticket); - /* fence the command bo */ - virtio_gpu_unref_list(&validate_list); + for (i = 0; i < exbuf->num_bo_handles; i++) + if (buflist[i]) + drm_gem_object_put_unlocked(buflist[i]); kvfree(buflist); return 0; out_memdup: kfree(buf)...
2019 Jun 28
2
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...t;size, - vfpriv->ctx_id, out_fence); + vfpriv->ctx_id, buflist, out_fence); - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); - - /* fence the command bo */ - virtio_gpu_unref_list(&validate_list); - kvfree(buflist); + if (buflist) + drm_gem_unlock_reservations(buflist->objs, buflist->nents, + &ticket); return 0; out_memdup: kfree(buf); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + if (buflist) + drm_gem_unlock_reservations(buflist->objs, b...
2019 Jun 28
2
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...t;size, - vfpriv->ctx_id, out_fence); + vfpriv->ctx_id, buflist, out_fence); - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); - - /* fence the command bo */ - virtio_gpu_unref_list(&validate_list); - kvfree(buflist); + if (buflist) + drm_gem_unlock_reservations(buflist->objs, buflist->nents, + &ticket); return 0; out_memdup: kfree(buf); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + if (buflist) + drm_gem_unlock_reservations(buflist->objs, b...
2019 Jun 18
1
[PATCH v2 08/12] drm/virtio: rework virtio_gpu_object_create fencing
...ct_add_excl_fence(obj->resv, + &fence->f); spin_unlock_irqrestore(&drv->lock, irq_flags); - if (signaled) - /* virtio create command finished */ - ttm_eu_backoff_reservation(&ticket, &validate_list); } - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(&obj, 1, &ticket); + drm_gem_object_put_unlocked(obj); } *bo_ptr = bo; -- 2.18.1
2019 Jun 18
0
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
..._buffer_objects(&ticket, &validate_list, &out_fence->f); > + for (i = 0; i < exbuf->num_bo_handles; i++) > + reservation_object_add_excl_fence(buflist[i]->resv, &out_fence->f); Helper to unref an array of gem bo? Probably also needed by other drivers. > + drm_gem_unlock_reservations(buflist, exbuf->num_bo_handles, &ticket); > > - /* fence the command bo */ > - virtio_gpu_unref_list(&validate_list); > + for (i = 0; i < exbuf->num_bo_handles; i++) > + if (buflist[i]) > + drm_gem_object_put_unlocked(buflist[i]); I am left wondering who'...
2019 Jun 19
2
[PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...ic int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, fd_install(out_fence_fd, sync_file->file); } + if (buflist) { + for (i = 0; i < exbuf->num_bo_handles; i++) + reservation_object_add_excl_fence(buflist->objs[i]->resv, + &out_fence->f); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, + &ticket); + } + virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, - vfpriv->ctx_id, out_fence); - - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); - - /* fence the command bo */ - virtio_gpu_unref_l...
2019 Jun 19
2
[PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...ic int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, fd_install(out_fence_fd, sync_file->file); } + if (buflist) { + for (i = 0; i < exbuf->num_bo_handles; i++) + reservation_object_add_excl_fence(buflist->objs[i]->resv, + &out_fence->f); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, + &ticket); + } + virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, - vfpriv->ctx_id, out_fence); - - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); - - /* fence the command bo */ - virtio_gpu_unref_l...
2019 Jul 03
1
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...in execbuffer, we will use this in several places, and often with only 1 object in the array. Can we special case that and do a quick reservation_object_lock? > > +} > > + > > +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs) > > +{ > > + drm_gem_unlock_reservations(objs->objs, objs->nents, > > + &objs->ticket); > > +} > > + > > +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, > > + struct dma_fence *fence) > > +{ > > +...
2019 Jul 02
3
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...objs->nents] = obj; + objs->nents++; +} + +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs) +{ + return drm_gem_lock_reservations(objs->objs, objs->nents, + &objs->ticket); +} + +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs) +{ + drm_gem_unlock_reservations(objs->objs, objs->nents, + &objs->ticket); +} + +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, + struct dma_fence *fence) +{ + int i; + + for (i = 0; i < objs->nents; i++) + reservation_object_add_excl_fence(objs->objs[i]->resv, + f...
2019 Jul 02
3
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...objs->nents] = obj; + objs->nents++; +} + +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs) +{ + return drm_gem_lock_reservations(objs->objs, objs->nents, + &objs->ticket); +} + +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs) +{ + drm_gem_unlock_reservations(objs->objs, objs->nents, + &objs->ticket); +} + +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, + struct dma_fence *fence) +{ + int i; + + for (i = 0; i < objs->nents; i++) + reservation_object_add_excl_fence(objs->objs[i]->resv, + f...
2019 Jun 30
0
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...list, out_fence); > > - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); > - > - /* fence the command bo */ > - virtio_gpu_unref_list(&validate_list); > - kvfree(buflist); > + if (buflist) > + drm_gem_unlock_reservations(buflist->objs, buflist->nents, > + &ticket); When virtio_gpu_cmd_submit progresses really fast, buflist might have been freed. > return 0; > > out_memdup: > kfree(buf); > out_unresv: > - ttm_eu_backoff...
2019 Jun 27
0
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...> + if (buflist) { > + for (i = 0; i < exbuf->num_bo_handles; i++) > + reservation_object_add_excl_fence(buflist->objs[i]->resv, > + &out_fence->f); > + drm_gem_unlock_reservations(buflist->objs, buflist->nents, > + &ticket); > + } We used to unlock after virtio_gpu_cmd_submit. I guess, the fence is considered signaled (because its seqno is still 0) until after virtio_gpu_cmd_submit. We probably don't want...
2019 Jun 19
0
[PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...t drm_device *dev, void *data, > fd_install(out_fence_fd, sync_file->file); > } > > + if (buflist) { > + for (i = 0; i < exbuf->num_bo_handles; i++) > + reservation_object_add_excl_fence(buflist->objs[i]->resv, > + &out_fence->f); > + drm_gem_unlock_reservations(buflist->objs, buflist->nents, > + &ticket); > + } > + > virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, > - vfpriv->ctx_id, out_fence); > - > - ttm_eu_fence_buffer_objects(&ticket, &validate_list, &out_fence->f); > - > - /*...
2019 Jun 28
1
[PATCH v5 09/12] drm/virtio: rework virtio_gpu_object_create fencing
..._resource_create_3d(vgdev, bo, params, fence); + virtio_gpu_cmd_resource_create_3d(vgdev, bo, params, + objs, fence); } else { - virtio_gpu_cmd_create_resource(vgdev, bo, params, fence); + virtio_gpu_cmd_create_resource(vgdev, bo, params, + objs, fence); } + if (fence) + drm_gem_unlock_reservations(objs->objs, objs->nents, &ticket); + virtio_gpu_init_ttm_placement(bo); ret = ttm_bo_init(&vgdev->mman.bdev, &bo->tbo, params->size, ttm_bo_type_device, &bo->placement, 0, @@ -139,38 +158,6 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,...
2019 Jun 20
1
[PATCH v4 09/12] drm/virtio: rework virtio_gpu_object_create fencing
...y_alloc(1); + objs->objs[0] = &bo->gem_base; + drm_gem_object_get(objs->objs[0]); + + ret = drm_gem_lock_reservations(objs->objs, objs->nents, + &ticket); + if (ret == 0) + reservation_object_add_excl_fence(objs->objs[0]->resv, + &fence->f); + drm_gem_unlock_reservations(objs->objs, objs->nents, &ticket); + } + if (params->virgl) { - virtio_gpu_cmd_resource_create_3d(vgdev, bo, params, fence); + virtio_gpu_cmd_resource_create_3d(vgdev, bo, params, + fence, objs); } else { - virtio_gpu_cmd_create_resource(vgdev, bo, params, fence); + virt...
2019 Jun 18
0
[PATCH v2 11/12] drm/virtio: rework virtio_gpu_object_create fencing even more.
...f)) - /* virtio create command still in flight */ - reservation_object_add_excl_fence(obj->resv, - &fence->f); - spin_unlock_irqrestore(&drv->lock, irq_flags); - } + if (ret == 0) + reservation_object_add_excl_fence(obj->resv, + &fence->f); drm_gem_unlock_reservations(&obj, 1, &ticket); - drm_gem_object_put_unlocked(obj); + } + + if (params->virgl) { + virtio_gpu_cmd_resource_create_3d(vgdev, bo, params, fence); + } else { + virtio_gpu_cmd_create_resource(vgdev, bo, params, fence); } ret = virtio_gpu_object_attach(vgdev, bo, NULL); -- 2.18.1