Skip to content
Commits on Source (3)
mesa (19.3.1-4) UNRELEASED; urgency=medium
mesa (19.3.1-4) unstable; urgency=medium
[ Julien Cristau ]
* Ensure strict dependencies on libglapi-mesa (closes: #947813).
-- Julien Cristau <jcristau@debian.org> Fri, 03 Jan 2020 17:13:00 +0100
[ Timo Aaltonen ]
* control: Add libgl{,x}-dev to mesa-common-dev Depends. (Closes:
#947392)
* drisw-fix-depth-for-ximage.diff: Fix sw driver rgbBits/depth calculation.
(Closes: #947196)
-- Timo Aaltonen <tjaalton@debian.org> Wed, 08 Jan 2020 11:38:56 +0200
mesa (19.3.1-3) unstable; urgency=medium
......
......@@ -301,6 +301,8 @@ Package: mesa-common-dev
Section: libdevel
Architecture: any
Depends:
libgl-dev,
libglx-dev,
libx11-dev,
libdrm-dev (>= 2.4.95) [!hurd-any],
${misc:Depends},
......
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 3bf15322ff85e1397aa3174a308a870c50ec4756..61e11c3dbc4317fff0484b6cd9e0110765246a25 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -53,6 +53,28 @@ handle_xerror(Display *dpy, XErrorEvent *event)
static Bool
XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy)
{
+ int depth = 0;
+
+ /* Use the visual depth, if this fbconfig corresponds to a visual */
+ if (pdp->config->visualID != 0) {
+ int matches = 0;
+ XVisualInfo *visinfo, template;
+
+ template.visualid = pdp->config->visualID;
+ template.screen = pdp->config->screen;
+ visinfo = XGetVisualInfo(dpy, VisualIDMask | VisualScreenMask,
+ &template, &matches);
+
+ if (visinfo && matches) {
+ depth = visinfo->depth;
+ XFree(visinfo);
+ }
+ }
+
+ /* Otherwise, or if XGetVisualInfo failed, use rgb(not a) size */
+ if (depth == 0)
+ depth = pdp->config->rgbBits - pdp->config->alphaBits;
+
if (pdp->ximage) {
XDestroyImage(pdp->ximage);
pdp->ximage = NULL;
@@ -64,7 +86,7 @@ XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy)
pdp->shminfo.shmid = shmid;
pdp->ximage = XShmCreateImage(dpy,
NULL,
- pdp->config->rgbBits,
+ depth,
ZPixmap, /* format */
NULL, /* data */
&pdp->shminfo, /* shminfo */
@@ -94,7 +116,7 @@ XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy)
pdp->shminfo.shmid = -1;
pdp->ximage = XCreateImage(dpy,
NULL,
- pdp->config->rgbBits,
+ depth,
ZPixmap, 0, /* format, offset */
NULL, /* data */
0, 0, /* width, height */
07_gallium-fix-build-failure-on-powerpcspe.diff
drisw-fix-depth-for-ximage.diff