[Intel-gfx] Fix for hang with XV vs. screensaver
cworth at cworth.org
Mon Apr 6 11:22:10 PDT 2009
I recently ran across a bug leading to GPU hangs while watching videos.
The simplest way I found to replicate the bug is:
* Start video player
* xset +dpms
* xset dpms 5 5 5
* Wait 5 seconds
Eric and I used the recent batch-buffer dumping code, (and some
batch-buffer parsing code from the 3D driver which I will be putting
into a new intel_gpu_dump program inside the intel_gpu_tools
repository), and found that the bug is that the batch is waiting for a
VBLANK event even though the CRTC is off, so VBLANK will never come.
The easiest workaround, which verifies that the sync-to-vblank code is
causing the problem, is to disable it with:
xvattr -a XV_SYNC_TO_VBLANK -v 0
(Note that some video players will set this to 1 at startup,
so do this after the vide player is started.)
A real fix, which preserves the very nice tear-free video playback, is
to not wait for VBLANK, but instead simply wait until the scanline is
outside of the current window. And once we do that, we don't need the
special "-1 == auto" value for XV_SYNC_TO_VBLANK with the window-size
heuristic, (since the cost of the sync now automatically tracks the
I'll follow up with patches for each of those.
PS. I wrote this message last Thursday, when I found the bug and first
started writing a fix. Today, as I'm getting ready to push a fix, Keith
says that there's a bug assigned to Jesse which might be related. I see
21027 "xvideo hang X" but it actually looks unrelated. Does somebody
know of any filed instance of the bug I'm fixing here?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/intel-gfx/attachments/20090406/f8082772/attachment.pgp
More information about the Intel-gfx