glx: fix querying GLX_FBCONFIG_ID for Window
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 13 Dec 2021 14:07:13 +0000 (15:07 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Dec 2021 01:21:36 +0000 (01:21 +0000)
commit1cb5c1775b0a647600d3159c287063bccd0cc38c
treeb9bd63325b8b8c66938b5143a06bc334d9b5a354
parent6c5b3c6bb56b12ae1e0f04e7bb62e2e60abe991d
glx: fix querying GLX_FBCONFIG_ID for Window

This commit fixes apps using the following sequence:
1. XCreateWindow(dpy) -> win
2. glXCreateContextAttribsARB(dpy, ...) -> ctx
3. glXMakeCurrent(dpy, win, ctx)
4. glXQueryDrawable(dpy, win, GLX_FBCONFIG_ID, ...)

glXQueryDrawable returned 0 (while correctly returning a valid
GLXFCONFIG_ID for other types of drawables).

This commit adds the same dance as driInferDrawableConfig to get
the GLX visual from the Window, and then the GLXFBCONFIG_ID of
this visual.

This fixes:
* piglit: glx-query-drawable --attr=GLX_FBCONFIG_ID --type=WINDOW
* Maya which uses the config ID from step 4 as an input to
glXChooseFBConfig.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14174>
15 files changed:
src/broadcom/ci/v3d-rpi4-fails.txt
src/broadcom/ci/vc4-rpi3-fails.txt
src/freedreno/ci/freedreno-a307-fails.txt
src/freedreno/ci/freedreno-a530-fails.txt
src/freedreno/ci/freedreno-a630-fails.txt
src/gallium/drivers/iris/ci/iris-amly-fails.txt
src/gallium/drivers/llvmpipe/ci/llvmpipe-quick_gl.txt
src/gallium/drivers/radeonsi/ci/navi10-piglit-quick-fail.csv
src/gallium/drivers/radeonsi/ci/raven-piglit-quick-fail.csv
src/gallium/drivers/radeonsi/ci/sienna_cichlid-piglit-quick-fail.csv
src/gallium/drivers/softpipe/ci/softpipe-quick.txt
src/gallium/drivers/zink/ci/zink-lvp-fails.txt
src/gallium/drivers/zink/ci/zink-radv-fails.txt
src/glx/glx_pbuffer.c
src/panfrost/ci/panfrost-g52-fails.txt