Commit Graph

748 Commits

Author SHA1 Message Date
Stan Iliev
e0fae2356b Add memory tracing in HWUI
Add ATRACE memory counters to track memory usage at the end
of each frame in HWUI.
There are 3 catagories: CPU, GPU and Texture memory.
There are 3 more counters for memory that can be purged.
This CL deletes GpuMemoryTracker class, which implemented
similar function for Android O HWUI renderer.

Test: Collected systrace with gmail and setting.
Test: memory tracing adds ~0.1ms per frame when ATRACE is enabled
Bug: 146580770
Change-Id: Icbcc0478bc426dff578e83726fe7c95df171ed93
2020-01-10 16:14:39 +00:00
TreeHugger Robot
68f7a52419 Merge "[HWUI] use AChoreographer in place of DisplayEventReceiver." 2020-01-08 17:18:49 +00:00
Alec Mouri
4a818f189c [HWUI] use AChoreographer in place of DisplayEventReceiver.
Bug: 136262896
Test: builds, boots
Test: scroll through settings app
Test: Toggle between 60/90hz and observe systrace
Change-Id: I8eef306a968525c55f3863ae688545faa43b23be
2019-12-26 10:11:40 -08: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
John Reck
cd18c2271d Fix for Surface#lockHardwareCanvas lockups
By avoiding setting a dequeue buffer timeout we avoid
hitting a different path in BufferQueue that prevents
async behavior from happening. This restores P's
behavior in this path.

Bug: 143860379
Test: repro app in bug
Change-Id: Iffbd9f9e6689a40876ff3aa74c10020e3f09fc6a
2019-11-21 15:16:08 -08:00
Stan Iliev
10689992cf Fix an issue with GPU stats not enabled
Invoke Surface::enableFrameTimestamps after eglDestroySurface.
eglDestroySurface internally disables time stats. Order is
important, when CanvasContext::setSurface is invoked with
a surface, that is already current (which happens all the time).

Test: ran UiBench microbenchmark tests
Change-Id: I3d023c3a87da6329c556426d553c744e541b9dff
2019-11-13 11:48:04 -05:00
Stan Iliev
aaa9e834d4 Decouple SurfaceTexture from HWUI
Remove all Skia and HWUI types from SurfaceTexture
implementation.
Move SurfaceTexture to libgui (ag/9578265).
Define private C++ API for SurfaceTexture, which is consumed
by DeferredLayerUpdater.
Move AutoBackendTextureRelease/Skia code from SurfaceTexture
to HWUI.

Test: pass CtsUiRenderingTestCases and CtsViewTestCases
Bug: 136263580
Change-Id: I3f971bb490f64a3ac0b2a66a89ba935bf7f08213
2019-11-08 15:37:17 +00:00
Alec Mouri
05955610a0 Merge "[HWUI] Get DeviceInfo through stable ABI" 2019-11-07 17:15:47 +00:00
Nick Desaulniers
b451d87468 [frameworks][base][hwui] re-fix -Wimplicit-int-float-conversion
A new instance snuck in since I haven't completed the platform toolchain
upgrade yet. There was imprecision in this call; accept it by making the
implicit cast explicit.

Bug: 139945549
Test: mm
Change-Id: Id704d9741b480eba4cf3955e70119d935776faf6
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-04 17:18:51 -08:00
John Reck
4145919ef9 Fix wrong surfaceRequiresRedraw check
We only need to redraw if the size /changed/ not
if it was the same. Also fix damageId to not use
frameNumber as repeated redraws of the same frame
would toggle.

Bug: 143711430
Test: systrace
Change-Id: I8ac4629c9ff4fd51de33d1be7aa46ccc995ba342
2019-10-31 15:04:58 -07:00
TreeHugger Robot
b051671aa3 Merge "[HWUI] Use ANativeWindow_get{Height, Width}" 2019-10-29 09:39:18 +00:00
Alec Mouri
da819e47f1 [HWUI] Use ANativeWindow_get{Height, Width}
gui/Surface will eventually be removed since HWUI needs to depend on a
stable ABI, so use the NDK methods for querying width and height that
operates on ANativeWindow instead.

Bug: 137012798
Test: builds
Change-Id: I1309e31992190e7b44c6ea83f962f372b6b0afcf
2019-10-25 16:18:16 -07:00
John Reck
5a23400610 Merge "Delete VectorDrawableAtlas" 2019-10-25 22:28:40 +00:00
Alec Mouri
22d753f74d [HWUI] Get DeviceInfo through stable ABI
This also removes the dependency on ui/DeviceInfo other than in test
code.

Bug: 136263392
Bug: 136263238
Test: builds, boots
Change-Id: I6a4687e981359f0e6beb83be8a5501ed7fd16f15
2019-10-25 13:30:42 -07:00
John Reck
ca718a06d5 Fix buffer damage for quad-buffer
Test: none
Change-Id: I4789d84945e381d67e96ef37554a161dbd0ab16c
2019-10-21 10:15:02 -07:00
TreeHugger Robot
d4bd5714f9 Merge "Revert "Drop all caches in UI_HIDDEN"" 2019-10-09 01:01:35 +00:00
John Reck
f846aeec9d Revert "Drop all caches in UI_HIDDEN"
This reverts commit 8a207962ec.

Bug: 142301356
Test: none, speculative

Reason for revert: Seems to break alarm? 

Change-Id: Ia1680d1a937b596297c2eab3e54476daf9589347
2019-10-08 23:28:41 +00:00
John Reck
83161dcd6a Delete VectorDrawableAtlas
Poking around in a few apps it doesn't appear that
the VectorDrawableAtlas is achieving sufficient
utilization to justify its existence. The potential for
draw call merging doesn't seem warranted for the
RAM cost of the atlas.

Bug: 137853925
Test: builds
Change-Id: Id2419bc6dccb6316636d50c568f8fac75a2d563f
2019-10-04 14:49:20 -07:00
John Reck
05ac516412 Drop max texture cache size from 12x to 5x
Bug: 137853925
Test: none
Change-Id: I8d05871a5f54c8e5d6528a6a8ed48f73464a1221
2019-10-04 13:47:55 -07:00
John Reck
8a207962ec Drop all caches in UI_HIDDEN
Bug: 137853925
Test: none
Change-Id: Idf7002d9b07cc6b71b38ce76e7b6382100279a99
2019-10-04 13:30:51 -07:00
Alec Mouri
ce81728f1c Merge "[HWUI] Remove nanosecond conversion from duration queries." 2019-10-02 05:27:58 +00:00
Alec Mouri
5d76d44153 Merge "[HWUI] Use ANativeWindow_setDequeueTimeout" 2019-09-20 21:06:30 +00:00
TreeHugger Robot
ff38ce2478 Merge "[HWUI] hook in ANativeWindow_getLastDequeueStartTime" 2019-09-12 00:14:01 +00:00
TreeHugger Robot
ad72061767 Merge "Switch to using GrContext::setResourceCacheLimit and getResourceCacheLimit" 2019-09-11 20:57:09 +00:00
Alec Mouri
6e1271be3f [HWUI] Remove nanosecond conversion from duration queries.
Now that they return nanoseconds, there's no reason to lose precision.

Bug: 137012798
Test: builds
Change-Id: I52ca20cb010b4f1829596e0a765b7013ae3665ca
2019-09-06 11:45:01 -07:00
Alec Mouri
672e9b0ce6 [HWUI] Use ANativeWindow_setDequeueTimeout
Don't use the ReliableSurface version now that we have an APEX stub.

Bug: 137012798
Test: builds
Change-Id: I63d1d9d2ff60b54a75d5b4865a63eb22ac347208
2019-09-06 11:44:52 -07:00
Alec Mouri
8d0c5bd200 [HWUI] hook in ANativeWindow_getLastDequeueStartTime
Bug: 137012798
Test: builds
Change-Id: I37fd2a7c40398053082f606f0a085db0a239e2e0
2019-09-06 11:44:42 -07:00
Robert Phillips
57bb0bfb44 Switch to using GrContext::setResourceCacheLimit and getResourceCacheLimit
The old version that took a maxResourceCount are now deprecated

Test: does it compile
Change-Id: Ib4d69c8907169329c7765c648f46fa5e4a10bf7a
2019-09-06 13:22:11 -04:00
Alec Mouri
7ea41b6975 [HWUI] use ANativeWindow_getLastQueueDuration api
Replaces the query call with an abi-stable one.

Bug: 137012798
Test: builds
Change-Id: Ia8f01c3be0b79037cef88782913af55f6d00a6a2
2019-09-05 13:00:48 -07:00
TreeHugger Robot
85e6ff9b77 Merge "[HWUI] use ANativeWindow_getLastDequeueDuration api" 2019-09-04 18:54:34 +00:00
Mike Reed
39adc88fef use rect version of join, the other is deprecated
Test: make

Change-Id: I29f4ff6cea209ac5c053a525ff06cd1bfea6c9c0
2019-08-29 13:39:43 -04:00
Alec Mouri
8d45174361 [HWUI] use ANativeWindow_getLastDequeueDuration api
Replaces the query() call for getting the duration of the internal
dequeue() call a call that will be abi stable.

Bug: 137012798
Test: builds
Change-Id: I6d2118a7c093dd2ecc4ebfb4b4ee8556f7e709a7
2019-08-20 10:28:42 -07:00
Yiwei Zhang
0b9f0b81bc HWUI-VK: remove duplicate GET_DEV_PROC
Test: build, flash and boot
Change-Id: Ia3b62c5d31952f85664f1926584fc9438d48dec3
2019-08-15 11:33:59 -07:00
Derek Sollenberger
19419ccc95 Merge "Move GraphicBuffer back into libandroid_runtime." 2019-08-12 12:38:51 +00:00
Stan Iliev
52e4392ed0 Access VectorDrawableAtlas only on RenderThread
VectorDrawableAtlas dtor can run only on RenderThread, because
it releases GPU resources. It is usually CacheManager, which
destroys the atlas on RenderThread in response to trimMemory.
This CL fixes a rare situation, when a Java finalizer thread
deletes the atlas.

Bug: 137722646
Test: Manual testing on a device
Change-Id: I9d900809c23efaead9aaf16ee3306bc8c7c6b379
2019-08-09 15:52:05 -04:00
Derek Sollenberger
e78f7c9f48 Move GraphicBuffer back into libandroid_runtime.
Update Bitmap to store AHardwareBuffer instead of GraphicBuffer and
begin removing references to GraphicBuffer from the graphics JNI code

Test: CtsUiRenderingTestCases
Bug: 137655431
Change-Id: If533b6d87a87ae7e94a9b6f16fc52043714087df
2019-08-09 11:41:51 -04:00
TreeHugger Robot
d1845aa160 Merge "Add GPU draw stats to gfxinfo and GraphicsStatsService" 2019-08-06 21:45:20 +00:00
TreeHugger Robot
9914348465 Merge "[HWUI] clean up libgui include directives" 2019-08-05 17:43:23 +00:00
Alec Mouri
6db59a66bd [HWUI] clean up libgui include directives
As a first pass removing some stale includes.

Bug: 138819035
Change-Id: I7aef319aa8f1b13b6482ef61fda151560e570558
Test: builds
2019-08-02 18:02:50 -07:00
Roman Kiryanov
6073613967 Crash in createPBufferSurface if eglCreatePbufferSurface fails
EglManager::makeCurrent assumes mPBufferSurface has a valid
surface. This assumtion is not satisfied if
eglCreatePbufferSurface fails.

Bug: 138733217
Test: build
Change-Id: I580dca24f440accda458d53f988bb24cbabede36
Signed-off-by: Roman Kiryanov <rkir@google.com>
2019-08-02 14:37:53 -07:00
Stan Iliev
7203e1f55a Add GPU draw stats to gfxinfo and GraphicsStatsService
Test: ran dumpsys with gfxinfo and graphicsstats
Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef
2019-08-01 18:53:21 +00:00
Fedor Kudasov
c53d28091d Merge "Include more precise dependencies" 2019-07-31 20:22:19 +00:00
Fedor Kudasov
f6724205bb Merge "Remove unused method" 2019-07-31 18:23:54 +00:00
Derek Sollenberger
7bdc19bacb Merge "Isolate the graphics classes into their own static lib" 2019-07-31 17:43:57 +00:00
Fedor Kudasov
e690983f83 Remove unused method
Bug: 117921091
Test: all tests should pass
Change-Id: I8830e061e30a73e1ea2accda8c9a4268818f5b80
2019-07-31 15:12:05 +00:00
Fedor Kudasov
85d6f10a0f Include more precise dependencies
Bug: 117921091
Test: all tests should pass
Change-Id: I3be0eeef413aaf69a3a9e27e0bc7f2841a1f5f95
2019-07-31 15:04:41 +00:00
Derek Sollenberger
5d0ca63d9c Isolate the graphics classes into their own static lib
Update additional headers to include-what-you-use to resolve
compiler errors related to moving include paths.

Test: CtsUiRenderingTestCases
Change-Id: I230408a53610ad1926f9e46d5aff66f52fec4a3a
2019-07-29 14:57:14 -04:00
John Reck
59dd2ea974 Fix ReliableSurface to be more reliable
Handle TIMED_OUT better by rescheduling (TODO: give up after N
attempts?)

Fix SYNC_SURFACE_LOST_REWARD_IF_FOUND path to actually go fetch
a new surface.

Bug: 137509524
Test: Injected errors randomly, verified nothing got permanently dead.
Change-Id: Id30f8ad1dd7196041ee84c16c8cf5c814002a6ce
2019-07-26 16:58:37 -07:00
John Reck
296c5ef20e Merge "Increase dequeueBuffer timeout" into qt-r1-dev am: 5ab5cd7aa2
am: 6769f25c17

Change-Id: I13931cd14fead1141acbea5cef8deb61a6c9119e
2019-07-22 12:51:21 -07:00
John Reck
3f333d6d72 Increase dequeueBuffer timeout
Timeout recovery isn't working properly, so increase it
to avoid any false-positives from something like a
slow screen-on

Bug: 137509524
Test: none
Change-Id: Ic4fae04b41f71600479f9557e334f67c27851db4
2019-07-18 10:48:49 -07:00