drisw: Try harder to probe whether MIT-SHM works
authorAdam Jackson <ajax@redhat.com>
Tue, 5 Mar 2019 20:31:51 +0000 (15:31 -0500)
committerDave Airlie <airlied@redhat.com>
Mon, 8 Apr 2019 23:50:24 +0000 (09:50 +1000)
commit52426ce4a929f7e1389baf490967fc02357b3f5e
treeffe79243fcaafba92cefb16091068619de126ae4
parent50f3535d1fb7c377b800e80a838dcfcbda4699df
drisw: Try harder to probe whether MIT-SHM works

XQueryExtension merely tells you whether the extension exists, it
doesn't tell you whether you're local enough for it to work.
XShmQueryVersion is not enough to discover this either, you need to
provoke the server to do actual work, and if it thinks you're remote it
will throw BadRequest at you. So send an invalid ShmDetach and use the
error code to distinguish local from remote.

[airlied: fixed bug not resetting xshm_error to 0 on success,
which made later stuff fail completely.]

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
src/glx/drisw_glx.c