diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-30 22:51:21 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-30 23:01:21 +0100 |
commit | cc20c45aa0ca15720510668d6918bf3c99104626 (patch) | |
tree | 8530e45efcf170eda2d25adf7dce5a3696ba6393 /src/sna/sna_video_textured.c | |
parent | 305734ebdf3d51c084cfbee8804b6c60b1f03a98 (diff) |
sna: Minimise the risk of hotplug hangs by checking fb before vsync
Everytime we issue a MI_WAIT_FOR_EVENT on a scan-line from userspace we
run the risk of that pipe being disable before we submit a batch. As the
pipe is then disabled or configured differently, we encounter an
indefinite wait and trigger a GPU hang.
To minimise the risk of a hotplug event being detected and submitting a
vsynced batch prior to noticing the removal of the pipe, perform an
explicit query of the current CRTC and delete the wait if we spot that
our framebuffer is no longer attached. This is about as good as we can
achieve without extra help from the kernel.
Reported-by: Francis Leblanc <Francis.Leblanc-Lebeau@verint.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45413 (and others)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video_textured.c')
-rw-r--r-- | src/sna/sna_video_textured.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index a71751c6..b740b6a0 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -306,8 +306,11 @@ sna_video_textured_put_image(ScrnInfoPtr scrn, /* Push the frame to the GPU as soon as possible so * we can hit the next vsync. */ - if (flush) + if (flush) { + if (!sna_crtc_is_bound(sna, crtc)) + sna->kgem.batch[sna->kgem.wait] = 0; kgem_submit(&sna->kgem); + } return ret; } |