summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2014-12-06 05:40:07 +0100
committerJulien Cristau <jcristau@debian.org>2014-12-09 17:42:02 +0100
commit77ef968c86b4ed1accd6f04ef7bc3d9700c22ed2 (patch)
tree9c8281c20142341200a7db2246636659be0cc665
parentf1fc86d61ed97f21579d2125c26de858c1d3ee43 (diff)
present: Avoid crashes in DebugPresent(), a bit more info.
DebugPresent() crashed the server when a dri3 drawable was closed while a pageflipped present was still pending, due to vblank->window-> Null-Ptr deref, so debug builds caused new problems to debug. E.g., glXSwapBuffers(...); glXDestroyWindow(...); -> Pageflip for non-existent window completes -> boom. Also often happens when switching desktop compositor on/off due to Present unflips, or when logging out of session. Also add info if a Present is queued for copyswap or pageflip, if the present is vsynced, and the serial no of the Present request, to aid debugging of pageflip and vsync issues. The serial number is useful as Mesa's dri3/present backend encodes its sendSBC in the serial number, so one can easily correlate server debug output with Mesa and with the SBC values returned to actual OpenGL client applications via OML_sync_control and INTEL_swap_events extension, makes debugging quite a bit more easy. Please also cherry-pick this for a 1.16.x stable update. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 32d3100bd78efe41d468f7d66861296aee468b6f) Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--present/present.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/present/present.c b/present/present.c
index 93fc97648..5321c7a0b 100644
--- a/present/present.c
+++ b/present/present.c
@@ -435,7 +435,7 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
vblank->event_id, vblank, vblank->target_msc,
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
- vblank->window->drawable.id));
+ vblank->window ? vblank->window->drawable.id : 0));
assert (vblank == screen_priv->flip_pending);
@@ -854,10 +854,10 @@ present_pixmap(WindowPtr window,
}
if (pixmap)
- DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p)\n",
+ DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p) flip %d vsync %d serial %d\n",
vblank->event_id, vblank, target_msc,
vblank->pixmap->drawable.id, vblank->window->drawable.id,
- target_crtc));
+ target_crtc, vblank->flip, vblank->sync_flip, vblank->serial));
xorg_list_add(&vblank->event_queue, &present_exec_queue);
vblank->queued = TRUE;
@@ -949,7 +949,7 @@ present_vblank_destroy(present_vblank_ptr vblank)
DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
vblank->event_id, vblank, vblank->target_msc,
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
- vblank->window->drawable.id));
+ vblank->window ? vblank->window->drawable.id : 0));
/* Drop pixmap reference */
if (vblank->pixmap)