Mesa (staging/20.0): glx/drisw: fix shm put image fallback
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 25 17:45:10 UTC 2020
Module: Mesa
Branch: staging/20.0
Commit: 555bf5f99118cf15504ca3c81c12d0a05f36caa9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=555bf5f99118cf15504ca3c81c12d0a05f36caa9
Author: Dave Airlie <airlied at redhat.com>
Date: Mon Feb 24 10:29:46 2020 +1000
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 at 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>
(cherry picked from commit 84395190ec8cae6158737777c8def7cc3304eb3f)
---
.pick_status.json | 2 +-
src/glx/drisw_glx.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index de8f1c62a51..ea1da78c412 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -49,7 +49,7 @@
"description": "glx/drisw: fix shm put image fallback",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "02c3dad0f3b4d26e0faa5cc51d06bc50d693dcdc"
},
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;
More information about the mesa-commit
mailing list