implement gralloc-backed tiles

RESOLVED FIXED in mozilla30

Status

()

Core
Graphics
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: blassey, Assigned: cwiiis)

Tracking

unspecified
mozilla30
ARM
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Comment hidden (empty)
(Assignee)

Updated

4 years ago
Blocks: 963073
Assignee: nobody → sotaro.ikeda.g
(Assignee)

Comment 1

4 years ago
I've implemented this on the tiling branch: http://hg.mozilla.org/users/bschouten_mozilla.com/tiling

Initial results are not good - our current Gralloc TextureSource has a very expensive BindTexture implementation (most of the time on a profile is spent in EGLImageTargetTexture2D). This may or may not be helped by state tracking, but it may just be an attribute of gralloc that is has an expensive bind. This would make it a bad choice for using with tiles, in this way at least.

We're experimenting and trying to think of alternatives. Here's a few:

- Don't use Gralloc for tiles and just use the shmem path (that works quite well and seems to perform adequately for our use-case)
- Don't use Gralloc, but use EGLImage to move the texture upload into either another thread, or onto the content process
- Copy from the gralloc texture to another texture (and hopefully this is faster than uploading from shmem, or it'd be pointless)
- Find out why using Gralloc in this way is slow and see if there's anything that can be done, at either application or driver level (we have this kind of relationship, right?)
Assignee: sotaro.ikeda.g → chrislord.net
Status: NEW → ASSIGNED
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
(Assignee)

Comment 2

4 years ago
Here's a profile runnning with full-tilt composition with a tiled layer visible on a buri device: http://people.mozilla.org/~bgirard/cleopatra/#report=df0e68a9c498a953717b6fdec4c1119a9d7ca7d0

This is running on the tree linked to in comment #1.

It'd be great to have some feedback/suggestions from someone who has access to the driver code, so needinfo'ing Diego Wilson.
Flags: needinfo?(dwilson)
(In reply to Chris Lord [:cwiiis] from comment #1)
> - Don't use Gralloc, but use EGLImage to move the texture upload into either
> another thread, or onto the content process

We were thinking about this way back when the Fennec native rewrite was going on, and I still think it could be a solid idea.

Comment 4

4 years ago
Are your textures 32-byte aligned? If not, that could be the reason for the performance hit.
(Assignee)

Comment 5

4 years ago
We deduced the performance hit was due to contention on the texture used to bind the gralloc buffer, and we have a fix :)
Flags: needinfo?(dwilson)
here is a try push with the current state of the (European) tiling branch https://tbpl.mozilla.org/?tree=Try&rev=d20ab77f8a51
Created attachment 8382983 [details] [diff] [review]
[WIP] changes since the last common revision with m-c

To get an idea of what's changed in the branch

Updated

4 years ago
Attachment #8382983 - Attachment description: [WIP] changes the last common revision with m-c → [WIP] changes since the last common revision with m-c
Created attachment 8382984 [details] [diff] [review]
[WIP] changes since the last common revision with m-c

The previous diff was backward, sorry for the spam.
Attachment #8382983 - Attachment is obsolete: true
new try push https://tbpl.mozilla.org/?tree=Try&rev=8d4135de9be2
new try push https://tbpl.mozilla.org/?tree=Try&rev=01e3a84d93e4
Created attachment 8386854 [details] [diff] [review]
[WIP] changes since the last common revision with m-c
Attachment #8382984 - Attachment is obsolete: true
(Assignee)

Comment 12

3 years ago
https://hg.mozilla.org/mozilla-central/rev/8394fed3332e
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.