Bug 77063 - [[SNB][SNA][Regression in 2.99.911]] Firefox html5 video corrupted
Summary: [[SNB][SNA][Regression in 2.99.911]] Firefox html5 video corrupted
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 19:24 UTC by gedgon
Modified: 2014-10-03 15:23 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (90.61 KB, text/plain)
2014-04-04 19:24 UTC, gedgon
no flags Details
Xorg.0.log (24.16 KB, text/plain)
2014-04-04 19:25 UTC, gedgon
no flags Details
Screenshot (651.56 KB, image/png)
2014-04-05 10:04 UTC, gedgon
no flags Details

Description gedgon 2014-04-04 19:24:49 UTC
Created attachment 96916 [details]
dmesg

Possible regression or bug in Firefox triggered by lastest changes in sna. Reproducible only in SNA backed, driver version 2.99.911+ and Firefox version greater than 26. Video: http://youtu.be/NSJ4z--Id5s

Reproduce steps:
- open supported video in Firefox, e.g. http://video.webmfiles.org/big-buck-bunny_trailer.webm
Comment 1 gedgon 2014-04-04 19:25:44 UTC
Created attachment 96917 [details]
Xorg.0.log
Comment 2 Chris Wilson 2014-04-04 21:53:07 UTC
If you are certain it is a regression in sna, a bisection will be quick to perform. Just following the links here is not enough to trigger the bug for me - but that was just a casual try, I haven't yet tried to fully replicate your system with exact version of firefox (any hw video decoding?) and Xorg config.
Comment 3 gedgon 2014-04-05 00:14:15 UTC
(In reply to comment #2)
>> If you are certain it is a regression in sna

Just quessing, I can't reproduce this bug in uxa or glamor

>>Just following the links here is not enough to trigger the bug

Hmm, could be distro specific(?). This is reproducible by fellow Archers, https://bbs.archlinux.org/viewtopic.php?id=179419 I'll try Fedora or Ubuntu tomorrow.

>> (any hw video decoding?)

I'm using vpdpau for vaapi in mpv and works great, but I've no idea about state of hw video decoding in Firefox (beside Adobe Flash).

 
> and Xorg config.

Just this section added.

Section "ServerLayout"
    Identifier "ServerLayout0"
    Option "BlankTime" "0"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "0"
EndSection
Comment 4 gedgon 2014-04-05 10:04:14 UTC
Created attachment 96941 [details]
Screenshot

I was able to reproduce this bug in Ubuntu Trusty with intel video drivers from 3rd party xorg edgers ppa
Comment 5 Chris Wilson 2014-04-05 10:10:25 UTC
I have seen it under gnome-shell and and firefox-28. Since it is not using hardware accelerated decoding and just pushing pixels around, off the top of my head the issue looks like a pipeline synchronisation issue between firefox and gnome-shell.
Comment 6 Chris Wilson 2014-04-05 10:32:48 UTC
This is the hack to fix it:

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0116d54..b01c1e2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2527,7 +2527,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
                return _sna_pixmap_move_to_cpu(pixmap, flags);
        }
 
-       if ((flags & MOVE_READ) == 0 &&
+       if ((flags & MOVE_READ) == 0 && 0 &&
            priv->gpu_damage &&
            region_subsumes_damage(region, priv->gpu_damage)) {
                DBG(("%s: region [(%d, %d), (%d, %d)] subsumes damage [(%d,%d),

Now I just need to work out why that logic is wrong.
Comment 7 Chris Wilson 2014-04-05 11:24:48 UTC
There were bogons abound.

commit 3310ee89c1f1a663de5f5b12b8125809a213996f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Apr 5 12:18:31 2014 +0100

    sna: Avoid discarding damage when applying WHOLE hint to pixmap migration
    
    Once again, we must be careful when promoting from a region to whole
    pixmap migration that we do not discard required damage.
    
    Fixes regression from
    commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a [2.99.911]
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Thu Feb 27 08:33:52 2014 +0000
    
        sna: Avoid promoting region-to-whole migration and discarding damage
    
    Reported-by: gedgon@gmail.com
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77063
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 8 gedgon 2014-04-05 11:39:52 UTC
Darn! That was fast. Thank you!
Comment 9 jay-to-the-dee 2014-09-12 16:37:27 UTC
When will this fix be seen downstream in the main 01.org repos? The fix has been resolved for 5 months now and still no rollout to mainstream users!? I'm currently using the official Intel Graphics installer for Linux on Ubuntu 14.04 and it updates using the official repo found here:

https://download.01.org/gfx/ubuntu/14.04/main/pool/main/x/xserver-xorg-video-intel/

The latest version found in the repo is 2:2.99.911 which contains this regression. For now to suppress this bug I've forced the version down to 2:2.99.910 in the package manager, but as you can imagine this is a less than ideal pernament solution (and I imagine the Intel Graphics installer will attempt to override this). I'm sure there are many more affected by this bug that simply don't know where to start in terms of resolving it and for them an update to the repos to resolve it automatically would be welcomed! :)
Comment 10 Jani Nikula 2014-09-15 07:12:25 UTC
(In reply to comment #9)
> When will this fix be seen downstream in the main 01.org repos? The fix has
> been resolved for 5 months now and still no rollout to mainstream users!?
> I'm currently using the official Intel Graphics installer for Linux on
> Ubuntu 14.04 and it updates using the official repo found here:

Rodrigo?
Comment 11 jay-to-the-dee 2014-10-03 01:18:01 UTC
(In reply to Jani Nikula from comment #10)
> (In reply to comment #9)
> > When will this fix be seen downstream in the main 01.org repos? The fix has
> > been resolved for 5 months now and still no rollout to mainstream users!?
> > I'm currently using the official Intel Graphics installer for Linux on
> > Ubuntu 14.04 and it updates using the official repo found here:
> 
> Rodrigo?

Any update on this? Still no update in repos as far as I can see?!
Comment 12 Chris Wilson 2014-10-03 06:12:08 UTC
Urm. It is fixed.
Comment 13 jay-to-the-dee 2014-10-03 15:23:13 UTC
Yeah but from the end-users point of view this bug is still occurring and has made no progress since April! I appreciate in source this was fixed very quickly a long time ago, but it seems like a wasted effort unless people are able to actually access this fix! Currently by using the official installation means this is not possible so I don't know what else you expect the end user to do?


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.