- return bo;
-}
-
-struct nouveau_bo *
-nouveau_screen_bo_user(struct pipe_screen *pscreen, void *ptr, unsigned bytes)
-{
- struct nouveau_device *dev = nouveau_screen(pscreen)->device;
- struct nouveau_bo *bo = NULL;
- int ret;
-
- ret = nouveau_bo_user(dev, ptr, bytes, &bo);
- if (ret)
- return NULL;
-
- return bo;
-}
-
-void *
-nouveau_screen_bo_map(struct pipe_screen *pscreen,
- struct nouveau_bo *bo,
- unsigned map_flags)
-{
- int ret;
-
- ret = nouveau_bo_map(bo, map_flags);
- if (ret) {
- debug_printf("map failed: %d\n", ret);
- return NULL;
- }
-
- return bo->map;
-}
-
-void *
-nouveau_screen_bo_map_range(struct pipe_screen *pscreen, struct nouveau_bo *bo,
- unsigned offset, unsigned length, unsigned flags)
-{
- int ret;
-
- ret = nouveau_bo_map_range(bo, offset, length, flags);
- if (ret) {
- nouveau_bo_unmap(bo);
- if (!(flags & NOUVEAU_BO_NOWAIT) || ret != -EBUSY)
- debug_printf("map_range failed: %d\n", ret);
- return NULL;
- }
-
- return (char *)bo->map - offset; /* why gallium? why? */
-}
-
-void
-nouveau_screen_bo_map_flush_range(struct pipe_screen *pscreen, struct nouveau_bo *bo,
- unsigned offset, unsigned length)
-{
- nouveau_bo_map_flush(bo, offset, length);
-}
-
-void
-nouveau_screen_bo_unmap(struct pipe_screen *pscreen, struct nouveau_bo *bo)
-{
- nouveau_bo_unmap(bo);
-}
-
-void
-nouveau_screen_bo_release(struct pipe_screen *pscreen, struct nouveau_bo *bo)
-{
- nouveau_bo_ref(NULL, &bo);