[Intel-gfx] Fix for hang with XV vs. screensaver

Carl Worth cworth at cworth.org
Mon Apr 6 20:22:10 CEST 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
window size).

I'll follow up with patches for each of those.

-Carl

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: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090406/f8082772/attachment.sig>


More information about the Intel-gfx mailing list