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>
15 jobs for !389 with drisw-shm-remote-fix in 13 minutes and 50 seconds (queued for 1 second)
detached
Status Name Job ID Coverage
  Containers Build
passed ubuntu #223190

00:00:21

 
  Build+Test
passed autotools #223191

00:13:04

passed meson-clang #223193

00:13:26

passed meson-gallium-clover-llvm #223199

00:07:35

passed meson-gallium-clover-llvm39 #223200

00:07:46

passed meson-gallium-drivers-other #223198

00:09:31

passed meson-gallium-radeonsi #223197

00:07:00

passed meson-gallium-st-other #223201

00:06:00

passed meson-gallium-swr #223192

00:09:22

passed meson-glvnd #223196

00:05:57

passed meson-loader-classic-dri #223195

00:08:51

passed meson-vulkan #223194

00:05:06

passed scons-llvm #223203

00:08:08

passed scons-nollvm #223202

00:03:58

passed scons-swr #223204

00:06:55