novueau/bo: add nouveau_ws_bo_wait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
@@ -73,3 +73,15 @@ nouveau_ws_bo_map(struct nouveau_ws_bo *bo, enum nouveau_ws_bo_map_flags flags)
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool
|
||||
nouveau_ws_bo_wait(struct nouveau_ws_bo *bo, enum nouveau_ws_bo_map_flags flags)
|
||||
{
|
||||
struct drm_nouveau_gem_cpu_prep req = {};
|
||||
|
||||
req.handle = bo->handle;
|
||||
if (flags & NOUVEAU_WS_BO_WR)
|
||||
req.flags |= NOUVEAU_GEM_CPU_PREP_WRITE;
|
||||
|
||||
return !drmCommandWrite(bo->fd, DRM_NOUVEAU_GEM_CPU_PREP, &req, sizeof(req));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ struct nouveau_ws_bo {
|
||||
struct nouveau_ws_bo *nouveau_ws_bo_new(struct nouveau_ws_device *, uint64_t size, uint64_t align, enum nouveau_ws_bo_flags);
|
||||
void nouveau_ws_bo_destroy(struct nouveau_ws_bo *);
|
||||
void *nouveau_ws_bo_map(struct nouveau_ws_bo *, enum nouveau_ws_bo_map_flags);
|
||||
bool nouveau_ws_bo_wait(struct nouveau_ws_bo *, enum nouveau_ws_bo_map_flags flags);
|
||||
|
||||
static inline void
|
||||
nouveau_ws_bo_ref(struct nouveau_ws_bo *bo)
|
||||
|
||||
Reference in New Issue
Block a user