Commit graph

658 commits

Author SHA1 Message Date
Peter Collingbourne
161c76bdfa Expand HWVULKAN_HARDWARE_MODULE_ID macro.
Make the property name easier to grep for.

Change-Id: I381a06bc94e0235dc2757ff4f4b7f13fd426ff0c
2020-04-22 13:12:48 -07:00
Charlie Lao
e1b8909597 Vulkan: dynamically advertise surface formats
Adds dynamic validation of AHardwareBufferFormats and return as
VkSurfaceFormatKHR instead of hardware coded values

Test: verified on Pixel 4 with test app that it returned two pair of surface
formats
Bug: b/143296550

Merged-In: I972ea97d7930be56057c18584e84bf01331ae31f
Change-Id: I972ea97d7930be56057c18584e84bf01331ae31f
2019-12-18 13:43:18 -08:00
Anders Frostad Pedersen
f5a264a639 Merge "Vulkan: Improve error translation in CreateSwapChainKHR"
am: 46ba04dfb3

Change-Id: I680a1c55a2ae3f658391372c12a925cd7d429ec2
2019-12-02 11:58:25 -08:00
Anders Frostad Pedersen
9bb4db752d Vulkan: Improve error translation in CreateSwapChainKHR
Set VK_ERROR_OUT_OF_DEVICE_MEMORY in case the cause of the failure from
dequeueBuffer is an actual ENOMEM situation. Otherwise set
VK_ERROR_SURFACE_LOST_KHR as catch-all.

Bug: 145331195
Test: dEQP-VK.wsi.android.swapchain.create.image_extent
Change-Id: I8e7b4af3133e2a851beeda3618e24ca86279d317
Merged-In: I8e7b4af3133e2a851beeda3618e24ca86279d317
2019-11-29 18:06:46 -08:00
Colin Cross
e2d1a47949 Merge "Replace more -Weverything with -Wextra"
am: 81a9b2c7e3

Change-Id: I1c2fd60a67f0f964b98c3049de26501cdf271c73
2019-11-08 18:04:42 -08:00
Colin Cross
f83b3ca148 Replace more -Weverything with -Wextra
-Weverything is not recommended, use -Wextra.

Bug: 143713277
Test: m native
Change-Id: Ia3935fa155eac7777269ed3b97e74bc869fb58a4
Merged-In: Ia3935fa155eac7777269ed3b97e74bc869fb58a4
2019-11-09 00:56:40 +00:00
Colin Cross
cc888a22b9 Merge "Replace -Weverything with -Wextra"
am: 39a5c06ec8

Change-Id: I62204af80b72abccbb3fa6c3012c2a600ad12889
2019-11-08 12:07:55 -08:00
Colin Cross
1383d9fcd8 Replace -Weverything with -Wextra
-Weverything is not recommended, use -Wextra.

Requires adding a few more disabled warnings to libvulkan,
-Weverything appears to not turn on warnings that were disabled
by earlier command line arguments, while -Wextra does.

Bug: 143713277
Test: m native
Change-Id: I3997c2afe094deca66018e3cc43921aaecd82028
2019-11-07 11:24:55 -08:00
Xin Li
63b283ef48 DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: Ib12000b6a4897169d6035cb6f41c225014524e6f
2019-10-30 11:49:17 -07:00
Ian Elliott
2239611cfc Revert "Add 2 addtional VkFormat's to vkGetPhysicalDeviceSurfaceFormatsKHR"
This reverts commit 94ace213b8.

The Android Vulkan loader has never queried what formats are available for use
with swapchains; but has always hard-coded a list of formats.  All initial
Vulkan 1.0/1.1 drivers on Android supported those formats in order to work.
The change being reverted added to the hard-coded list, but not all drivers
support those formats for use by swapchains.  A future extension will be
created to allow the swapchain code to query which formats can be supported.

Bug: b/124942437
Test: mm
2019-10-25 12:00:11 -06:00
Nick Desaulniers
a70447192b [frameworks][native][vulkan] fix -Walloca
Alloca cannot be checked for failure. Replace alloca with dynamic memory
allocations.

Bug: 139945549
Bug: 142475221
Test: mm
Merged-In: I1a154b479c8da66e25d20dced6bf9ae269b906f8
Change-Id: Ife0a599db7f85f0c324717f526050f276fe43445
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-21 16:36:19 -07:00
Nick Desaulniers
d04f4ed28d [vulkan] fix -Wreorder-init-list
C++20 is stricter about member ordering in designated initializers than
C99.

Bug: 139945549
Test: mm
Merged-In: I8532a1b8d224605c91f2f5a046f548385243a7cf
Change-Id: I058370e89c9005ddaa70950c6bb5cdb3d4f4a8fb
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-18 13:54:03 -07:00
Yiwei Zhang
ec6c50539b Vulkan: correctly expose Vulkan entry points
This change fixes the advertisement of core Vulkan entry points as below:
1. GIPA returns a valid checked_proc for 1.1 core device APIs.
2. GDPA returns NULL for 1.1 core device APIs on a 1.0 physical device.

Bug: 134185757
Bug: 142266108
Test: dEQP-VK.memory.binding on 1.1 loader and 1.0 device ICD
Test: dEQP-VK.api.info.instance on 1.1 loader and 1.0 instance ICD
Change-Id: Ieb814516a4019f1a330178bfeb414e1450895c5c
Merged-In: I0a3e06dc04bade4f36a7e68ee2f53979c656ee4e
2019-10-17 17:52:37 -07:00
Yiwei Zhang
048084804b GpuStats: refactor single stats pieces into a uniform way
am: b1c1a377a8

Change-Id: I623d5249f785ac75403314943fd8ec715999b33a
2019-09-27 15:47:25 -07:00
Yi Kong
03445131e2 Ignore format-pedantic compiler warning
This warning was turned off globally but it is only needed for few
projects. Move the flag to the individual project blueprint files.

Test: presubmit
Change-Id: I0836e11fcf75d9eca353edf7e7290cfb84727f9a
2019-09-20 15:01:46 -07:00
Yiwei Zhang
b1c1a377a8 GpuStats: refactor single stats pieces into a uniform way
This change makes it easy for adding single stats pieces into GpuService without
adding or modifying the binder interface each time.

Bug: 141003796
Test: adb shell dumpsys gpu
Change-Id: I2907065a55d03a6c1494737e6f0a77f6e94272eb
Merged-In: I2907065a55d03a6c1494737e6f0a77f6e94272eb
2019-09-20 13:57:24 -07:00
Steven Moreland
7a10a4f543 Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iec1802ce9226570d3a02cc5242f7ca72e1370635
2019-09-09 10:46:17 -07:00
Yiwei Zhang
9eee7a7f34 Merge "libvulkan: add a nullptr check for ANativeWindow*"
am: 52d84f8f25

Change-Id: I8dfaacb87f616ae83d8762214b2821e2745cb3b7
2019-08-23 02:34:19 -07:00
Treehugger Robot
52d84f8f25 Merge "libvulkan: add a nullptr check for ANativeWindow*" 2019-08-22 17:02:30 +00:00
Yiwei Zhang
c81b532412 libvulkan: add a nullptr check for ANativeWindow*
When VK_GOOGLE_display_timing extension is in use, if the swapchain is
not in active status, during vkDestroySwapchainKHR, a nullptr checker
for the ANativeWindow* is missing and that will cause a crashing when
calling window api with window being nullptr. This change just adds a
nullptr check for that ANativeWindow*.

Bug: 134185757
Test: manual
Change-Id: Ica4543666c4aadc0a4d9a6caddaefd4ab08f8627
Merged-In: Ic8a4baf7e219cc8e1fb3838d4e4b710b242efa9c
2019-08-21 13:09:34 -07:00
Xin Li
4d90373273 DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
Bug: 136196576
Change-Id: Id1667c08d51f9bc0e8095f97944e35c8082e9bec
2019-07-09 15:15:55 -07:00
silence_dogood
3da592178b Merge "Vulkan: Fixing return code for vkQueuePresentKHR" into qt-dev
am: 5cada23f21

Change-Id: I8e8c8e33a6b1ed348a8726cbec1ce51a69abbf8d
2019-05-24 16:14:54 -07:00
Elliott Hughes
de9b9501e1 Merge "Track libziparchive API change." am: 3dd44d1973
am: 32112f0565

Change-Id: I51b605f0011926b5063a26a1541fd3bf87dccfb4
2019-05-24 13:24:18 -07:00
silence_dogood
7359759d69 Vulkan: Fixing return code for vkQueuePresentKHR
We should let vkQueuePresentKHR return VK_SUBOPTIMAL_KHR if the preTransform bit
in VkSwapchainCreateInfoKHR doesn't match the window’s current transform.

Bug: 132976488
Test: VulkanPreTransformTest
Change-Id: I409609ab84a6be0f4e8c351b1bef88784c8f086d
2019-05-23 19:11:51 -07:00
Elliott Hughes
c1f2485d9b Track libziparchive API change.
Bug: http://b/129068177
Test: treehugger
Change-Id: I4bd7c229200c3b651fdda1868736cfc7785cac6a
2019-05-22 19:47:17 -07:00
Ian Elliott
81196b54e7 Merge "Vulkan: Ensure swapchain gets enough images for MAILBOX." into qt-dev
am: df542f63e1

Change-Id: I56b5cabc83f8c27c3322b50c62c9598cea3b4e8c
2019-05-17 07:26:28 -07:00
Ian Elliott
df542f63e1 Merge "Vulkan: Ensure swapchain gets enough images for MAILBOX." into qt-dev 2019-05-17 14:13:43 +00:00
Ian Elliott
a3515f424c Vulkan: Ensure swapchain gets enough images for MAILBOX.
The Vulkan specification for MAILBOX allows for a swapchain to be
created with 3 images, assuming 1 "current image": one image is
displayed, and the app can ping-pong between the other 2.
MAILBOX mode is the equivalent of eglSwapInterval(0).
The platform swapchain code always added min_undequeued_buffers-1
(i.e. normally 1) to what the app requested for MAILBOX.

Apps often request the advertised minimum of 2.  However, a SF and HWC
change, some time ago, resulted in HWC displaying 1 image, SF latching
another image, and the app blocked ~30% of the time.  This equates to
a "current image" count of 2, breaking MAILBOX with 3 images.  Nobody
noticed this until ANGLE discovered that the glmark2 composite score
decreased when it only asked for minimum (2) images (per the spec).

Analysis determined that 4 images are needed in order to get the
ping-pong semantics of MAILBOX, and to not slow down benchmarks.  When
this was tried, glmark2's composite score increased by 30%.

In talking with the SF team, we realized what happened.  The agreement
is that we need to ensure that the Vulkan swapchain code needs to
ensure that the swapchain has at least 4 images (in the normal case)
when MAILBOX is enabled.  This CL still honors min_undequeued_buffers,
for cases when it's higher than the normal 2 for MAILBOX.

Bug: b/132806469
Test: Run glmark2 with ANGLE
Change-Id: I152f61f318236fd4718895aec7188135ee849f46
2019-05-16 20:01:21 -06:00
Yiwei Zhang
84e46603cc [RESTRICT AUTOMERGE] libvulkan: drop the advertised swapchain spec version to 68
Bug: 130182551
Test: build and CtsDeqpTestCases
Change-Id: If8b7e59879c9eaf1ee453cb43f2d4a7f06bf0ac9
(cherry picked from commit ee7a9ca859)
2019-05-14 19:52:15 +00:00
Yiwei Zhang
debaea3b56 GpuStats: track CPU Vulkan implementation usage
am: 8c5e3bde15

Change-Id: Iea3986a9fd22263b526b45b934f3e0e43bd618a0
2019-05-10 12:58:38 -07:00
Ian Elliott
6a1e0e4768 Merge "Have vkGetRefreshCycleDurationGOOGLE query SF every time." into qt-dev
am: cf7c96e513

Change-Id: I5c7a8679a9bea96d2d2051fd6e15762c4bf7f383
2019-05-10 00:01:41 -07:00
Yiwei Zhang
8c5e3bde15 GpuStats: track CPU Vulkan implementation usage
Bug: 131927737
Test: test on both GPU and CPU Vulkan implementations
Change-Id: I36de47e14cd132a779d9f39fdc19325d4772bb9a
2019-05-09 23:46:39 +00:00
Elliott Hughes
7d3f0005b8 Merge "libvulkan: track libziparchive API change." am: 237d9b27cd
am: ae12055857

Change-Id: I91706dbd28947ef7e43967aaa6fe56909ad97200
2019-05-09 16:30:53 -07:00
Elliott Hughes
ae12055857 Merge "libvulkan: track libziparchive API change."
am: 237d9b27cd

Change-Id: Ied14bc6170aa0cc2c8f092808704306deded3de8
2019-05-09 14:55:02 -07:00
Elliott Hughes
544920442c libvulkan: track libziparchive API change.
Bug: http://b/129068177
Test: treehugger
Change-Id: Ie494ce2275d90ac385aed89c2ed6c4d235230a50
2019-05-08 12:00:32 -07:00
Ian Elliott
3568bfe0b7 Have vkGetRefreshCycleDurationGOOGLE query SF every time.
When VK_GOOGLE_display_timing was first created, we assumed displays
never changed refresh rates.  Now that they are dynamic, we need to
query SF everytime the app requests it.

Test: ANGLE-on-Vulkan
Bug: b/130888074
Change-Id: I5eb9a20690f82b8663899a2ded8b5bb866cebe58
2019-05-03 15:58:39 -06:00
Yiwei Zhang
ee6e379e19 [RESTRICT AUTOMERGE] libvulkan: drop the advertised swapchain spec version to 68
Bug: 130182551
Test: build and CtsDeqpTestCases
Change-Id: If8b7e59879c9eaf1ee453cb43f2d4a7f06bf0ac9
2019-04-25 11:34:55 -07:00
Jesse Hall
c6882b4814 Use upstream Vulkan headers from external/vulkan-headers
vk_android_native_buffer.h and vk_layer_interface.h remain, since
they're Android-internal additions and not provided by the upstream
API header repository.

Bug: 129696724
Test: make checkbuild
Change-Id: If4677d08a6891b18ce347e3fa3be393fc6111fc8
Merged-In: If4677d08a6891b18ce347e3fa3be393fc6111fc8
2019-04-18 14:42:36 -07:00
Jesse Hall
c3d6de22be Prepare for moving Vulkan headers
In preparation for importing Vulkan headers from
external/vulkan-headers, this reorganizes the Vulkan Soong modules a
bit:

* Separate the Vulkan API headers from the Vulkan HAL headers. The
  former will move, the latter won't. Also, many things need the
  API headers but very few should use the HAL headers. These probably
  should have always been separate modules, but now they have to be.
* Add a llndk_headers module separate from the llndk_library module, so
  the header module can be in external/vulkan-headers but the library
  module can stay in frameworks/native.
* Merge "vulkan_headers_ndk" into "vulkan_headers". A single module can
  serve both unbundled and platform clients, these never needed to be
  duplicated.

Bug: 129696724
Test: make checkbuild
Change-Id: I955c880298843db4a2f4c08d93f7c8edbb205ef8
Merged-In: I955c880298843db4a2f4c08d93f7c8edbb205ef8
2019-04-18 14:42:26 -07:00
Jesse Hall
cb69d40693 Merge changes from topic "move-vulkan-headers" am: 22a3ef220a
am: 9c82f661a4

Change-Id: I0912acb71fc672f1574d9bc920be0209dbbdc579
2019-04-17 20:09:31 -07:00
Jesse Hall
c92283d0fd Prepare for moving Vulkan headers am: 408eda0002
am: 298dc55878

Change-Id: I9e84ab2ae95ccd542013c52201f4c40a303f6ea8
2019-04-17 20:07:55 -07:00
Yiwei Zhang
14f4d42961 libvulkan: Rev 8 of ANDROID_native_buffer
This change ramps up the ANDROID_native_buffer spec version becasue of
the new behavior introduced to support the new structure added in
VK_KHR_swapchain v69. This change also advertise the swapchain spec
verison based upon the ANDROID_native_buffer version the drivers are
reporting.

Bug: 130182551
Test: CtsDeqpTestCases
Change-Id: Ic95489dac883726d10e1a949875a576116622f3c
2019-04-17 15:28:47 -07:00
Jesse Hall
b9d7b81a3b Use upstream Vulkan headers from external/vulkan-headers
vk_android_native_buffer.h and vk_layer_interface.h remain, since
they're Android-internal additions and not provided by the upstream
API header repository.

Bug: 129696724
Test: make checkbuild
Change-Id: If4677d08a6891b18ce347e3fa3be393fc6111fc8
2019-04-15 10:17:25 -07:00
Jesse Hall
408eda0002 Prepare for moving Vulkan headers
In preparation for importing Vulkan headers from
external/vulkan-headers, this reorganizes the Vulkan Soong modules a
bit:

* Separate the Vulkan API headers from the Vulkan HAL headers. The
  former will move, the latter won't. Also, many things need the
  API headers but very few should use the HAL headers. These probably
  should have always been separate modules, but now they have to be.
* Add a llndk_headers module separate from the llndk_library module, so
  the header module can be in external/vulkan-headers but the library
  module can stay in frameworks/native.
* Merge "vulkan_headers_ndk" into "vulkan_headers". A single module can
  serve both unbundled and platform clients, these never needed to be
  duplicated.

Bug: 129696724
Test: make checkbuild
Change-Id: I955c880298843db4a2f4c08d93f7c8edbb205ef8
Merged-In: I955c880298843db4a2f4c08d93f7c8edbb205ef8
2019-04-15 10:17:02 -07:00
Yiwei Zhang
0f475223dd libvulkan: correctly handle VkBindImageMemorySwapchainInfoKHR
This change checks if VkBindImageMemorySwapchainInfoKHR is chained in
any VkBindImageMemoryInfo struct. If existed, a VkNativeBufferANDROID
struct is properly constructed and additionally chained to the original
VkBindImageMemoryInfo struct.

Bug: 130182551
Test: CtsDeqpTestCases
Change-Id: I1a9e35dbd228060fcfade11be6e7d1b47dad474f
2019-04-12 13:54:21 -07:00
Yiwei Zhang
2314310839 libvulkan: intercept vkBindImageMemory2(KHR) at driver level
This change just updates the code generator template to add the
interception of vkBindImageMemory2 and vkBindImageMemory2KHR at
vulkan::driver level.

Bug: 130182551
Test: CtsDeqpTestCases
Change-Id: I2083d7048bba93bea80c010ba89dbc5f8ab6de0c
2019-04-12 13:51:58 -07:00
dimitry
4fdaa43eee Add dependency on libdl_android
platform private symbols have been moved to libdl_android.so
since they are not intended to be accessible from apps.

Test: make
Bug: http://b/129387775
Merged-In: I34935206e078a064841fe00b293f24df358e50ad
Change-Id: I34935206e078a064841fe00b293f24df358e50ad
(cherry picked from commit 6d23529344)
2019-03-28 12:33:37 +01:00
dimitry
6d23529344 Add dependency on libdl_android
platform private symbols have been moved to libdl_android.so
since they are not intended to be accessible from apps.

Test: make
Change-Id: I34935206e078a064841fe00b293f24df358e50ad
2019-03-20 12:13:42 +01:00
Ian Elliott
94ace213b8 Add 2 addtional VkFormat's to vkGetPhysicalDeviceSurfaceFormatsKHR
The Android Vulkan loader initially supported only 3 VkFormat's for
swapchain creation, with a TODO comment to add more.  In order for
ANGLE to match native GLES drivers, the Android Vulkan loader needs to
support the following formats:

- VK_FORMAT_A2B10G10R10_UNORM_PACK32
- VK_FORMAT_R16G16B16A16_SFLOAT

Bug: b/124942437
Test: GLES dEQP on top of ANGLE on top of Vulkan
Change-Id: If893f4cc81c94242e6d66e0109572f9892323ea4
2019-02-20 15:31:26 -07:00
Yiwei Zhang
d986181df8 Game Driver: plumb driver choice and loading time to GpuStats
This change plumb the below info from GL and Vulkan loader:
1. Intended driver to use
2. Whether intended driver is loaded
3. Total driver loading time

Bug: 123529932
Test: Build, flash and boot. Verify the GpuService receiver side.
Change-Id: I967d4361bf0e04c02390c7555617575c19ecadd4
2019-02-13 18:12:02 -08:00