Wait for any pending rendering before switching modes.
A perennial problem we have is the accursed WAIT_FOR_EVENT hangs, which occur when we switch the framebuffer before the WAIT_FOR_EVENT completes and upsets the GPU. We have tried more subtle approaches to detected these and fix them up in the kernel, to no avail. What we need to do is to delay the framebuffer flip until the WAIT completes, which is quite tricky in the kernel without new ioctls and round-trips. Instead, apply the big hammer from userspace and synchronise all rendering before changing the framebuffer. I expect this not to cause noticeable latency on switching modes (far less than the actual modeswitch) and should stop these hangs once and for all. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31401 (...) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
52b32436b9
commit
a44a63d2ff
|
|
@ -283,6 +283,9 @@ void intel_batch_wait_last(ScrnInfoPtr scrn)
|
|||
{
|
||||
intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||
|
||||
if (intel->last_batch_bo == NULL)
|
||||
return;
|
||||
|
||||
/* Map it CPU write, which guarantees it's done. This is a completely
|
||||
* non performance path, so we don't need anything better.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -359,6 +359,8 @@ intel_crtc_apply(xf86CrtcPtr crtc)
|
|||
crtc->gamma_blue, crtc->gamma_size);
|
||||
#endif
|
||||
|
||||
/* drain any pending waits on the current framebuffer */
|
||||
intel_batch_wait_last(crtc->scrn);
|
||||
|
||||
x = crtc->x;
|
||||
y = crtc->y;
|
||||
|
|
|
|||
Loading…
Reference in New Issue