OSDN Git Service

gallium-xlib: query MIT-SHM before using it.
authorBart Oldeman <bart.oldeman@calculquebec.ca>
Sun, 3 Feb 2019 02:57:10 +0000 (02:57 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 14 Feb 2019 12:28:47 +0000 (12:28 +0000)
commitfdb66dd1558cd2c6b2ae37b5fd3b03647f9ee8cf
tree17a1fbf3653eece823e35b5f57ab393d42cd1086
parente868c7761522759974a850e233d1e22d5e5eab8b
gallium-xlib: query MIT-SHM before using it.

When Mesa is compiled for gallium-xlib using e.g.
./configure --enable-glx=gallium-xlib --disable-dri --disable-gbm
-disable-egl
and is used by an X server (usually remotely via SSH X11 forwarding)
that does not support MIT-SHM such as XMing or MobaXterm, OpenGL
clients report error messages such as
Xlib:  extension "MIT-SHM" missing on display "localhost:11.0".
ad infinitum.

The reason is that the code in src/gallium/winsys/sw/xlib uses
MIT-SHM without checking for its existence, unlike the code
in src/glx/drisw_glx.c and src/mesa/drivers/x11/xm_api.c.
I copied the same check using XQueryExtension, and tested with
glxgears on MobaXterm.

This issue was reported before here:
https://lists.freedesktop.org/archives/mesa-users/2016-July/001183.html

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a203eaa4f4fb672b95426289b8dad3a8998f92d7)
src/gallium/winsys/sw/xlib/xlib_sw_winsys.c