search for: virtio_gpu_context_create

Displaying 20 results from an estimated 20 matches for "virtio_gpu_context_create".

2018 Sep 26
5
[PATCH 0/4] Improve virtio ID allocation
I noticed you were using IDRs where you could be using the more efficient IDAs, then while fixing that I noticed the lack of error handling, and I decided to follow that up with an efficiency improvement. There's probably a v2 of this to follow because I couldn't figure out how to properly handle one of the error cases ... see the comment embedded in one of the patches. Matthew Wilcox
2018 Sep 26
2
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
On Wed, Sep 26, 2018 at 09:00:31AM -0700, Matthew Wilcox wrote: > @@ -59,6 +59,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev, > > if (handle < 0) > return handle; > + handle++; > virtio_gpu_cmd_context_create(vgdev, handle, nlen, name); > return handle; > } Uh. This line is missing. - int handle = ida_alloc_min(&vgdev->ctx_id_ida, 1, GFP_...
2018 Sep 26
2
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
On Wed, Sep 26, 2018 at 09:00:31AM -0700, Matthew Wilcox wrote: > @@ -59,6 +59,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev, > > if (handle < 0) > return handle; > + handle++; > virtio_gpu_cmd_context_create(vgdev, handle, nlen, name); > return handle; > } Uh. This line is missing. - int handle = ida_alloc_min(&vgdev->ctx_id_ida, 1, GFP_...
2018 Sep 26
0
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
...++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index bf609dcae224..b576c9ef6323 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -59,6 +59,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev, if (handle < 0) return handle; + handle++; virtio_gpu_cmd_context_create(vgdev, handle, nlen, name); return handle; } @@ -67,7 +68,7 @@ static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, uint32_t ctx_id) { virtio_gpu...
2018 Oct 02
0
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
On Wed, Sep 26, 2018 at 09:04:55AM -0700, Matthew Wilcox wrote: > On Wed, Sep 26, 2018 at 09:00:31AM -0700, Matthew Wilcox wrote: > > @@ -59,6 +59,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev, > > > > if (handle < 0) > > return handle; > > + handle++; > > virtio_gpu_cmd_context_create(vgdev, handle, nlen, name); > > return handle; > > } > > Uh. This line is missing. > > - int ha...
2018 Nov 07
1
[PATCH][drm-next] drm/virtio: fix memory leak of vfpriv on error return path
...ivers/gpu/drm/virtio/virtgpu_kms.c index bf609dcae224..f4f995639ed1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -266,8 +266,10 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file) get_task_comm(dbgname, current); id = virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname); - if (id < 0) + if (id < 0) { + kfree(vfpriv); return id; + } vfpriv->ctx_id = id; file->driver_priv = vfpriv; -- 2.19.1
2020 Feb 14
0
[PATCH v4 6/6] drm/virtio: move remaining virtio_gpu_notify calls
...opy_exit: ret = wait_event_timeout(vgdev->resp_wq, diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 8fd7acef960f..ad3b673f5796 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -61,6 +61,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev, return handle; handle += 1; virtio_gpu_cmd_context_create(vgdev, handle, nlen, name); + virtio_gpu_notify(vgdev); return handle; } @@ -68,6 +69,7 @@ static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, uint32_t ctx_id) {...
2017 Dec 28
3
[PATCH] drm/virtio: Add window server support
...if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL); if (!vfpriv) return -ENOMEM; - virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname, &id); + /* can't create contexts without 3d renderer */ + if (vgdev->has_virgl_3d) { + get_task_comm(tmpname, current); + snprintf(dbgname, sizeof(dbgname), "%s", tmpname); + dbgname[63] = 0; + + virtio_gpu_context_create(vgdev, strlen(dbgna...
2017 Dec 28
3
[PATCH] drm/virtio: Add window server support
...if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL); if (!vfpriv) return -ENOMEM; - virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname, &id); + /* can't create contexts without 3d renderer */ + if (vgdev->has_virgl_3d) { + get_task_comm(tmpname, current); + snprintf(dbgname, sizeof(dbgname), "%s", tmpname); + dbgname[63] = 0; + + virtio_gpu_context_create(vgdev, strlen(dbgna...
2018 Jan 26
0
[PATCH v3 1/2] drm/virtio: Add window server support
...if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL); if (!vfpriv) return -ENOMEM; - virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname, &id); + /* can't create contexts without 3d renderer */ + if (vgdev->has_virgl_3d) { + get_task_comm(tmpname, current); + snprintf(dbgname, sizeof(dbgname), "%s", tmpname); + dbgname[63] = 0; + + virtio_gpu_context_create(vgdev, strlen(dbgna...
2018 Jan 26
3
[PATCH v3 0/2] drm/virtio: Add window server support
Hi, this work is based on the virtio_wl driver in the ChromeOS kernel by Zach Reizner, currently at: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-4.4/drivers/virtio/virtio_wl.c There's one feature missing currently, which is letting clients write directly to the host part of a resource, so the extra copy in TRANSFER_TO_HOST isn't needed. Have pushed the
2017 Dec 14
2
[PATCH] drm/virtio: Add window server support
...if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL); if (!vfpriv) return -ENOMEM; - virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname, &id); + /* can't create contexts without 3d renderer */ + if (vgdev->has_virgl_3d) { + get_task_comm(tmpname, current); + snprintf(dbgname, sizeof(dbgname), "%s", tmpname); + dbgname[63] = 0; + + virtio_gpu_context_create(vgdev, strlen(dbgna...
2017 Dec 14
2
[PATCH] drm/virtio: Add window server support
...if (!vgdev->has_virgl_3d) - return 0; - - get_task_comm(tmpname, current); - snprintf(dbgname, sizeof(dbgname), "%s", tmpname); - dbgname[63] = 0; /* allocate a virt GPU context for this opener */ vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL); if (!vfpriv) return -ENOMEM; - virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname, &id); + /* can't create contexts without 3d renderer */ + if (vgdev->has_virgl_3d) { + get_task_comm(tmpname, current); + snprintf(dbgname, sizeof(dbgname), "%s", tmpname); + dbgname[63] = 0; + + virtio_gpu_context_create(vgdev, strlen(dbgna...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...x_id_idr_lock); + idr_preload_end(); + *resid = handle; +} + +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) +{ + spin_lock(&vgdev->ctx_id_idr_lock); + idr_remove(&vgdev->ctx_id_idr, id); + spin_unlock(&vgdev->ctx_id_idr_lock); +} + +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, + uint32_t nlen, const char *name, + uint32_t *ctx_id) +{ + virtio_gpu_ctx_id_get(vgdev, ctx_id); + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); +} + +static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, +...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...x_id_idr_lock); + idr_preload_end(); + *resid = handle; +} + +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) +{ + spin_lock(&vgdev->ctx_id_idr_lock); + idr_remove(&vgdev->ctx_id_idr, id); + spin_unlock(&vgdev->ctx_id_idr_lock); +} + +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, + uint32_t nlen, const char *name, + uint32_t *ctx_id) +{ + virtio_gpu_ctx_id_get(vgdev, ctx_id); + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); +} + +static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, +...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...x_id_idr_lock); + idr_preload_end(); + *resid = handle; +} + +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) +{ + spin_lock(&vgdev->ctx_id_idr_lock); + idr_remove(&vgdev->ctx_id_idr, id); + spin_unlock(&vgdev->ctx_id_idr_lock); +} + +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, + uint32_t nlen, const char *name, + uint32_t *ctx_id) +{ + virtio_gpu_ctx_id_get(vgdev, ctx_id); + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); +} + +static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, +...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...x_id_idr_lock); + idr_preload_end(); + *resid = handle; +} + +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) +{ + spin_lock(&vgdev->ctx_id_idr_lock); + idr_remove(&vgdev->ctx_id_idr, id); + spin_unlock(&vgdev->ctx_id_idr_lock); +} + +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, + uint32_t nlen, const char *name, + uint32_t *ctx_id) +{ + virtio_gpu_ctx_id_get(vgdev, ctx_id); + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); +} + +static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, +...
2015 Sep 21
0
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...ndle; > +} > + > +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) > +{ > + spin_lock(&vgdev->ctx_id_idr_lock); > + idr_remove(&vgdev->ctx_id_idr, id); > + spin_unlock(&vgdev->ctx_id_idr_lock); > +} > + > +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, > + uint32_t nlen, const char *name, > + uint32_t *ctx_id) > +{ > + virtio_gpu_ctx_id_get(vgdev, ctx_id); > + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); > +} > + > +static void virtio_gpu_context_destroy(stru...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...x_id_idr_lock); + idr_preload_end(); + *resid = handle; +} + +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) +{ + spin_lock(&vgdev->ctx_id_idr_lock); + idr_remove(&vgdev->ctx_id_idr, id); + spin_unlock(&vgdev->ctx_id_idr_lock); +} + +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, + uint32_t nlen, const char *name, + uint32_t *ctx_id) +{ + virtio_gpu_ctx_id_get(vgdev, ctx_id); + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); +} + +static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, +...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...x_id_idr_lock); + idr_preload_end(); + *resid = handle; +} + +static void virtio_gpu_ctx_id_put(struct virtio_gpu_device *vgdev, uint32_t id) +{ + spin_lock(&vgdev->ctx_id_idr_lock); + idr_remove(&vgdev->ctx_id_idr, id); + spin_unlock(&vgdev->ctx_id_idr_lock); +} + +static void virtio_gpu_context_create(struct virtio_gpu_device *vgdev, + uint32_t nlen, const char *name, + uint32_t *ctx_id) +{ + virtio_gpu_ctx_id_get(vgdev, ctx_id); + virtio_gpu_cmd_context_create(vgdev, *ctx_id, nlen, name); +} + +static void virtio_gpu_context_destroy(struct virtio_gpu_device *vgdev, +...