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>
This commit is contained in:
Jason Ekstrand
2016-11-01 13:09:36 -07:00
parent ba1eea4f95
commit 6283b6d56a
4 changed files with 21 additions and 20 deletions

View File

@@ -270,6 +270,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.