Twitter.com - stuttering and input lag - Caused by backdrop-filter(Adreno 330)
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
People
(Reporter: djdisodo, Assigned: jnicol)
References
Details
Attachments
(2 files)
+++ This bug was initially created as a clone of Bug #1809738 +++
From github: https://github.com/mozilla-mobile/fenix/issues/28436.
Steps to reproduce
Visiting the mobile twitter site and scrolling around
Expected behavior
Fast device and 120hz screen should provide smooth scrolling like other sites
Actual behavior
The website is very stuttery and has input lag.
If I view the desktop site it's fine.
It seems related to the backdrop-filter CSS performance. If I block backdrop-filter on ublock origin to stop the blur effect on the Twitter mobile page it will work correctly and be very smooth.Device information
- Android device: 13 (2023-01-05 patch) - Pixel 7 Pro
- Fenix version: 108.1.1 - present in beta and nightly.
┆Issue is synchronized with this Jira Task
Change performed by the Move to Bugzilla add-on.
I'm having stuttering caused by backdrop-filter, on webpages like twitter.com
found this issue that seems to be related
there was no lag if i disabled backdrop-filter on about:config
i also tested "Minimal testcase showing poor picture caching with both position: fixed and backdrop-filter" on the original issue posted
i don't clearly remember but i once had lg g6(Adreno 530) and it was stuttering on twitter too
i don't have any other device in my hand for now than galaxy s5(Adreno 330)
there might be more devices that has this lag
| Assignee | ||
Comment 1•3 years ago
|
||
Thanks for the bug report. Backdrop filter is very resource intensive and it's unfortunately unavoidable that it has a performance penalty associated. However, I can confirm that on a Nexus 5 (also Adreno 330) performance is especially bad. That is somewhat less so the case on a Nexus 5X (Adreno 418). And by the time I get to a Pixel 2 (Adreno 540), performance is acceptable for me.
There are a couple things going on here. When investigating bug 1809738 we realized that backdrop filter means we are unable to put the fixed position items in their own picture cache slice separate from the scrollable content. This means that the bottom and top tile of the page are constantly invalidating whilst scrolling, which is unfortunate but not the end of the world. However, since then, in the presence of backdrop filter we are unable to correctly detect the scrollable root at all, meaning that the entire screen is invalidated on every scroll. This was regressed by bug 1800358. I'll follow a separate bug for that.
Secondly, and most importantly: In bug 1809738 the issue was that the GPU struggled with the several large render targets we must use due to the backdrop filter. We suspect it was expensive copying their contents from slow memory in to fast tile memory and back. In that case, on the Mali GPU, ensuring we performed unscissored clear was enough to allow the driver to optimize away some of these copies. The older Adreno driver does not appear to be as smart.
However, there exists an extension QCOM_tiled_rendering that appears to allow us to explicitly tell the driver "we only need this region of a render target, you can skip reading it in from tiled memory, and only have to resolve the color attachment back". I have prototyped using this and see a large improvement in performance on my Nexus 5. (From unusable to just about acceptable)
| Assignee | ||
Comment 2•3 years ago
|
||
This provides us with QCOM_tiled_rendering, which will be used in the
next patch in this series.
Updated•3 years ago
|
| Assignee | ||
Comment 3•3 years ago
|
||
We have seen reports that various websites, including twitter, perform
poorly on older Adreno devices due, to backdrop filter. We previously
encountered similar on Mali-G710 devices in bug 1809738, and it
appeared to be due to having to copy the contents of large
framebuffers--required to render the backdrop filter--to and from the
GPU's tile memory. On Mali we were able to avoid this penalty by
ensuring we performed an unscissored clear immediately after binding
the framebuffer, allowing the driver to omit initalizing the contents
of tile memory prior to rendering.
It's plausible that older Adreno drivers are not clever enough to be
able to make this optimization. However, there exists an extension
QCOM_tiled_rendering, which allows us to explicitly tell the driver
which subregion of a render target we are rendering too, and whether
it must be pre-initilized or post-resolved.
This patch makes use of this extension when rendering to color and
picture cache targets. In both cases we supply the region that is
being rendered and must only resolve the color attachment back to main
memory. In most cases we can additionally avoid initializing tile
memory prior to rendering, with the exception being in
draw_color_target() when we do not perform an initial clear, in which
case we must initialize the color attachment.
This results in a significant performance improvement on twitter when
tested on a Nexus 5 (Adreno 330) device.
Depends on D176153
| Assignee | ||
Comment 4•3 years ago
|
||
The above patches significantly improve performance on a few Adreno 3xx and 4xx devices that I have tested, though we still fall well short of hitting a smooth 60FPS. If we can find a fix for bug 1829186 that should help further, but realistically it may be very difficult to get this running smoothly. Important to note that Twitter is fairly laggy on Chrome too on these devices.
Comment 6•3 years ago
|
||
Backed out for causing wr bustages
Backout link: https://hg.mozilla.org/integration/autoland/rev/ffe23d9c2596910146f07de601a9df42aa62aaf6
Failure log -> error: failed to select a version for the requirement gleam = "^0.15"
| Assignee | ||
Comment 7•3 years ago
|
||
Whoops, forgot to update webrender's Cargo.lock
Comment 9•3 years ago
|
||
Backed out for causing wr bustages.
Backout link: https://hg.mozilla.org/integration/autoland/rev/da1f855a8f692c34b823d04167575ffbfa0f91e7
| Assignee | ||
Comment 10•3 years ago
|
||
Sorry! A line was too long for servo-tidy's liking
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/290aaac29717
https://hg.mozilla.org/mozilla-central/rev/a578872091a4
Comment 13•3 years ago
|
||
Backed out a578872091a4 as per https://bugzilla.mozilla.org/show_bug.cgi?id=1829772#c4 for causing Bug 1829772
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/17ea6f29654b
| Assignee | ||
Comment 16•3 years ago
|
||
The test failure in bug 1829772 appears to be due to a driver bug in the implementation of QCOM_tiled_rendering on various Adreno devices.
I have been able to reproduce on a Pixel 4 (Adreno 640), which is what we run our CI tests on, as well as a Pixel 2 (Adreno 540) and Pixel 3 (Adreno 630). I tested each of these running various versions of Android, and while the android version itself doesn't matter, the bug only reproduces when the adreno driver version is V@0490.
I could not reproduce on a OnePlus 6 or OnePlus 8 (Adreno 630 and 650, respectively) with driver versions V@408 or V@0502.
So I am fairly confident the bug affects a reasonably wide range of Adreno GPUs, but is limited to driver version V@0490.
I will update the patch to disable this optimization on affected driver versions, then re-land.
Updated•3 years ago
|
Comment 17•3 years ago
|
||
Comment 18•3 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 19•3 years ago
|
||
tested on nightly now it's a lot better
Comment 20•3 years ago
|
||
Jamie, do you think this is worth uplifting to a 114 dot release (already planned for other fixes next week or the week after)? Your fix has been baking on Nightly for most of the Nightly 115 cycle.
| Assignee | ||
Comment 21•3 years ago
|
||
No, I don't think we should. It only helps a limited number of devices and is not without risk.
| Assignee | ||
Updated•3 years ago
|
Description
•