diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-10-23 06:36:00 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-10-23 06:36:00 +0000 |
commit | b65fcab046d3a1b6b6ac315720df220925c5322e (patch) | |
tree | ff73dcc383ac0799c655ff6194cda9dacb75dde9 /lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h | |
parent | 18d6381c51e253e4c41c62619f80d9ce745b95c8 (diff) |
Merge Mesa 17.3.9
Mesa 18.x needs an ld with build-id for at least the intel code
Mesa 18.2 assumes linux only memfd syscalls in intel code
Tested by matthieu@, kettenis@ and myself on a variety of hardware and
architectures. ok kettenis@
Diffstat (limited to 'lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h')
-rw-r--r-- | lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h index 1e25897b6..10b095d7a 100644 --- a/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h +++ b/lib/mesa/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h @@ -37,6 +37,28 @@ #include "pipebuffer/pb_slab.h" +struct amdgpu_sparse_backing_chunk; + +/* + * Sub-allocation information for a real buffer used as backing memory of a + * sparse buffer. + */ +struct amdgpu_sparse_backing { + struct list_head list; + + struct amdgpu_winsys_bo *bo; + + /* Sorted list of free chunks. */ + struct amdgpu_sparse_backing_chunk *chunks; + uint32_t max_chunks; + uint32_t num_chunks; +}; + +struct amdgpu_sparse_commitment { + struct amdgpu_sparse_backing *backing; + uint32_t page; +}; + struct amdgpu_winsys_bo { struct pb_buffer base; union { @@ -53,12 +75,26 @@ struct amdgpu_winsys_bo { struct pb_slab_entry entry; struct amdgpu_winsys_bo *real; } slab; + struct { + mtx_t commit_lock; + amdgpu_va_handle va_handle; + enum radeon_bo_flag flags; + + uint32_t num_va_pages; + uint32_t num_backing_pages; + + struct list_head backing; + + /* Commitment information for each page of the virtual memory area. */ + struct amdgpu_sparse_commitment *commitments; + } sparse; } u; struct amdgpu_winsys *ws; void *user_ptr; /* from buffer_from_ptr */ - amdgpu_bo_handle bo; /* NULL for slab entries */ + amdgpu_bo_handle bo; /* NULL for slab entries and sparse buffers */ + bool sparse; uint32_t unique_id; uint64_t va; enum radeon_bo_domain initial_domain; @@ -79,6 +115,8 @@ struct amdgpu_winsys_bo { unsigned num_fences; unsigned max_fences; struct pipe_fence_handle **fences; + + bool is_local; }; struct amdgpu_slab { |