aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_intel.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-11-01 13:09:36 -0700
committerJason Ekstrand <[email protected]>2016-11-09 11:30:59 -0800
commit6283b6d56a2bb731cfcb4c876566901075f9bd34 (patch)
treea5376832550daa6c849042812b57a2a9a9159bbc /src/intel/vulkan/anv_intel.c
parentba1eea4f957ca068eceea121bc3a70e2fe07873d (diff)
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 <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Cc: "13.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_intel.c')
-rw-r--r--src/intel/vulkan/anv_intel.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_intel.c b/src/intel/vulkan/anv_intel.c
index 3e1cc3f31a3..1c50e2bdd38 100644
--- a/src/intel/vulkan/anv_intel.c
+++ b/src/intel/vulkan/anv_intel.c
@@ -49,16 +49,15 @@ VkResult anv_CreateDmaBufImageINTEL(
if (mem == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- mem->bo.gem_handle = anv_gem_fd_to_handle(device, pCreateInfo->fd);
- if (!mem->bo.gem_handle) {
+ uint32_t gem_handle = anv_gem_fd_to_handle(device, pCreateInfo->fd);
+ if (!gem_handle) {
result = vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY);
goto fail;
}
- mem->bo.map = NULL;
- mem->bo.index = 0;
- mem->bo.offset = 0;
- mem->bo.size = pCreateInfo->strideInBytes * pCreateInfo->extent.height;
+ uint64_t size = pCreateInfo->strideInBytes * pCreateInfo->extent.height;
+
+ anv_bo_init(&mem->bo, gem_handle, size);
anv_image_create(_device,
&(struct anv_image_create_info) {