OSDN Git Service

drisw: Cache the depth of the X drawable
authorAdam Jackson <ajax@redhat.com>
Mon, 6 Jan 2020 16:06:30 +0000 (11:06 -0500)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 28 Jan 2020 16:54:25 +0000 (08:54 -0800)
commit5feb926e05c0a5f8bae42a4dd7491273e5ed19ce
treeeb2041265bba73bcb18153d2d7e5bc18b2f45a06
parentaea41a56bd5bfd0b7c0aa243231f2f29d22a60d2
drisw: Cache the depth of the X drawable

This is not always ->rgbBits, because there are cases where that could
be 32 but we're (legally) bound to a depth-24 pixmap. The important
thing to have match here is the actual server-side notion of depth.  You
can look this up (at modest expense) from the xlib visual info if the
fbconfig has a visual. But it might not, so if not, fetch it (at
slightly greater expense) from XGetGeometry. Do this at GLX drawable
creation so you don't have to do it on the SwapBuffers path.

Apparently this fixes glx/glx-swap-singlebuffer, which is unintentional
but quite pleasant.

Fixes: mesa/mesa#2291
Fixes: 90d58286 ("drisw: Fix and simplify drawable setup")
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3305>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3305>
(cherry picked from commit 2fc11e8a05f59bbffed284c86108fedbac315081)

Conflicts:
.gitlab-ci/piglit/quick_gl.txt

This testing doesn't exist in the 19.3 branch, so I've deleted the file.

Dylan
.pick_status.json
src/glx/drisw_glx.c
src/glx/drisw_priv.h