diff options
| author | 2022-07-22 23:08:30 +0000 | |
|---|---|---|
| committer | 2022-07-25 17:44:46 +0000 | |
| commit | 51572c2fd5edb70bfff0b23577f3a596c92fde19 (patch) | |
| tree | 189da15e54b11dbbcc07155c306b8c8d969985c6 /vulkan/libvulkan | |
| parent | 71e68dcfc44e3bba6f729684fa2f46444a6df24c (diff) | |
vulkan: respect consumer default dataspace upon PASS_THROUGH
Most of the HWC backends don't consume HAL_DATASPACE_ARBITRARY, and will
end up with client composition. This change fixes the Surface to clear
the prior requested dataspace leftover upon disconnect, and let vulkan
swapchain to skip setting dataspace upon PASS_THROUGH.
Bug: 239893387
Test: android.view.cts.DisplayRefreshRateTest#testRefreshRate with angle
Test: android.media.cts.EncodeDecodeTest with angle
Test: dEQP-EGL.* with angle
Test: dEQP-VK.wsi.android.*
Change-Id: Iba1d9160569ad6136127cf8055aa75f195fed3d9
Diffstat (limited to 'vulkan/libvulkan')
| -rw-r--r-- | vulkan/libvulkan/swapchain.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp index 0afbe11a6b..b6a1199532 100644 --- a/vulkan/libvulkan/swapchain.cpp +++ b/vulkan/libvulkan/swapchain.cpp @@ -1218,11 +1218,15 @@ VkResult CreateSwapchainKHR(VkDevice device, native_pixel_format, strerror(-err), err); return VK_ERROR_SURFACE_LOST_KHR; } - err = native_window_set_buffers_data_space(window, native_dataspace); - if (err != android::OK) { - ALOGE("native_window_set_buffers_data_space(%d) failed: %s (%d)", - native_dataspace, strerror(-err), err); - return VK_ERROR_SURFACE_LOST_KHR; + + /* Respect consumer default dataspace upon HAL_DATASPACE_ARBITRARY. */ + if (native_dataspace != HAL_DATASPACE_ARBITRARY) { + err = native_window_set_buffers_data_space(window, native_dataspace); + if (err != android::OK) { + ALOGE("native_window_set_buffers_data_space(%d) failed: %s (%d)", + native_dataspace, strerror(-err), err); + return VK_ERROR_SURFACE_LOST_KHR; + } } err = native_window_set_buffers_dimensions( |