mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
gallium/radeon: add radeon_winsys::buffer_is_suballocated
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
0f13451da3
commit
91f72975ac
3 changed files with 17 additions and 0 deletions
|
|
@ -360,6 +360,9 @@ struct radeon_winsys {
|
|||
*/
|
||||
bool (*buffer_is_user_ptr)(struct pb_buffer *buf);
|
||||
|
||||
/** Whether the buffer was suballocated. */
|
||||
bool (*buffer_is_suballocated)(struct pb_buffer *buf);
|
||||
|
||||
/**
|
||||
* Get a winsys handle from a winsys buffer. The internal structure
|
||||
* of the handle is platform-specific and only a winsys should access it.
|
||||
|
|
|
|||
|
|
@ -1410,6 +1410,13 @@ static bool amdgpu_bo_is_user_ptr(struct pb_buffer *buf)
|
|||
return ((struct amdgpu_winsys_bo*)buf)->user_ptr != NULL;
|
||||
}
|
||||
|
||||
static bool amdgpu_bo_is_suballocated(struct pb_buffer *buf)
|
||||
{
|
||||
struct amdgpu_winsys_bo *bo = (struct amdgpu_winsys_bo*)buf;
|
||||
|
||||
return !bo->bo && !bo->sparse;
|
||||
}
|
||||
|
||||
static uint64_t amdgpu_bo_get_va(struct pb_buffer *buf)
|
||||
{
|
||||
return ((struct amdgpu_winsys_bo*)buf)->va;
|
||||
|
|
@ -1426,6 +1433,7 @@ void amdgpu_bo_init_functions(struct amdgpu_winsys *ws)
|
|||
ws->base.buffer_from_handle = amdgpu_bo_from_handle;
|
||||
ws->base.buffer_from_ptr = amdgpu_bo_from_ptr;
|
||||
ws->base.buffer_is_user_ptr = amdgpu_bo_is_user_ptr;
|
||||
ws->base.buffer_is_suballocated = amdgpu_bo_is_suballocated;
|
||||
ws->base.buffer_get_handle = amdgpu_bo_get_handle;
|
||||
ws->base.buffer_commit = amdgpu_bo_sparse_commit;
|
||||
ws->base.buffer_get_virtual_address = amdgpu_bo_get_va;
|
||||
|
|
|
|||
|
|
@ -1290,6 +1290,11 @@ static bool radeon_winsys_bo_is_user_ptr(struct pb_buffer *buf)
|
|||
return ((struct radeon_bo*)buf)->user_ptr != NULL;
|
||||
}
|
||||
|
||||
static bool radeon_winsys_bo_is_suballocated(struct pb_buffer *buf)
|
||||
{
|
||||
return !((struct radeon_bo*)buf)->handle;
|
||||
}
|
||||
|
||||
static uint64_t radeon_winsys_bo_va(struct pb_buffer *buf)
|
||||
{
|
||||
return ((struct radeon_bo*)buf)->va;
|
||||
|
|
@ -1316,6 +1321,7 @@ void radeon_drm_bo_init_functions(struct radeon_drm_winsys *ws)
|
|||
ws->base.buffer_from_handle = radeon_winsys_bo_from_handle;
|
||||
ws->base.buffer_from_ptr = radeon_winsys_bo_from_ptr;
|
||||
ws->base.buffer_is_user_ptr = radeon_winsys_bo_is_user_ptr;
|
||||
ws->base.buffer_is_suballocated = radeon_winsys_bo_is_suballocated;
|
||||
ws->base.buffer_get_handle = radeon_winsys_bo_get_handle;
|
||||
ws->base.buffer_get_virtual_address = radeon_winsys_bo_va;
|
||||
ws->base.buffer_get_reloc_offset = radeon_winsys_bo_get_reloc_offset;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue