summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-11-01 13:09:36 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-09 23:28:03 +0000
commitc4643f5f1eb431e6780ec263dbdfe21796b0bf5d (patch)
tree66c0c6d6bbc1d0da1c7e6dee42fb6a7cbf3c85c8 /src/intel/vulkan/anv_private.h
parentceefe979c6b8c37d7166da5beefc9334fdabaa43 (diff)
downloadexternal_mesa3d-c4643f5f1eb431e6780ec263dbdfe21796b0bf5d.zip
external_mesa3d-c4643f5f1eb431e6780ec263dbdfe21796b0bf5d.tar.gz
external_mesa3d-c4643f5f1eb431e6780ec263dbdfe21796b0bf5d.tar.bz2
anv: Add a new bo_pool_init helper
This ensures that we're always setting all of the fields in anv_bo Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 6283b6d56a2bb731cfcb4c876566901075f9bd34)
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 3b17171..b4f7e92 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -267,6 +267,17 @@ struct anv_bo {
bool is_winsys_bo;
};
+static inline void
+anv_bo_init(struct anv_bo *bo, uint32_t gem_handle, uint64_t size)
+{
+ bo->gem_handle = gem_handle;
+ bo->index = 0;
+ bo->offset = 0;
+ bo->size = size;
+ bo->map = NULL;
+ bo->is_winsys_bo = false;
+}
+
/* Represents a lock-free linked list of "free" things. This is used by
* both the block pool and the state pools. Unfortunately, in order to
* solve the ABA problem, we can't use a single uint32_t head.