Closed Bug 930926 Opened 12 years ago Closed 11 years ago

First composite after idle can take 40ms

Categories

(Core :: Graphics, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: BenWa, Unassigned)

Details

(Keywords: perf, Whiteboard: [c=handeye p= s= u=])

Attachments

(1 file)

Attached image Screenshot
I can reproduce this fairly consistently with the hamachi device. When profiling the homescreen after being idle the first composite can take 40ms and causes us to miss 3 frames significantly increasing time to the touch response. All the sub-sequent composites are fast. http://people.mozilla.org/~bgirard/cleopatra/#report=1a16c320066e2be47f40d07f2c6eb96f3f30a2de This profile shows the problem at the start. Notice the first blue composite is really slow compared to the rest. It appears the time is spent in a syscall that can't be interrupted by a signal so we're unable to profile it so I don't know where it's at. Perhaps this has to do with a low power mode optimization that it has to wake up from? If that's the case Bas suggest we could ask the compositor to wake up the GPU while the main thread is preparing the first frame. This would cut down our latency by about 3 frames (40ms). But we need to confirm that this is the problem first.
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Milan do we have a contact that could clarify this? It would certainly shortcut having to manually debug this which I suspect will be difficult since it might be in a syscall.
Flags: needinfo?(milan)
(In reply to Benoit Girard (:BenWa) from comment #0) > This would cut down > our latency by about 3 frames (40ms). Actually down by 2 frames*, we still need to wait for vsync for the frame.
(In reply to Benoit Girard (:BenWa) from comment #0) > ... > > Perhaps this has to do with a low power mode optimization that it has to > wake up from? Michael, who can help us get an answer to this?
Flags: needinfo?(milan) → needinfo?(mvines)
Vikram -- could you please take a look at this? :BenWa -- Is Hwc or GPU composition being used here? Have you observed any difference between the two?
Flags: needinfo?(mvines)
Flags: needinfo?(mvikram)
I have HWC displated (to always have the FPS counter). This is with GPU.
Can you please try with Hwc too? FPS counter for Hwc is in logcat.
It's also there :(
That's actually helpful. If we're using Hwc for compositing, and assuming there's no GPU usage during the render then sounds like it's something else and not simply the GPU spinning up slowly.
Will take a look. Can you please describe the exact scenario? Is it initiating a scroll of the applist while the phone is idle? Usually, GPU is used to scroll "to" the first page of the apps but scrolling between subsequent app pages uses HWC.
Flags: needinfo?(mvikram)
Turn off screen lock/ autodisable idle at home screen for some duration (time while I run profile.sh) maybe 2 mins start home screen swipe compositor thread will block and mask profiling signal. easy to reproduce on Hamachi.
What I observe profiling it on my own is that when the device is idle and a scroll is initiated, the first couple of frames are rendered via HWC. The third frame is rendered by the GPU and, I do see that the GPU takes about 35 ms to "wake up" causing the first frame's "Render" function to take about 45 msecs. Subsequent Render calls take about 20 ms, but these don't seem to be content bound. So, waking up the GPU ahead of time of the first GPU frame to be rendered in theory would address this situation. However, the Compositor needs to determine if the layers are compatible to be rendered by HWC which happens only when the TryRender() function is called within the rendering of the layers themselves. We ought to be careful to not wake up the GPU if the layers are going to be composed by HWC as this would cause unnecessary power consumption. BTW, how do I zoom in and expand on the Cleopatra UI trace to get more detail on the attachment to describe the problem that you describe? I can't seem to be able to zoo in especially on the Frames.
(In reply to Mandyam Vikram from comment #11) > However, the Compositor needs to determine if the layers are compatible to > be rendered by HWC which happens only when the TryRender() function is > called within the rendering of the layers themselves. We ought to be careful > to not wake up the GPU if the layers are going to be composed by HWC as this > would cause unnecessary power consumption. Or perhaps we can ask our contacts why the GPU wakeup takes this long. Perhaps it just hasn't been optimized very much yet or we're hitting a slow path. > BTW, how do I zoom in and expand on the Cleopatra UI trace to get more > detail on the attachment to describe the problem that you describe? I can't > seem to be able to zoo in especially on the Frames. Select a range in a thread histogram (not the frame view) by dragging the gray selection. Then a breadcrumb will appear in the top middle/left, click on that.
Keywords: perf
Priority: -- → P1
Whiteboard: [c=handeye p= s= u=]
This issue has been resolved in our Adreno driver for 1.4 KK.
Bhavana, Does Vikram's comment 13 mean this bug should be whiteboard-tagged [POVB] and RESOLVED FIXED? Thanks, Mike
Flags: needinfo?(bbajaj)
(In reply to Mike Lee [:mlee] from comment #14) > Bhavana, > > Does Vikram's comment 13 mean this bug should be whiteboard-tagged [POVB] > and RESOLVED FIXED? > > Thanks, > Mike POVB and resolved WFM.
Flags: needinfo?(bbajaj)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: