Bug 72290 - [945GM] video tearing in mpv (xf86-video-intel-2.99.906)
Summary: [945GM] video tearing in mpv (xf86-video-intel-2.99.906)
Status: RESOLVED DUPLICATE of bug 93679
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86 (IA32) All
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 22:50 UTC by Carsten Mattner
Modified: 2017-07-28 20:24 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
glxinfo (8.63 KB, text/plain)
2013-12-04 21:15 UTC, Carsten Mattner
no flags Details
Xorg.0.log (6.12 KB, text/plain)
2013-12-04 21:15 UTC, Carsten Mattner
no flags Details

Description Carsten Mattner 2013-12-03 22:50:52 UTC
After automatically enabling SNA again since 2.99.906 fixed #67209 I switched back to UXA again because of extreme tearing in 480p and 720p videos played back with mpv (http://mpv.io) opengl-old backend. No tearing with UXA.
Comment 1 Chris Wilson 2013-12-03 22:56:20 UTC
Using MESA_copy_subbuffer? Tearing is to be expected since it is not specified to be tear-free. Only if the application uses swapbuffers will it be tearfree.
Comment 2 Chris Wilson 2013-12-03 23:10:03 UTC
For starters, I need Xorg.0.log, xorg.conf, and glxinfo. And for 945gm you should find the xv backend more performant and power efficient.
Comment 3 Carsten Mattner 2013-12-04 21:15:04 UTC
Created attachment 90282 [details]
glxinfo
Comment 4 Carsten Mattner 2013-12-04 21:15:44 UTC
Created attachment 90283 [details]
Xorg.0.log
Comment 5 Carsten Mattner 2013-12-04 21:17:19 UTC
No explicit xorg.conf.
Comment 6 Carsten Mattner 2013-12-04 21:18:18 UTC
(In reply to comment #2)
> And for 945gm you should find the xv backend more performant and
> power efficient.

Will try xv the next time I hit extreme tearing and check the difference.
Comment 7 Chris Wilson 2013-12-04 21:42:12 UTC
I also need to check whether you are using a compositing manager, which also affects whether vsync is performed.
Comment 8 Carsten Mattner 2013-12-04 21:51:31 UTC
(In reply to comment #7)
> I also need to check whether you are using a compositing manager, which also
> affects whether vsync is performed.

No compositing manager - just a minimal window manager.
Comment 9 Carsten Mattner 2013-12-04 21:53:46 UTC
(In reply to comment #6)
> (In reply to comment #2)
> > And for 945gm you should find the xv backend more performant and
> > power efficient.
> 
> Will try xv the next time I hit extreme tearing and check the difference.

I did try it when I saw tearing in a 720p video and using xv seems to have fixed it but tearing itself is sometimes subtle and sometimes hard to ignore.
Comment 10 Chris Wilson 2013-12-04 21:59:52 UTC
There is a good test case included with xf86-video-intel, test/tearing.mp4 (and test/mkvsync.sh) which should highlight tearing.

Given all of the above, both UXA and SNA implement vsync in the same fashion on gen3.
Comment 11 Carsten Mattner 2013-12-04 22:05:43 UTC
(In reply to comment #10)
> There is a good test case included with xf86-video-intel, test/tearing.mp4
> (and test/mkvsync.sh) which should highlight tearing.

Will have a look tomorrow.

> Given all of the above, both UXA and SNA implement vsync in the same fashion
> on gen3.

Am I using vsync without knowing or is that just stating the outcome of
your analysis?
Comment 12 Carsten Mattner 2013-12-04 22:06:51 UTC
Does "Tear free" disabled mean the driver didn't enable that feature and it's not something I could or should enable?
Comment 13 Chris Wilson 2013-12-04 22:15:42 UTC
TearFree is a driver option to redirect rendering onto a backbuffer and pageflip, like a compositing manager.

VSync is the mechanism the driver uses to prevent the GPU from rendering onto the frontbuffer whilst the display is scanning out from the target area - it prevents tearing within a window. For a fullscreen swapbuffer, we would use a pageflip instead. Hmm, actually if the application is too slow and misses its requested frame, the driver applies "Adapative VSync" and blits the update onto the scanout unsynchronised to the vertical refresh (in order to allow the application to catch up with its timeline).
Comment 14 Carsten Mattner 2013-12-04 22:53:37 UTC
So the vsync you're talking about is not one you usually enable manually in a game or similar to avoid glitches but is one that is built-in and always enabled in the driver?
Comment 15 Chris Wilson 2013-12-04 22:58:30 UTC
It is the one and the same. It is one of the mechanisms (vsync and pageflipping) that the driver uses to implement SwapBuffers that the games use.
Comment 16 Carsten Mattner 2013-12-04 23:10:51 UTC
Makes sense.
Comment 17 Carsten Mattner 2013-12-05 23:50:33 UTC
I remembered why I was using opengl-old backend. xv backend causes a slim right border of random colored pixels distracting from the video in full screen. No such issues in x11 backend but you suggested I use xv backend on this gpu.
Comment 18 Carsten Mattner 2013-12-06 20:06:33 UTC
(In reply to comment #10)
> There is a good test case included with xf86-video-intel, test/tearing.mp4
> (and test/mkvsync.sh) which should highlight tearing.
> 
> Given all of the above, both UXA and SNA implement vsync in the same fashion
> on gen3.

test/tearing.mp4 tears extremely in the lower third of the white bars when using mpv's x11 video out driver. xv and opengl-old mpv video out drivers look the same without such tearing to me but it's still hard on the eyes to watch and follow that big white bar move around. also I tried again and with xv backend that vertical line or border on the right of videos in mpv looks green most of the time. Chris do you need other information?
Comment 19 Carsten Mattner 2013-12-06 20:10:25 UTC
actually if I run mpv -vo opengl-old or mpv -vo x11 viewing tearing.mp4 both tear 1 out of 3 times in similar ways. running the same with the xv backend doesn't cause tearing. next I'll try UXA. and yeah it's ONE white bar not TWO.
Comment 20 Carsten Mattner 2013-12-06 20:35:52 UTC
If I force UXA then only mpv -vo x11 shows tearing and the green right border in full screen of mpv -vo xv doesn't show up at all in my limited tests. Is this useful information for improving/fixing SNA?
Comment 21 Carsten Mattner 2013-12-06 21:56:50 UTC
Tests were too limited and I finally made UXA and mpv -vo xv draw the green right border in a fullscreen video.
Comment 22 Chris Wilson 2013-12-30 13:31:46 UTC
The green bar on the right is mpv overallocating the XvImage and fill with 0 (which is green in the YUV colorspace) rather than padding. Those zeroes are then sampled by the hardware if we need to do any form of interpolation, causing it to seep into the output video.

To recap, are you happy that the output is indeed tear free? It sounds like the tests are passing with Xv.
Comment 23 Carsten Mattner 2014-01-04 18:07:01 UTC
(In reply to comment #22)
> The green bar on the right is mpv overallocating the XvImage and fill with 0
> (which is green in the YUV colorspace) rather than padding. Those zeroes are
> then sampled by the hardware if we need to do any form of interpolation,
> causing it to seep into the output video.

Can that be fixed or turned off. It only happens when the video width
is less than the screen width and it's not always clear green but random
and could be related to the video.

> To recap, are you happy that the output is indeed tear free? It sounds like
> the tests are passing with Xv.

I'm not entirely happy because it's not completely smooth but mpv in
SNA Xv mode is much smoother. If we can get rid of the green bar Xv
seems the best option of the three.

Speaking of tear and smoothness I was considering getting a new display
like Eizo Foris FG2421 that runs at 120Hz or 240Hz. Would that work
with 945gm or does that work at all with Xorg and xf86-video-intel?
Should I ask this on the list instead?
Comment 24 Pacho Ramos 2016-03-13 16:13:34 UTC
With xorg-server-1.18, intel driver from git at date 20160224 and mpv-0.16.0, with DRI3 enabled:

- I still suffer tearing if not using -vo=xv, with that one it's ok, but with any other -vo option I get tearing with any file and, also, tearing.mp4 test file :/
Comment 25 Pacho Ramos 2016-03-13 16:27:04 UTC
Manually enabling TearFree solves the problem but, wasn't it supposed to be unneeded with dri3? Also, why is not the option enabled automatically then? (at least for devices needing it)

Thanks :)
Comment 26 Elizabeth 2017-07-28 20:24:27 UTC

*** This bug has been marked as a duplicate of bug 93679 ***


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.