The forceDraw flag in HardwareRenderer will ensure a frame is drawn when
requested even if it would end up drawing multiple frames in a single
vsync.
This is to help blast sync when we want to synchronize the
buffer. We want to make sure we are guaranteed a callback since we don't
want to wait for retries, especially in the case when trying to synchronize
multiple buffers.
There was already a global flag to handle this, but would use the flag
for all draws. This new function is set per draw so once a frame is
drawn it's unset. The global flag was only used for tests so updated the
test to set the flag before every draw and deleted the global property.
Test: Underlying code was in place. This is just piping a new setter. No
usages yet.
Test: TestSceneRunner
Bug: 200284684
Change-Id: Ie1c9950cabb7331cfed1721564a51a1a15cd1624
HWUI already supports disabling RT animations, but there was no correct
way to call it from the application. Adding a call to enable or disable
RT animations on the RenderThread so RT animations can be disabled
during a blast sync.
Test: Builds
Bug: 200284684
Change-Id: Ia1ae3498c38b84b4975f08d37bc764f0c690ed9f
postAndWait() shows the duration that UI Thread waits for RenderThread.
The trace is helpful for perfetto parser to calculate the actual frame
drawing time from CPU resource perspective.
Bug: 224653682
Test: capture trace and check App UI Thread.
Change-Id: Ic3a11b60abb1fea8cc7b44ce6889ab1e3c2788fd
Full draw will be happened on HWUI under 90/120Hz device,there are
more draw commands under renderFrameImpl than in the 60Hz fps device,
frame.bufferAge() > (int)mSwapHistory.size() resulting in an increase
in power usage.
So need to increase (int)mSwapHistory.size() to 8, set mSwapHistory
add to 7.
Bug: 209371516
Test: Manual
Change-Id: Ic6f21e7b9dc5e7c8f36d03c57b01fa7210cff86f
FrameCallback sends back the syncStatus and allows the caller to return
a FrameCommitCallback. This is so the caller can evaluate the results of
the sync and determine if it wants to continue waiting for a commit
callback. In cases, where the sync has failed, there will never be a
commit callback so the caller can avoid waiting.
This is partically helpful for VRI because it wants to sync with a frame
that will draw, but also doesn't want to get stuck indefinitely waiting
on the callback. VRI can check the syncStatus and only handle blast sync
and/or reportDraw when its determined that a draw will happen.
This allows VRI to remove frameCompleteCallback since it can now wait
until a buffer has drawn instead of when the vsync has completed. This makes
sure it waits on FrameDropped since that result indicates HWUI will draw on
the next vsync
Test: BlastSync
Bug: 200284684
Change-Id: Ic6e2f08ea21ac8a1634a3389c927fcb68ede3f7b
This will only be used by some devices, when requested by SystemUI.
Defer initialization until its needed. This removes the unnecessary
ALOGE. If the device needs A8 and doesn't have it, it will still emit a
fatal log, which will enclude the EGL error.
Bug: 210501051
Test: make
Change-Id: I2c45d910a272e6bf434b8dae52da88fb927ac82a
VulkanSurface:
- update LOG_TAG
- allow no dataspace + A8
- assign a vkPixelFormat for A8
VulkanManager: use a more descriptive LOG_TAG
Bug: 193170859
Test: TODO
Change-Id: If447c2c393b4f17b718083a77cdd29870fb1cc50
This CL uses new skia api to determine if we're drawing on screen or
offscreen for vulkan and enables overlays when possible.
Bug: 185730234
Test: manual
Change-Id: Ib7748535431e4dc56b1af6d7ccc729b3b649df96
Updated logic to determine if RenderEffectCache
is supported to very both the vendor name as well
as the corresponding driver version.
Bug: 193145089
Test: Added test to EglManagerTests + RenderEffectCapabilityQueryTests
Change-Id: Ia0fd66c40790b94566f495d2c4128c4988d406b6
Added property to conditionally cache SkImage instances
with SkImageFilters applied. Some GL vendor implementations
invoke Fence::waitForver without signalling, leading
to ANRs throughout the system.
Bug: 193145089
Test: manual
Change-Id: I3e478b11b66205d96e9499a362f7412a1d6e952d
* changes:
Get rid of unused ASurfaceControl in frame metrics listener callback
Set uninitialized frame number to 0
Make frame number type consistent
Add unit tests for FrameMetricsReporter
Update JankTrackerTests to reflect API changes
Pass surface control id to callback to accurately identify surface metrics belongs to
Stop reporting frame stats from frames completed before observer was attached
Now that the frame number is a uint instead of an int it's clearer if the uninitailized value is 0. Frame numbers start from 1 so 0 doesn't collide with any valid frame numbers. It also means comparing frame numbers to check if the frame is newer always works even when comparing to the uninitialized frame number.
Test: N/A
Change-Id: I0901ffeaefbdd6378e59d8858a06de92b0104cd9
The frame numbers are ultimately stored as uint64_t so to avoid any implementation dependent casting we make sure all direct and indirect references to this value are stored as uint64_t
Test: N/A
Change-Id: I080c94b1007f2e884cf0fa3583bf51badc913a05
Avoid getting the wrong frame info when duplicate frame numbers are found in the ring buffer. Will ensure there isn't a mismatch in the metrics data reported.
Test: Existing tests
Bug: 197515602
Change-Id: Iff9ba01f575f94e5a9872ee48c0dd1e5067880c3
The previous code waited for a frame complete callback from hwui before
notifying WMS that a draw had occurred. However, frame complete callback
was not guaranteed to get called since it only invokes a callback if a
draw actually occured. VRI really needs a signal that RT has completed,
since it just needs to know that a draw was possible so it can notify
WMS that the RT completed its pass.
Instead, rename frameCompleteCallback to frameCommitCallback since that
API is exposed to a public API when a frame was actually drawn.
Create a new callback, frameCompleteCallback, that is invoked when the
draw has completed, regardless if a frame was actually drawn.
When the frameCompleteCallback is invoked, VRI can check to see if a new
frame actually drew. VRI can call into BBQ to see if the frame acquired
matches the frame that was attempted to draw. If so, VRI can wait on a
transaction callback. If not, it can allow VRI to continue. In either case,
it will notify WMS that the draw has finished.
Test: Split over and over
Bug: 195262673
Change-Id: I24dd19ab2746be3fc33e597761abf8c5249f8b5b
Bug: 195081399
Test: manual + dumpsys gfxinfo
CanvasContext::draw has some conditions under which it will not draw. We
still need to flushAndSubmit to free scratch memory if there were
texture uploads this frame.
Change-Id: I60d230cd36bed310a3155e4f1ca647c99c13c4cd
If errors occured during finishFrame that caused us to not have a
semaphore or possibly destroy the semaphore early we will end up
with a null mDestroySemaphoreContext in swapBuffers which we tried
to destroy unconditionally.
I haven't repro'd the connected bug, but based on the crash stack
this seems like the likely cause.
Test: manual code inspection and build.
Bug: 191950033
Change-Id: I0fbd33edff3552b91b980da9e3b2c45bc52a2dd0
Ensure GrContext::submit() is always called after either
Bitmap#prepareToDraw() or if DrawFrameTask skipped drawing.
In either case texture uploads & deletions will be scheduled,
but without the submit they won't actually be performed. This
can end up running out of RAM.
Bug: 189393671
Test: manual test app
Change-Id: I57477c64457558487e9e5ec0a979ad9099a8cb2c
This feature is intended for use in headless test environments,
where disabling drawing has minimal compatibility impact and can
save significant resource usage when running UI tests.
This feature is controlled via a new system property
'debug.hwui.drawing_enabled', and a HardwareRenderer public API that can
override the property value on a per-process basis.
Bug: 188559292
Test: boot emulator, atest CtsGraphicsTestCases
Change-Id: I93c21e680382e03342f235dbf58bd7a5c8a6f767
This field actually requires a special lock, mFrameMetricsReporterMutex.
But there isn't a GUARDED_BY annotation for it. And even if there was,
the compiler feature of -Wthread-safety was not active in this code, so
this error would not have been caught.
To fix this, enable the compiler annotation and add GUARDED_BY
annotation to mFrameMetricsReporter.
And finally, use this lock to properly protect this field.
Bug: 192330836
Test: atest hwui_unit_tests
Change-Id: I76950bfa01bbd7ccdc54c4e8c114430b5aeddf1a