search for: vfpriv

Displaying 20 results from an estimated 75 matches for "vfpriv".

2018 Nov 07
1
[PATCH][drm-next] drm/virtio: fix memory leak of vfpriv on error return path
From: Colin Ian King <colin.king at canonical.com> The allocation for vfpriv is being leaked on an error return path, fix this by kfree'ing it before returning. Detected by CoverityScan, CID#1475380 ("Resource Leak") Fixes: 6a37c49a94a9 ("drm/virtio: Handle context ID allocation errors") Signed-off-by: Colin Ian King <colin.king at canonical.com...
2017 Dec 28
3
[PATCH] drm/virtio: Add window server support
...rv_fops = { + + .poll = winsrv_poll, + .unlocked_ioctl = winsrv_ioctl, + .release = winsrv_release, +}; + +static int virtio_gpu_winsrv_connect(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct drm_virtgpu_winsrv_connect *args = data; + struct virtio_gpu_winsrv_conn *conn; + int ret; + + conn = kzalloc(sizeof(*conn), GFP_KERNEL); + if (!conn) + return -ENOMEM; + + conn->vgdev = vgdev; + conn->drm_file = file; + spin_lock_init(&conn->lock); +...
2017 Dec 28
3
[PATCH] drm/virtio: Add window server support
...rv_fops = { + + .poll = winsrv_poll, + .unlocked_ioctl = winsrv_ioctl, + .release = winsrv_release, +}; + +static int virtio_gpu_winsrv_connect(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct drm_virtgpu_winsrv_connect *args = data; + struct virtio_gpu_winsrv_conn *conn; + int ret; + + conn = kzalloc(sizeof(*conn), GFP_KERNEL); + if (!conn) + return -ENOMEM; + + conn->vgdev = vgdev; + conn->drm_file = file; + spin_lock_init(&conn->lock); +...
2018 Jan 26
0
[PATCH v3 1/2] drm/virtio: Add window server support
...nsrv_fops = { + .poll = winsrv_poll, + .unlocked_ioctl = winsrv_ioctl, + .release = winsrv_release, +}; + +static int virtio_gpu_winsrv_connect(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct drm_virtgpu_winsrv_connect *args = data; + struct virtio_gpu_winsrv_conn *conn; + int ret; + + if (!virtio_has_feature(vgdev->vdev, VIRTIO_GPU_F_WINSRV)) + return -ENODEV; + + conn = kzalloc(sizeof(*conn), GFP_KERNEL); + if (!conn) + return -ENOMEM; + + conn-&g...
2023 Mar 22
0
[PATCH v2 1/2] drm/virtio: Refactor job submission code path
...m/virtgpu_drm.h> > + > +#include "virtgpu_drv.h" > + > +struct virtio_gpu_submit { > + struct virtio_gpu_object_array *buflist; > + struct drm_virtgpu_execbuffer *exbuf; > + struct virtio_gpu_fence *out_fence; > + struct virtio_gpu_fpriv *vfpriv; > + struct virtio_gpu_device *vgdev; > + struct drm_file *file; > + uint64_t fence_ctx; > + uint32_t ring_idx; > + int out_fence_fd; > + void *buf; > +}; > + > +static int virtio_gpu_do_fence_wait(struct virtio_gpu_submit *submit, >...
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
...rv_fops = { + + .poll = winsrv_poll, + .unlocked_ioctl = winsrv_ioctl, + .release = winsrv_release, +}; + +static int virtio_gpu_winsrv_connect(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct drm_virtgpu_winsrv_connect *args = data; + struct virtio_gpu_winsrv_conn *conn; + int ret; + + conn = kzalloc(sizeof(*conn), GFP_KERNEL); + if (!conn) + return -ENOMEM; + + conn->vgdev = vgdev; + conn->drm_file = file; + spin_lock_init(&conn->lock); +...
2017 Dec 14
2
[PATCH] drm/virtio: Add window server support
...rv_fops = { + + .poll = winsrv_poll, + .unlocked_ioctl = winsrv_ioctl, + .release = winsrv_release, +}; + +static int virtio_gpu_winsrv_connect(struct drm_device *dev, void *data, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct drm_virtgpu_winsrv_connect *args = data; + struct virtio_gpu_winsrv_conn *conn; + int ret; + + conn = kzalloc(sizeof(*conn), GFP_KERNEL); + if (!conn) + return -ENOMEM; + + conn->vgdev = vgdev; + conn->drm_file = file; + spin_lock_init(&conn->lock); +...
2019 Jul 04
2
[PATCH v6 15/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing
...t; + virtio_gpu_array_put_free(objs); > Don't we need this in non-3D case as well? No, ... > > virtio_gpu_cmd_transfer_to_host_3d > > - (vgdev, qobj, > > + (vgdev, > > vfpriv ? vfpriv->ctx_id : 0, offset, > > - args->level, &box, fence); > > - reservation_object_add_excl_fence(qobj->base.base.resv, > > - &fence->f); > > +...
2019 Jul 04
2
[PATCH v6 15/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing
...t; + virtio_gpu_array_put_free(objs); > Don't we need this in non-3D case as well? No, ... > > virtio_gpu_cmd_transfer_to_host_3d > > - (vgdev, qobj, > > + (vgdev, > > vfpriv ? vfpriv->ctx_id : 0, offset, > > - args->level, &box, fence); > > - reservation_object_add_excl_fence(qobj->base.base.resv, > > - &fence->f); > > +...
2019 Jul 02
2
[PATCH v6 16/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource
...dex 6baf64141645..e75819dbba80 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -111,19 +111,18 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj, { struct virtio_gpu_device *vgdev = obj->dev->dev_private; struct virtio_gpu_fpriv *vfpriv = file->driver_priv; - struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); - int r; + struct virtio_gpu_object_array *objs; if (!vgdev->has_virgl_3d) return 0; - r = virtio_gpu_object_reserve(qobj); - if (r) - return r; + objs = virtio_gpu_array_alloc(1); + if (!objs) + re...
2019 Jul 02
2
[PATCH v6 16/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource
...dex 6baf64141645..e75819dbba80 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -111,19 +111,18 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj, { struct virtio_gpu_device *vgdev = obj->dev->dev_private; struct virtio_gpu_fpriv *vfpriv = file->driver_priv; - struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); - int r; + struct virtio_gpu_object_array *objs; if (!vgdev->has_virgl_3d) return 0; - r = virtio_gpu_object_reserve(qobj); - if (r) - return r; + objs = virtio_gpu_array_alloc(1); + if (!objs) + re...
2019 Jul 02
2
[PATCH v6 15/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing
...6..b220918df6a1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -341,47 +341,44 @@ static int virtio_gpu_transfer_to_host_ioctl(struct drm_device *dev, void *data, struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_fpriv *vfpriv = file->driver_priv; struct drm_virtgpu_3d_transfer_to_host *args = data; - struct drm_gem_object *gobj = NULL; - struct virtio_gpu_object *qobj = NULL; + struct virtio_gpu_object_array *objs; struct virtio_gpu_fence *fence; struct virtio_gpu_box box; int ret; u32 offset = args->off...
2019 Jul 02
2
[PATCH v6 15/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing
...6..b220918df6a1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -341,47 +341,44 @@ static int virtio_gpu_transfer_to_host_ioctl(struct drm_device *dev, void *data, struct virtio_gpu_device *vgdev = dev->dev_private; struct virtio_gpu_fpriv *vfpriv = file->driver_priv; struct drm_virtgpu_3d_transfer_to_host *args = data; - struct drm_gem_object *gobj = NULL; - struct virtio_gpu_object *qobj = NULL; + struct virtio_gpu_object_array *objs; struct virtio_gpu_fence *fence; struct virtio_gpu_box box; int ret; u32 offset = args->off...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...o_gpu_mode_dumb_mmap(struct drm_file *file_priv, drm_gem_object_unreference_unlocked(gobj); return 0; } + +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); + int r; + + if (!vgdev->has_virgl_3d) + return 0; + + r = virtio_gpu_object_reserve(qobj, false); + if (r) + return r; + + virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, + qobj-...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...o_gpu_mode_dumb_mmap(struct drm_file *file_priv, drm_gem_object_unreference_unlocked(gobj); return 0; } + +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); + int r; + + if (!vgdev->has_virgl_3d) + return 0; + + r = virtio_gpu_object_reserve(qobj, false); + if (r) + return r; + + virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, + qobj-...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...o_gpu_mode_dumb_mmap(struct drm_file *file_priv, drm_gem_object_unreference_unlocked(gobj); return 0; } + +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); + int r; + + if (!vgdev->has_virgl_3d) + return 0; + + r = virtio_gpu_object_reserve(qobj, false); + if (r) + return r; + + virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, + qobj-...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...o_gpu_mode_dumb_mmap(struct drm_file *file_priv, drm_gem_object_unreference_unlocked(gobj); return 0; } + +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); + int r; + + if (!vgdev->has_virgl_3d) + return 0; + + r = virtio_gpu_object_reserve(qobj, false); + if (r) + return r; + + virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, + qobj-...
2015 Sep 21
0
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...iv, > drm_gem_object_unreference_unlocked(gobj); > return 0; > } > + > +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, > + struct drm_file *file) > +{ > + struct virtio_gpu_device *vgdev = obj->dev->dev_private; > + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; > + struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); > + int r; > + > + if (!vgdev->has_virgl_3d) > + return 0; > + > + r = virtio_gpu_object_reserve(qobj, false); > + if (r) > + return r; > + > + virtio_gpu_cmd_context_attac...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...o_gpu_mode_dumb_mmap(struct drm_file *file_priv, drm_gem_object_unreference_unlocked(gobj); return 0; } + +int virtio_gpu_gem_object_open(struct drm_gem_object *obj, + struct drm_file *file) +{ + struct virtio_gpu_device *vgdev = obj->dev->dev_private; + struct virtio_gpu_fpriv *vfpriv = file->driver_priv; + struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); + int r; + + if (!vgdev->has_virgl_3d) + return 0; + + r = virtio_gpu_object_reserve(qobj, false); + if (r) + return r; + + virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, + qobj-...