search for: out_memdup

Displaying 20 results from an estimated 27 matches for "out_memdup".

2020 Feb 11
0
[PATCH 1/2] drm/virtio: fix virtio_gpu_execbuffer_ioctl locking
...list); - if (ret) - goto out_unused_fd; - } - buf = vmemdup_user(u64_to_user_ptr(exbuf->command), exbuf->size); if (IS_ERR(buf)) { ret = PTR_ERR(buf); - goto out_unresv; + goto out_unused_fd; + } + + if (buflist) { + ret = virtio_gpu_array_lock_resv(buflist); + if (ret) + goto out_memdup; } out_fence = virtio_gpu_fence_alloc(vgdev); if(!out_fence) { ret = -ENOMEM; - goto out_memdup; + goto out_unresv; } if (out_fence_fd >= 0) { @@ -160,11 +160,11 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, vfpriv->ctx_id, buflist,...
2019 Jun 28
1
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...} > 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 other > processes to see the semi-initialized fence. Good point. Fixed. > > out_memdup: > > kfree(buf); > > out_unresv: > > - ttm_eu_backoff_reservation(&ticket, &validate_list); > > -out_free: > > - virtio_gpu_unref_list(&validate_list); > Keeping out_free to free buflist seems just fine. We don't need the separa...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
..._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); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(buflist, exbuf->num_bo_handles, &ticket); out_unused_fd: kvfree(bo_handles); + for (i = 0; i < exbuf->num_...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
..._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); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(buflist, exbuf->num_bo_handles, &ticket); out_unused_fd: kvfree(bo_handles); + for (i = 0; i < exbuf->num_...
2020 Apr 07
0
[vhost:vhost 32/44] drivers/gpu/drm/virtio/virtgpu_ioctl.c:113:7: error: implicit declaration of function 'copy_from_user'; did you mean 'sg_copy_from_buffer'?
...2018-11-12 140 2cd7b6f08bc4cf Robert Foss 2018-11-12 141 out_fence = virtio_gpu_fence_alloc(vgdev); 2cd7b6f08bc4cf Robert Foss 2018-11-12 142 if(!out_fence) { 9fdd90c0f42440 Robert Foss 2018-11-12 143 ret = -ENOMEM; 2cd7b6f08bc4cf Robert Foss 2018-11-12 144 goto out_memdup; 2cd7b6f08bc4cf Robert Foss 2018-11-12 145 } 2cd7b6f08bc4cf Robert Foss 2018-11-12 146 2cd7b6f08bc4cf Robert Foss 2018-11-12 147 if (out_fence_fd >= 0) { 2cd7b6f08bc4cf Robert Foss 2018-11-12 148 sync_file = sync_file_create(&out_fence->f); 2cd7b6f08bc4cf Robe...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...->size, - vfpriv->ctx_id, 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); + vfpriv->ctx_id, out_fence, buflist); return 0; out_memdup: kfree(buf); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, &ticket); out_unused_fd: kvfree(bo_handles); - kvfree(buflist); + if (buflist)...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...->size, - vfpriv->ctx_id, 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); + vfpriv->ctx_id, out_fence, buflist); return 0; out_memdup: kfree(buf); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, &ticket); out_unused_fd: kvfree(bo_handles); - kvfree(buflist); + if (buflist)...
2019 Jun 28
2
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...tm_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, buflist->nents, &ticket); out_unused_fd: kvfree(bo_handles); - kvfree(buflist)...
2019 Jun 28
2
[PATCH v5 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...tm_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, buflist->nents, &ticket); out_unused_fd: kvfree(bo_handles); - kvfree(buflist)...
2016 Dec 12
6
[RFC 1/5] drm/virtio: add virtio_gpu_alloc_fence()
From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> Refactor fence creation to remove the potential allocation failure from the cmd_submit and atomic_commit paths. Now the fence should be allocated first and just after we should proceed with the rest of the execution. Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk> --- drivers/gpu/drm/virtio/virtgpu_drv.h
2016 Dec 12
6
[RFC 1/5] drm/virtio: add virtio_gpu_alloc_fence()
From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> Refactor fence creation to remove the potential allocation failure from the cmd_submit and atomic_commit paths. Now the fence should be allocated first and just after we should proceed with the rest of the execution. Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk> --- drivers/gpu/drm/virtio/virtgpu_drv.h
2019 Jul 02
2
[PATCH v6 08/18] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...->size, - vfpriv->ctx_id, 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); + vfpriv->ctx_id, buflist, out_fence); 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) + virtio_gpu_array_unlock_resv(buflist); out_unused_fd: kvfree(bo_handles); - kvfree(buflist); + if (buflist) + virtio_gpu_array_put...
2019 Jul 02
2
[PATCH v6 08/18] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...->size, - vfpriv->ctx_id, 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); + vfpriv->ctx_id, buflist, out_fence); 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) + virtio_gpu_array_unlock_resv(buflist); out_unused_fd: kvfree(bo_handles); - kvfree(buflist); + if (buflist) + virtio_gpu_array_put...
2019 Jun 18
0
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...; I am left wondering who's holding references onto these buffers now? How do you make sure they don't disappear untimely? I think atm it's ttm making sure of that, but if you drop that completely there needs to be something else. > kvfree(buflist); > return 0; > > out_memdup: > kfree(buf); > out_unresv: > - ttm_eu_backoff_reservation(&ticket, &validate_list); > -out_free: > - virtio_gpu_unref_list(&validate_list); > + drm_gem_unlock_reservations(buflist, exbuf->num_bo_handles, &ticket); > out_unused_fd: > kvfree(bo_handl...
2019 Jun 19
2
[PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...->size, - vfpriv->ctx_id, 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); + vfpriv->ctx_id, out_fence, buflist); return 0; out_memdup: kfree(buf); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, &ticket); out_unused_fd: kvfree(bo_handles); - kvfree(buflist); + if (buflist)...
2019 Jun 19
2
[PATCH v3 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...->size, - vfpriv->ctx_id, 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); + vfpriv->ctx_id, out_fence, buflist); return 0; out_memdup: kfree(buf); out_unresv: - ttm_eu_backoff_reservation(&ticket, &validate_list); -out_free: - virtio_gpu_unref_list(&validate_list); + drm_gem_unlock_reservations(buflist->objs, buflist->nents, &ticket); out_unused_fd: kvfree(bo_handles); - kvfree(buflist); + if (buflist)...
2020 Feb 11
1
[PATCH] drm/virtio: rework batching
...tgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -158,6 +158,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, vfpriv->ctx_id, buflist, out_fence); + virtio_gpu_notify(vgdev); return 0; out_memdup: @@ -314,6 +315,7 @@ static int virtio_gpu_transfer_from_host_ioctl(struct drm_device *dev, (vgdev, vfpriv->ctx_id, offset, args->level, &args->box, objs, fence); dma_fence_put(&fence->f); + virtio_gpu_notify(vgdev); return 0; err_unlock: @@ -359,6 +361,7 @@ static...
2019 Sep 10
0
[PATCH v3 2/2] drm/virtio: Use vmalloc for command buffer allocations.
...64_to_user_ptr(exbuf->command), exbuf->size); + buf = vmemdup_user(u64_to_user_ptr(exbuf->command), exbuf->size); if (IS_ERR(buf)) { ret = PTR_ERR(buf); goto out_unresv; @@ -230,7 +230,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, return 0; out_memdup: - kfree(buf); + kvfree(buf); out_unresv: ttm_eu_backoff_reservation(&ticket, &validate_list); out_free: diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index bf5a4a50b002..76cf2b9d5d1d 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers...
2020 Feb 12
1
[PATCH v2] drm/virtio: rework batching
...tgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -158,6 +158,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, vfpriv->ctx_id, buflist, out_fence); + virtio_gpu_notify(vgdev); return 0; out_memdup: @@ -314,6 +315,7 @@ static int virtio_gpu_transfer_from_host_ioctl(struct drm_device *dev, (vgdev, vfpriv->ctx_id, offset, args->level, &args->box, objs, fence); dma_fence_put(&fence->f); + virtio_gpu_notify(vgdev); return 0; err_unlock: @@ -359,6 +361,7 @@ static...
2019 Sep 11
1
[PATCH v4 2/2] drm/virtio: Use vmalloc for command buffer allocations.
...64_to_user_ptr(exbuf->command), exbuf->size); + buf = vmemdup_user(u64_to_user_ptr(exbuf->command), exbuf->size); if (IS_ERR(buf)) { ret = PTR_ERR(buf); goto out_unresv; @@ -172,7 +172,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data, return 0; out_memdup: - kfree(buf); + kvfree(buf); out_unresv: if (buflist) virtio_gpu_array_unlock_resv(buflist); diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 5a64c776138d..9f9b782dd332 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/v...