search for: virtio_gpu_alloc_cmd_resp

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

2020 Feb 05
0
[PATCH 1/4] drm/virtio: simplify virtio_gpu_alloc_cmd
Just call virtio_gpu_alloc_cmd_resp with some fixed args instead of duplicating most of the function body. Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/virtio/virtgpu_vq.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq...
2020 Feb 07
0
[PATCH v2 1/4] drm/virtio: simplify virtio_gpu_alloc_cmd
Just call virtio_gpu_alloc_cmd_resp with some fixed args instead of duplicating most of the function body. Signed-off-by: Gerd Hoffmann <kraxel at redhat.com> --- drivers/gpu/drm/virtio/virtgpu_vq.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_v...
2020 Feb 05
2
[PATCH 2/4] drm/virtio: resource teardown tweaks
...void *virtio_gpu_alloc_cmd(struct virtio_gpu_device *vgdev, sizeof(struct virtio_gpu_ctrl_hdr), NULL); } +static void *virtio_gpu_alloc_cmd_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer **vbuffer_p, + int size, + virtio_gpu_resp_cb cb) +{ + return virtio_gpu_alloc_cmd_resp(vgdev, cb, vbuffer_p, size, + sizeof(struct virtio_gpu_ctrl_hdr), NULL); +} + static void free_vbuf(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf) { @@ -494,17 +503,37 @@ void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, bo->created = true;...
2020 Feb 05
2
[PATCH 2/4] drm/virtio: resource teardown tweaks
...void *virtio_gpu_alloc_cmd(struct virtio_gpu_device *vgdev, sizeof(struct virtio_gpu_ctrl_hdr), NULL); } +static void *virtio_gpu_alloc_cmd_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer **vbuffer_p, + int size, + virtio_gpu_resp_cb cb) +{ + return virtio_gpu_alloc_cmd_resp(vgdev, cb, vbuffer_p, size, + sizeof(struct virtio_gpu_ctrl_hdr), NULL); +} + static void free_vbuf(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf) { @@ -494,17 +503,37 @@ void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, bo->created = true;...
2020 May 28
0
Potential Memory Leak Bugs in drivers/gpu/drm/virtio/virtgpu_vq.c (Linux 5.6).
...ou can help me to confirm them. Thank you. Sorry. Not confirmed. You should do a better job verifying your claims before bugging people. > The first one is resp_buf will not be release in > virtio_gpu_cmd_get_display_info() with the condition > (resp_size <= MAX_INLINE_RESP_SIZE) in virtio_gpu_alloc_cmd_resp(). In that code path resp_size equals sizeof(struct virtio_gpu_resp_display_info) which is larger than MAX_INLINE_RESP_SIZE so the condition is never true and no leak happens. take care, Gerd
2020 Aug 18
0
[PATCH v6 0/3] Support virtio cross-device resources
...FILE: drivers/gpu/drm/virtio/virtgpu_vq.c:1124: + if (resp_type == VIRTIO_GPU_RESP_OK_RESOURCE_UUID && + obj->uuid_state == UUID_INITIALIZING) { -:286: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #286: FILE: drivers/gpu/drm/virtio/virtgpu_vq.c:1154: + cmd_p = virtio_gpu_alloc_cmd_resp(vgdev, + virtio_gpu_cmd_resource_uuid_cb, &vbuf, sizeof(*cmd_p), total: 0 errors, 0 warnings, 4 checks, 250 lines checked + exit 1
2020 Feb 07
0
[PATCH v2 2/4] drm/virtio: resource teardown tweaks
...pu_vq.c @@ -164,6 +164,16 @@ static void *virtio_gpu_alloc_cmd(struct virtio_gpu_device *vgdev, NULL); } +static void *virtio_gpu_alloc_cmd_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer **vbuffer_p, + int size, + virtio_gpu_resp_cb cb) +{ + return virtio_gpu_alloc_cmd_resp(vgdev, cb, vbuffer_p, size, + sizeof(struct virtio_gpu_ctrl_hdr), + NULL); +} + static void free_vbuf(struct virtio_gpu_device *vgdev, struct virtio_gpu_vbuffer *vbuf) { @@ -507,18 +517,31 @@ void virtio_gpu_cmd_create_resource(struct virtio_gpu_device *vgdev, bo->created...
2019 Jun 05
10
[PATCH 1/4] drm/virtio: Ensure cached capset entries are valid before copying.
From: David Riley <davidriley at chromium.org> virtio_gpu_get_caps_ioctl could return success with invalid data if a second caller to the function occurred after the entry was created in virtio_gpu_cmd_get_capset but prior to the virtio_gpu_cmd_capset_cb callback being called. This could leak contents of memory as well since the caps_cache allocation is done without zeroing.
2020 Feb 05
0
[PATCH 2/4] drm/virtio: resource teardown tweaks
...t; +static void *virtio_gpu_alloc_cmd_cb(struct virtio_gpu_device *vgdev, > + struct virtio_gpu_vbuffer **vbuffer_p, > + int size, > + virtio_gpu_resp_cb cb) > +{ > + return virtio_gpu_alloc_cmd_resp(vgdev, cb, vbuffer_p, size, > + sizeof(struct virtio_gpu_ctrl_hdr), NULL); > +} > + > static void free_vbuf(struct virtio_gpu_device *vgdev, > struct virtio_gpu_vbuffer *vbuf) > { > @@ -494,17 +503,37 @@ void virtio...
2018 Sep 13
0
[PATCH 3/3] drm/virtio: add edid support
...*vbuf; + void *resp_buf; + int scanout; + + if (WARN_ON(!vgdev->has_edid)) + return -EINVAL; + + for (scanout = 0; scanout < vgdev->num_scanouts; scanout++) { + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_edid), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_edid_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_edid), + resp_buf); + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_EDID); + cmd_p->scanout = cpu_to_le32(scanout); + virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); + } + + return 0...
2020 May 13
0
[PATCH v3 4/4] drm/virtio: Support virtgpu exported resources
..._KERNEL); > + if (!resp_buf) { > + spin_lock(&vgdev->resource_export_lock); > + bo->uuid_state = UUID_INITIALIZATION_FAILED; > + spin_unlock(&vgdev->resource_export_lock); > + virtio_gpu_array_put_free(objs); > + return -ENOMEM; > + } > + > + cmd_p = virtio_gpu_alloc_cmd_resp(vgdev, > + virtio_gpu_cmd_resource_uuid_cb, &vbuf, sizeof(*cmd_p), > + sizeof(struct virtio_gpu_resp_resource_uuid), resp_buf); > + memset(cmd_p, 0, sizeof(*cmd_p)); > + > + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID); > + cmd_p->resource_id = cp...
2020 Mar 02
0
[virtio-dev] [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources
...esp_buf) { > + spin_lock(&vgdev->resource_export_lock); > + bo->uuid_state = UUID_INITIALIZATION_FAILED; > + spin_unlock(&vgdev->resource_export_lock); > + return -ENOMEM; > + } > + > + cmd_p = virtio_gpu_alloc_cmd_resp(vgdev, > + virtio_gpu_cmd_resource_uuid_cb, &vbuf, sizeof(*cmd_p), > + sizeof(struct virtio_gpu_resp_resource_uuid), resp_buf); > + memset(cmd_p, 0, sizeof(*cmd_p)); > + > + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UU...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...pu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) +{ + struct virtio_gpu_get_capset_info *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); + cmd_p->capset_index = cpu_to_le32(idx); + virti...
2015 Sep 21
2
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...pu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) +{ + struct virtio_gpu_get_capset_info *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); + cmd_p->capset_index = cpu_to_le32(idx); + virti...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...pu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) +{ + struct virtio_gpu_get_capset_info *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); + cmd_p->capset_index = cpu_to_le32(idx); + virti...
2015 Oct 02
0
[PATCH v3 4/7] virtio-gpu: add 3d/virgl support
...pu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) +{ + struct virtio_gpu_get_capset_info *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); + cmd_p->capset_index = cpu_to_le32(idx); + virti...
2015 Sep 21
0
[PATCH v2 4/6] virtio-gpu: add 3d/virgl support
...int idx) > +{ > + struct virtio_gpu_get_capset_info *cmd_p; > + struct virtio_gpu_vbuffer *vbuf; > + void *resp_buf; > + > + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), > + GFP_KERNEL); > + if (!resp_buf) > + return -ENOMEM; > + > + cmd_p = virtio_gpu_alloc_cmd_resp > + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, > + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), > + resp_buf); > + memset(cmd_p, 0, sizeof(*cmd_p)); > + > + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); > + cmd_p->capse...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...pu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) +{ + struct virtio_gpu_get_capset_info *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); + cmd_p->capset_index = cpu_to_le32(idx); + virti...
2015 Sep 09
3
[PATCH 3/5] update virtio gpu driver: add 3d/virgl support
...pu_cmd_get_capset_info(struct virtio_gpu_device *vgdev, int idx) +{ + struct virtio_gpu_get_capset_info *cmd_p; + struct virtio_gpu_vbuffer *vbuf; + void *resp_buf; + + resp_buf = kzalloc(sizeof(struct virtio_gpu_resp_capset_info), + GFP_KERNEL); + if (!resp_buf) + return -ENOMEM; + + cmd_p = virtio_gpu_alloc_cmd_resp + (vgdev, &virtio_gpu_cmd_get_capset_info_cb, &vbuf, + sizeof(*cmd_p), sizeof(struct virtio_gpu_resp_capset_info), + resp_buf); + memset(cmd_p, 0, sizeof(*cmd_p)); + + cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_GET_CAPSET_INFO); + cmd_p->capset_index = cpu_to_le32(idx); + virti...
2015 Mar 24
10
[PATCH] Add virtio gpu driver.
...uct virtio_gpu_vbuffer *vbuf; + + vbuf = virtio_gpu_allocate_vbuf + (vgdev, sizeof(struct virtio_gpu_update_cursor), 0, NULL); + if (IS_ERR(vbuf)) { + *vbuffer_p = NULL; + return ERR_CAST(vbuf); + } + *vbuffer_p = vbuf; + return (struct virtio_gpu_update_cursor *)vbuf->buf; +} + +static void *virtio_gpu_alloc_cmd_resp(struct virtio_gpu_device *vgdev, + virtio_gpu_resp_cb cb, + struct virtio_gpu_vbuffer **vbuffer_p, + int cmd_size, int resp_size) +{ + struct virtio_gpu_vbuffer *vbuf; + + vbuf = virtio_gpu_allocate_vbuf(vgdev, cmd_size, resp_size, cb); + if (IS_ERR(vbuf)) { + *vbuffe...