MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / virtio_gpu_unref_resource

Function virtio_gpu_unref_resource

components/drivers/virtio/virtio_gpu.c:202–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202static 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
222static 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)

Callers 1

virtio_gpu_controlFunction · 0.85

Calls 2

rt_memsetFunction · 0.85

Tested by

no test coverage detected