Closed Bug 660565 Opened 14 years ago Closed 14 years ago

HTML5 HW accelerated video is slow

Categories

(Core :: Graphics, defect)

ARM
Maemo
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla6
Tracking Status
firefox6 --- fixed
fennec 6+ ---

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

(Keywords: mobile, perf, regression)

Attachments

(1 file, 5 obsolete files)

Even with GPU YUV decoding video still very slow, because we rendering video layer using intermediate surface in ContainerLayerOGL. Flash video works fine, but not HTML5 video. with HTML5 video we have non integer translation and non-empty clipRect.... don't know what causing that, possibly some video controls, or something else. With disabled intermediate surface (hackish) youtube HTML5 video works fast
We should consider retaining intermediate surfaces. That might very well help a lot. The one downside is depending on how deep the tree is the amount of intermediate surfaces retained could grow large. We could retain a limited amount though, depending on certain heuristics.
Attached patch Cache temportary surface (obsolete) — Splinter Review
We can cache temporary container surface
This will help us get rid of expensive create/destroy offscreen surface which is very expensive in SGX drivers
Attachment #536003 - Attachment is obsolete: true
Attachment #536138 - Flags: review?(jmuizelaar)
Hmm, I've checked latest trunk with flash plugin rendering and it also always rendering with Intermediate surface.... but it did not happen before... seems it some regression.
Comment on attachment 536138 [details] [diff] [review] Cache offscreen FBO, for OGL container, Latest regression range: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6a76f02f19e1&tochange=f7fc3beccae7 Not sure but it might be caused by bug 654950
Attachment #536138 - Flags: review?(jmuizelaar)
Ok, after reversion of http://hg.mozilla.org/mozilla-central/rev/ed0850a1bbb7 video start working fast without intermediate surface
Blocks: 654950
How does that patch affect whether an intermediate surface is used? I don't see how it can.
Oh, this? - !contTransform.PreservesAxisAlignedRectangles()) { + contTransform.HasNonIntegerTranslation()) { OK.
Why does the child have a cliprect?
We could revert just that change, but someone would have to also fix the scissor-rect calculation code, which was completely wrong before.
> - !contTransform.PreservesAxisAlignedRectangles()) { > + contTransform.HasNonIntegerTranslation()) { > > OK. yeah, this one... is it ok to revert just this change or is it super important for bug 654950 ?
reverting only that one change breaking layer rendering... I see only bottom part of image layer rendered on youtube.
Is it possible to make some test with certain layout which is checking this intermediate surface issue
Attached patch Backout patch (obsolete) — Splinter Review
Assignee: nobody → romaxa
Attachment #536138 - Attachment is obsolete: true
Attachment #539600 - Flags: review?(roc)
Attachment #539600 - Attachment is obsolete: true
Attachment #539600 - Flags: review?(roc)
Attachment #539668 - Flags: review?(roc)
Comment on attachment 539668 [details] [diff] [review] Backout 654950, removed missing test Review of attachment 539668 [details] [diff] [review]: ----------------------------------------------------------------- Why are you backing it out? Isn't this just going to reopen bug 654950? We should be changing just the line in comment #9 and then fixing CalculateScissorRect to handle non-translation transforms.
Attachment #539668 - Flags: review?(roc) → review-
Comment on attachment 539668 [details] [diff] [review] Backout 654950, removed missing test Review of attachment 539668 [details] [diff] [review]: ----------------------------------------------------------------- Why are you backing it out? Isn't this just going to reopen bug 654950? We should be changing just the line in comment #9 and then fixing CalculateScissorRect to handle non-translation transforms.
Attachment #539668 - Attachment is obsolete: true
Attachment #539702 - Flags: review?(roc)
Comment on attachment 539702 [details] [diff] [review] use matr.transform + round in case of non-integer translation Review of attachment 539702 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/Layers.cpp @@ +339,5 @@ > + gfxRect trScissor = matrix.TransformBounds(r); > + trScissor.Round(); > + if (!gfxUtils::GfxRectToIntRect(trScissor, &scissor)) { > + return nsIntRect(currentClip.TopLeft(), nsIntSize(0, 0)); > + } This is the right idea. Let's just take this code path always. No need to check HasNonIntegerTranslation, this code path works fine for the integer translation case. But add an assertion that at least the transform has PreservesAxisAlignedRectangles. @@ +413,5 @@ > } else { > useIntermediateSurface = PR_FALSE; > gfxMatrix contTransform; > if (!mEffectiveTransform.Is2D(&contTransform) || > + !contTransform.PreservesAxisAlignedRectangles()) { I think we should probably use OPTIMIZE_MOBILE here; when the GPU is sufficiently powerful that the intermediate surface is not a problem, we should get slightly better results by not rounding the clip.
Attachment #539702 - Attachment is obsolete: true
Attachment #539702 - Flags: review?(roc)
Attachment #539719 - Flags: review?(roc)
Comment on attachment 539719 [details] [diff] [review] Round NonIntegerTranslation on mobile Review of attachment 539719 [details] [diff] [review]: -----------------------------------------------------------------
Attachment #539719 - Flags: review?(roc) → review+
Try server looks good, please push it http://tbpl.mozilla.org/?tree=Try&rev=85da463bad9c
Keywords: checkin-needed, perf
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
This regression is present in Firefox 6. Is this fix suitable for landing on the Aurora channel? If so, please request mozilla-approval-aurora.
tracking-fennec: --- → ?
Keywords: mobile
Comment on attachment 539719 [details] [diff] [review] Round NonIntegerTranslation on mobile I think this is relevant for desktop versions (which are using OGL backend). Not sure if it is relevant for mobile like android because it in software mode... but let's see
Attachment #539719 - Flags: approval-mozilla-aurora?
If it affects Android, it could explain bug 661606.
Ah, ok I see, probably make sense and this could be a reason
Let's give this sime time to bake on trunk before moving to aurora. Leaving nom'ed for the next triage.
May be causing bug 659119?
Can we get a risk analysis here? It's been baking for a week now.
Pretty much no risk on desktop, more on mobile.
Comment on attachment 539719 [details] [diff] [review] Round NonIntegerTranslation on mobile Mark says they would like this for mobile and given that the risk is low to desktop and the Mobile folks are OK with their risk, I'm approving.
Attachment #539719 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(In reply to comment #31) > May be causing bug 659119? This isn't in FF5 or FF6, so no.
(In reply to comment #35) Sorry, I meant the bug, not the patch. As in the patch might also address bug 659119?
The patch fixes a regression that first appeared in Firefox 6, so it's probably not a big help for bug 659119.
Target Milestone: mozilla7 → mozilla6
Keywords: regression
tracking-fennec: ? → 6+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: