| 200 | } |
| 201 | |
| 202 | static rt_err_t virtio_gpu_unref_resource(struct virtio_gpu_device *virtio_gpu_dev, rt_uint32_t resource_id) |
| 203 | { |
| 204 | struct virtio_gpu_ctrl_hdr res; |
| 205 | struct virtio_gpu_resource_unref req; |
| 206 | |
| 207 | rt_memset(&req, 0, sizeof(req)); |
| 208 | |
| 209 | req.hdr.type = VIRTIO_GPU_CMD_RESOURCE_UNREF; |
| 210 | req.resource_id = resource_id; |
| 211 | |
| 212 | virtio_gpu_ctrl_send_command(virtio_gpu_dev, &req, sizeof(req), &res, sizeof(res)); |
| 213 | |
| 214 | if (res.type == VIRTIO_GPU_RESP_OK_NODATA) |
| 215 | { |
| 216 | return RT_EOK; |
| 217 | } |
| 218 | |
| 219 | return -RT_ERROR; |
| 220 | } |
| 221 | |
| 222 | static rt_err_t virtio_gpu_attach_backing_resource(struct virtio_gpu_device *virtio_gpu_dev, rt_uint32_t resource_id, |
| 223 | void *buffer, rt_size_t size) |
no test coverage detected