search for: virtio_gpu_cmd_unref_cb

Displaying 6 results from an estimated 6 matches for "virtio_gpu_cmd_unref_cb".

2020 Feb 05
2
[PATCH 2/4] drm/virtio: resource teardown tweaks
..._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; } +static void virtio_gpu_cmd_unref_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer *vbuf) +{ + struct virtio_gpu_object *bo; + + bo = gem_to_virtio_gpu_obj(vbuf->objs->objs[0]); + kfree(vbuf->objs); + vbuf->objs = NULL; + + virtio_gpu_cleanup_object(bo); +} + void virtio_gpu_cmd_unref_resource(struct...
2020 Feb 05
2
[PATCH 2/4] drm/virtio: resource teardown tweaks
..._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; } +static void virtio_gpu_cmd_unref_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer *vbuf) +{ + struct virtio_gpu_object *bo; + + bo = gem_to_virtio_gpu_obj(vbuf->objs->objs[0]); + kfree(vbuf->objs); + vbuf->objs = NULL; + + virtio_gpu_cleanup_object(bo); +} + void virtio_gpu_cmd_unref_resource(struct...
2020 Feb 06
1
[PATCH 2/4] drm/virtio: resource teardown tweaks
...> - > > - drm_gem_shmem_free_object(obj); > > + if (bo->created) { > > + virtio_gpu_cmd_unref_resource(vgdev, bo); > > + /* completion handler calls virtio_gpu_cleanup_object() */ > nitpick: we don't need this comment when virtio_gpu_cmd_unref_cb is > defined by this file and passed to virtio_gpu_cmd_unref_resource. I want virtio_gpu_cmd_unref_cb + virtio_gpu_cmd_unref_resource being placed next to each other so it is easier to see how they work hand in hand. > I happen to be looking at our error handling paths. I think we want &gt...
2020 Feb 05
0
[PATCH 2/4] drm/virtio: resource teardown tweaks
..., bo->hw_res_handle); > - > - drm_gem_shmem_free_object(obj); > + if (bo->created) { > + virtio_gpu_cmd_unref_resource(vgdev, bo); > + /* completion handler calls virtio_gpu_cleanup_object() */ nitpick: we don't need this comment when virtio_gpu_cmd_unref_cb is defined by this file and passed to virtio_gpu_cmd_unref_resource. I happen to be looking at our error handling paths. I think we want virtio_gpu_queue_fenced_ctrl_buffer to call vbuf->resp_cb on errors. > + return; > + } > + virtio_gpu_cleanup_object(bo)...
2020 Feb 07
0
[PATCH v2 2/4] drm/virtio: resource teardown tweaks
...e, + 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 = true; } +static void virtio_gpu_cmd_unref_cb(struct virtio_gpu_device *vgdev, + struct virtio_gpu_vbuffer *vbuf) +{ + struct virtio_gpu_object *bo; + + bo = vbuf->resp_cb_data; + vbuf->resp_cb_data = NULL; + + virtio_gpu_cleanup_object(bo); +} + void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, - uint32_t...
2020 Sep 08
0
[PATCH 3/3] drm/virtio: add virtio_gpu_cmd_unref_resource error handling
...c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -536,6 +536,7 @@ void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, { struct virtio_gpu_resource_unref *cmd_p; struct virtio_gpu_vbuffer *vbuf; + int ret; cmd_p = virtio_gpu_alloc_cmd_cb(vgdev, &vbuf, sizeof(*cmd_p), virtio_gpu_cmd_unref_cb); @@ -545,7 +546,9 @@ void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, cmd_p->resource_id = cpu_to_le32(bo->hw_res_handle); vbuf->resp_cb_data = bo; - virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); + ret = virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); + if (ret < 0) +...