glx: fix regression for drawable type detection
authorQiang Yu <yuq825@gmail.com>
Wed, 8 Dec 2021 02:57:45 +0000 (10:57 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 9 Dec 2021 00:52:17 +0000 (00:52 +0000)
commitc50bdacbda6dc63d4c794e79357ffebf9756aa8a
tree47272047dabcbe47e9137f02d4ab4204f69ddcc8
parentff74d5dd1b83f090ece0a0594fe691eefe2875c0
glx: fix regression for drawable type detection

Newer version of XServer supporting GLX_DRAWABLE_TYPE query also
support query with raw X11 window ID besides GLXWindow ID. So we
should not limit the suppported type to GLXPbuffer when query
success.

Otherwise can't start GLX application on newer XServer with:

  libGL error: GLX drawable type is not supported
  libGL error: GLX drawable type is not supported
  X Error of failed request:  GLXBadContext
    Major opcode of failed request:  149 (GLX)
    Minor opcode of failed request:  5 (X_GLXMakeCurrent)
    Serial number of failed request:  35
    Current serial number in output stream:  35

Fixes: 6625c960c58 ("glx: check drawable type before create drawble")

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14120>
src/glx/dri_common.c