summaryrefslogtreecommitdiff
path: root/src/glx
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-02-24 10:29:46 +1000
committerMarge Bot <eric+marge@anholt.net>2020-02-25 01:23:01 +0000
commit84395190ec8cae6158737777c8def7cc3304eb3f (patch)
treed6bc2b348bac177f04131499a7ee651f60d45b81 /src/glx
parent246e4aeaef4c1f1071c64e9681fc9229aac22020 (diff)
glx/drisw: fix shm put image fallback
The fallback to the non-shm put path used the wrong width here as the pixmap is still allocated in a shared segment, so the width needs to reflect that. Fixes: 02c3dad0f3b4 ("Call shmget() with permission 0600 instead of 0777") Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3823> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3823>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/drisw_glx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index dfa3218d759..985e258663e 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -193,14 +193,13 @@ swrastXPutImage(__DRIdrawable * draw, int op,
ximage->bytes_per_line = stride ? stride : bytes_per_line(w * ximage->bits_per_pixel, 32);
ximage->data = data;
+ ximage->width = ximage->bytes_per_line / ((ximage->bits_per_pixel + 7)/ 8);
+ ximage->height = h;
+
if (pdp->shminfo.shmid >= 0) {
- ximage->width = ximage->bytes_per_line / ((ximage->bits_per_pixel + 7)/ 8);
- ximage->height = h;
XShmPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h, False);
XSync(dpy, False);
} else {
- ximage->width = w;
- ximage->height = h;
XPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h);
}
ximage->data = NULL;