nouveau: add interface to make buffer objects global
This is useful for when GEM handles are exported and may be shared between multiple buffer objects without going through other libdrm interfaces. Signed-off-by: Dor Askayo <dor.askayo@gmail.com> Reviewed-by: Karol Herbst <git@karolherbst.de>main
parent
3bc3cca230
commit
18644eb64f
|
@ -1,3 +1,4 @@
|
||||||
|
nouveau_bo_make_global
|
||||||
nouveau_bo_map
|
nouveau_bo_map
|
||||||
nouveau_bo_name_get
|
nouveau_bo_name_get
|
||||||
nouveau_bo_name_ref
|
nouveau_bo_name_ref
|
||||||
|
|
|
@ -711,7 +711,7 @@ nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nouveau_bo_make_global(struct nouveau_bo_priv *nvbo)
|
nouveau_nvbo_make_global(struct nouveau_bo_priv *nvbo)
|
||||||
{
|
{
|
||||||
if (!nvbo->head.next) {
|
if (!nvbo->head.next) {
|
||||||
struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
|
struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
|
||||||
|
@ -722,6 +722,14 @@ nouveau_bo_make_global(struct nouveau_bo_priv *nvbo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drm_public void
|
||||||
|
nouveau_bo_make_global(struct nouveau_bo *bo)
|
||||||
|
{
|
||||||
|
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
|
||||||
|
|
||||||
|
nouveau_nvbo_make_global(nvbo);
|
||||||
|
}
|
||||||
|
|
||||||
drm_public int
|
drm_public int
|
||||||
nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle,
|
nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle,
|
||||||
struct nouveau_bo **pbo)
|
struct nouveau_bo **pbo)
|
||||||
|
@ -780,7 +788,7 @@ nouveau_bo_name_get(struct nouveau_bo *bo, uint32_t *name)
|
||||||
}
|
}
|
||||||
nvbo->name = *name = req.name;
|
nvbo->name = *name = req.name;
|
||||||
|
|
||||||
nouveau_bo_make_global(nvbo);
|
nouveau_nvbo_make_global(nvbo);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -830,7 +838,7 @@ nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
nouveau_bo_make_global(nvbo);
|
nouveau_nvbo_make_global(nvbo);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,7 @@ struct nouveau_bo {
|
||||||
int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align,
|
int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align,
|
||||||
uint64_t size, union nouveau_bo_config *,
|
uint64_t size, union nouveau_bo_config *,
|
||||||
struct nouveau_bo **);
|
struct nouveau_bo **);
|
||||||
|
void nouveau_bo_make_global(struct nouveau_bo *);
|
||||||
int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle,
|
int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle,
|
||||||
struct nouveau_bo **);
|
struct nouveau_bo **);
|
||||||
int nouveau_bo_name_ref(struct nouveau_device *v, uint32_t name,
|
int nouveau_bo_name_ref(struct nouveau_device *v, uint32_t name,
|
||||||
|
|
Loading…
Reference in New Issue