Lines Matching refs:bo
31 struct fd_bo *bo = &virtio_bo->base;
34 .handle = bo->handle,
38 ret = drmIoctl(bo->dev->fd, DRM_IOCTL_VIRTGPU_MAP, &req);
51 virtio_bo_offset(struct fd_bo *bo, uint64_t *offset)
53 struct virtio_bo *virtio_bo = to_virtio_bo(bo);
62 virtio_bo_cpu_prep_guest(struct fd_bo *bo)
65 .handle = bo->handle,
70 ret = drmIoctl(bo->dev->fd, DRM_IOCTL_VIRTGPU_WAIT, &args);
78 virtio_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
86 * know about usage of the bo in the host (or other guests).
89 ret = virtio_bo_cpu_prep_guest(bo);
96 if (!bo->shared)
107 .res_id = to_virtio_bo(bo)->res_id,
114 rsp = virtio_alloc_rsp(bo->dev, &req.hdr, sizeof(*rsp));
116 ret = virtio_execbuf(bo->dev, &req.hdr, true);
128 virtio_bo_cpu_fini(struct fd_bo *bo)
134 virtio_bo_madvise(struct fd_bo *bo, int willneed)
146 virtio_bo_iova(struct fd_bo *bo)
148 /* The shmem bo is allowed to have no iova, as it is only used for
151 assert(bo->iova || (to_virtio_bo(bo)->blob_id == 0));
152 return bo->iova;
156 virtio_bo_set_name(struct fd_bo *bo, const char *fmt, va_list ap)
161 /* Note, we cannot set name on the host for the shmem bo, as
165 if (!bo->iova)
177 req->res_id = to_virtio_bo(bo)->res_id;
182 virtio_execbuf(bo->dev, &req->hdr, false);
186 bo_upload(struct fd_bo *bo, unsigned off, void *src, unsigned len)
194 req->res_id = to_virtio_bo(bo)->res_id;
201 virtio_execbuf(bo->dev, &req->hdr, false);
205 virtio_bo_upload(struct fd_bo *bo, void *src, unsigned len)
210 bo_upload(bo, off, src, sz);
218 set_iova(struct fd_bo *bo, uint64_t iova)
222 .res_id = to_virtio_bo(bo)->res_id,
226 virtio_execbuf(bo->dev, &req.hdr, false);
230 virtio_bo_destroy(struct fd_bo *bo)
232 struct virtio_bo *virtio_bo = to_virtio_bo(bo);
235 if (bo->iova) {
236 set_iova(bo, 0);
238 virtio_dev_free_iova(bo->dev, bo->iova, bo->size);
244 virtio_execbuf_flush(bo->dev);
265 struct fd_bo *bo;
271 bo = &virtio_bo->base;
276 bo->dev = dev;
277 p_atomic_set(&bo->refcnt, 1);
279 bo->size = size;
280 bo->funcs = &funcs;
281 bo->handle = handle;
283 /* Don't assume we can mmap an imported bo: */
284 bo->alloc_flags = FD_BO_NOMAP;
300 fd_bo_init_common(bo, dev);
302 return bo;
309 struct fd_bo *bo = bo_from_handle(dev, size, handle);
311 if (!bo)
314 bo->iova = virtio_dev_alloc_iova(dev, size);
315 if (!bo->iova)
318 set_iova(bo, bo->iova);
320 return bo;
323 virtio_bo_destroy(bo);
373 * is used to like the created bo to the get_blob() call
391 struct fd_bo *bo = bo_from_handle(dev, size, args.bo_handle);
392 struct virtio_bo *virtio_bo = to_virtio_bo(bo);
395 bo->iova = req.iova;
397 return bo;