Commit Graph

23 Commits

Author SHA1 Message Date
Greg Daniel
ffc50c689f Reset buffer tracking state in VulkanSurface.
When we fail to create an SkSurface from a dequeued
buffer we then call cancelBuffer on that buffer. However,
we don't update our tracking to say the buffer is no
longer dequeued with and doesn't own the fence any more.

I don't think this is the main issue causing the crash in
the attached bug because I don't think we're seeing the
error in the logs for this chunk of code. However this
possibly related issue was found while tracking down our
use of the dequeue_fence fd.

Test: manual building and running of phone
Bug: 187240173

Change-Id: Icb4099eeea5be6aedd5376e07a6e3454f5d1d1e3
2021-06-08 14:30:24 -04:00
rnlee
ce9762b57f Use TraceUtils.h from gui shared library.
Test: It makes
Bug: 183120308
Change-Id: I331262dd2da59817031f0c708f4c102041dcb5e0
2021-05-22 00:12:43 +00:00
John Reck
f0baa24d43 Fix some FD lifecycle issues
Use unique_fd, it's cool

Bug: 186919605
Test: make, guessing from a pretty clear error message & documentation
Change-Id: Ied546565261708b7e4c2d220dce6d6a89725cc06
2021-05-13 18:15:50 -04:00
Derek Sollenberger
89f170c5ad Respect HDR/HDR10 colormodes in HWUI Vulkan backend
Test: SilkFX
Bug: 184283931
Change-Id: I724eb683a03f7ada4561c245aca5fffe7b6a5ac9
2021-04-01 16:37:16 -04:00
Adlai Holler
d2345212d8 Migrate some last instances of GrContext to GrDirectContext
This is a rename with no functional changes.

Change-Id: I4b0b7ee1926b688029e257b35c469113c0404a5b
2020-10-07 22:20:44 +00:00
Mike Reed
7ac1af37c0 switch to kDisplayP3 enum
This has the same values as kDCIP3, just a more accurate name.

See skbug.com/9792

Test: make

Change-Id: Id775857f08247c49033e8c2fe0c3255dfc44cace
2020-05-26 14:54:18 +00:00
Alec Mouri
4523801b9a [HWUI] remove libui from HWUI's dependencies
Bug: 136263238
Test: builds
Test: interact with device
Change-Id: I18540f78a4ee5ffcc30c96ff7862480e1d8fe50a
2020-03-01 05:29:54 +00:00
Alec Mouri
a5a0c962b6 [HWUI] Minor ANativeWindow usage cleanup
* Remove unused header in EglManager
* Rename usage of rotation flags to use the public names.

Bug: 137012798
Test: builds
Change-Id: Ia603e8d74c6ba51f77e352333d1e82816582d827
2019-12-23 08:59:57 -08:00
Yiwei Zhang
dab6ecd6ce HWUI-VK: Use auto prerotation for Vulkan backend
The consumer driven resizing now works as below:
1. Query the cached transform hint for this draw cycle
2. dequeuBuffer first to get the actual size
3. Cancel the pre-rotation done on the buffer
4. Update logical window size according to the transform

Bug: 136110987
Test: manually test split screen with resizing and rotation
Test: CtsUiRenderingTestCases and CtsGraphicsTestCases
Change-Id: Ia7f1a53fd761b90cb3ff429086a060d48e40919c
2019-06-27 15:19:45 -07:00
Yiwei Zhang
68daf67e66 HWUI-VK: connect and set native window before any queries
Since Vulkan WSI has been removed from HWUI Vulkan backend, upon VulkanSurface
creation, we should connect to native window first.

Bug: 136110987
Test: CtsUiRenderingTestCases and CtsGraphicsTestCases
Change-Id: I005a8bf22cce0364f240e09fceeb275a6f36aa77
2019-06-26 22:39:45 -07:00
Yiwei Zhang
bd363c94ff HWUI-VK: Decouple hwui Vulkan backend from Vulkan WSI APIs
1. Android support all transforms as exposed by client composition.
2. Properly exposing min/max image size is tracked in http://b/134182502.
3. Current image size and max buffer count are cached in Surface already.
4. Remove surface support check since hwui does not have YUV + CPU consumer.
5. Since HWUI must require those image usage flags, just use them directly,
   and those are always supported by Vulkan driver and enforced by cts.

Bug: 136110987
Test: CtsUiRenderingTestCases and CtsGraphicsTestCases
Change-Id: I89bd9afb69a46e3deca09890ce6348c6b61edddf
2019-06-26 17:10:28 -07:00
Yiwei Zhang
6bbcedacf5 HWUI-VK: Fix initial window transform
Test: CtsUiRenderingTestCases and CtsGraphicsTestCases
Change-Id: I5783be3cfe47597b7931b5605579edb6e189a87e
2019-06-26 17:09:27 -07:00
Greg Daniel
cdfc90231c Remove workaround in VulkanSurface for missing vendor flag.
Test: manual building and testing
Bug: b/128923272
Change-Id: I6be67fddbbf06d4eb7efe316f7e6fd12157e2852
2019-05-14 09:25:41 -04:00
TreeHugger Robot
8d8d704cf7 Merge "Fix set_buffers_damage in VulkanSurface" into qt-dev 2019-04-15 21:00:08 +00:00
John Reck
08ca2a2560 Merge "Support render-ahead in vulkan" into qt-dev 2019-04-15 18:20:28 +00:00
John Reck
0fa0cbcade Support render-ahead in vulkan
Bug: 127822449
Test: verified render_ahead working with skiavk
Change-Id: Iae1b227a763f6def035057f38cca4b0ab65c7e82
2019-04-12 13:33:25 -07:00
John Reck
321d8e538d Fix set_buffers_damage in VulkanSurface
Fixes: 130363483
Test: `setprop debug.hwui.renderer skiavk` and ensure
      surface damage in dumpsys surfaceflinger is expected
      in portrait & landscape orientations.

Change-Id: I973c47038e534c86f38112de7b863477d982d150
2019-04-12 13:06:11 -07:00
Derek Sollenberger
4670126b86 Respect the hardware buffer usage flags set by the consumer.
Test: CtsUiRenderingTestCases
Bug: 130121294
Change-Id: Ie77dee104fa8935978dfd6c0c506d2995f20cd79
2019-04-08 20:31:16 +00:00
Greg Daniel
2173f1890c Add workaround for qualcomm vulkan AHDARDWAREBUFFER_USAGE_VENDER_0
Test: manual building and testing on device. Bugs related to lack of
flag go away.
Bug: 128923272
Change-Id: I2457988c097d73020162947c346a8716d373185e
2019-04-02 13:21:28 +00:00
John Reck
ac513c2fde Fix NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS handling
Fixes: 123541940
Test: CTS HardwareRendererTests#testLotsOfBuffers
Change-Id: I5d96e615f552c4faa0e6dcaaaa828c871eaf6c8e
2019-03-28 16:57:38 -07:00
Stan Iliev
bc5f06bdaa Fix crash after dequeueNativeBuffer fails
Anytime dequeueNativeBuffer fails, it sets mDequeuedIndex to -1.
This is causing a crash latter, when getCurrentSkSurface tries
to index mNativeBuffers[mDequeuedIndex].
This CL removes mDequeuedIndex and improves Vulkan swapchain
error handling.

Test: Ran Camera app
Bug: 129024275
Change-Id: Ieeb685c3a1b33f23ce2334d286199a44ace53165
2019-03-26 15:14:34 -04:00
Derek Sollenberger
31c1b82ad7 Use VkAndroidHardwareBufferUsageANDROID to compute HWUI usage flags
Bug: 128923272
Test: atest CtsUiRenderingTestCases
Change-Id: I27db1a35b77fb654ab738520bee6734f6a62cc4f
2019-03-21 13:24:26 -04:00
Derek Sollenberger
a19b71a54a Directly manage buffer presentation in Vulkan using AHardwareBuffers.
Instead of relying on Vulkan swapchains this CL enables HWUI to directly
manage the native window.  This allows us to preallocate buffers using
our own strategy as well as having no longer having to jump through an
unecessary translation layer that resulted in code that was hard to
reason about and also introduced inefficiencies.

Bug: 123541940
Bug: 119687951
Test: CtsUiRenderingTestCases and CtsGraphicsTestCases
Change-Id: I7e5930748795e7ca4a998ab2c608c3c9b6363037
2019-03-08 09:25:35 -05:00