diff options
author | Bas Nieuwenhuizen <[email protected]> | 2018-01-04 18:38:32 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-01-19 01:43:55 +0100 |
commit | b1444c9ccb06661d932969302d19166df442818c (patch) | |
tree | 030cbb2059debe66b295183776ce4676cbeab0f8 /src/amd/vulkan/radv_private.h | |
parent | a3e241ed07feae592d1fd83db388252816a32849 (diff) |
radv: Implement VK_ANDROID_native_buffer.
Passes
dEQP-VK.api.smoke.*
dEQP-VK.wsi.android.*
with android-cts-7.1_r12 .
Unlike the initial anv implementation this does
use syncobjs instead of waiting on the CPU.
This is missing meson build coverage for now.
One possible todo is that linux 4.15 now has a
sycall that allows us to export amdgpu fence to
a sync_file, which allows us not to force all
fences and semaphores to use syncobjs. However,
I had trouble with my kernel crashing regularly
with NULL pointers, and I'm not sure how beneficial
it is in the first place given that intel uses
syncobjs for all fences if available.
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_private.h')
-rw-r--r-- | src/amd/vulkan/radv_private.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index c8a673756fe..fedbb5d29f7 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -70,6 +70,7 @@ typedef uint32_t xcb_window_t; #include <vulkan/vulkan.h> #include <vulkan/vulkan_intel.h> #include <vulkan/vk_icd.h> +#include <vulkan/vk_android_native_buffer.h> #include "radv_entrypoints.h" @@ -587,6 +588,7 @@ struct radv_device { int queue_count[RADV_MAX_QUEUE_FAMILIES]; struct radeon_winsys_cs *empty_cs[RADV_MAX_QUEUE_FAMILIES]; + bool always_use_syncobj; bool llvm_supports_spill; bool has_distributed_tess; bool pbb_allowed; @@ -1374,6 +1376,9 @@ struct radv_image { struct radv_cmask_info cmask; uint64_t clear_value_offset; uint64_t dcc_pred_offset; + + /* For VK_ANDROID_native_buffer, the WSI image owns the memory, */ + VkDeviceMemory owned_memory; }; /* Whether the image has a htile that is known consistent with the contents of @@ -1468,6 +1473,13 @@ VkResult radv_image_create(VkDevice _device, const VkAllocationCallbacks* alloc, VkImage *pImage); +VkResult +radv_image_from_gralloc(VkDevice device_h, + const VkImageCreateInfo *base_info, + const VkNativeBufferANDROID *gralloc_info, + const VkAllocationCallbacks *alloc, + VkImage *out_image_h); + void radv_image_view_init(struct radv_image_view *view, struct radv_device *device, const VkImageViewCreateInfo* pCreateInfo); |