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_device.c | |
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_device.c')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 1d838afa3e6..152ae7e7ae6 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1108,6 +1108,9 @@ VkResult radv_CreateDevice( /* Disabled and not implemented for now. */ device->dfsm_allowed = device->pbb_allowed && false; +#ifdef ANDROID + device->always_use_syncobj = device->physical_device->rad_info.has_syncobj_wait_for_submit; +#endif #if HAVE_LLVM < 0x0400 device->llvm_supports_spill = false; @@ -2679,7 +2682,7 @@ VkResult radv_CreateFence( fence->submitted = false; fence->signalled = !!(pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT); fence->temp_syncobj = 0; - if (handleTypes) { + if (device->always_use_syncobj || handleTypes) { int ret = device->ws->create_syncobj(device->ws, &fence->syncobj); if (ret) { vk_free2(&device->alloc, pAllocator, fence); @@ -2855,7 +2858,7 @@ VkResult radv_CreateSemaphore( sem->temp_syncobj = 0; /* create a syncobject if we are going to export this semaphore */ - if (handleTypes) { + if (device->always_use_syncobj || handleTypes) { assert (device->physical_device->rad_info.has_syncobj); int ret = device->ws->create_syncobj(device->ws, &sem->syncobj); if (ret) { |