Mesa (staging/20.0): glx/drisw: return false if shmid == -1

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 25 17:45:10 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: c2dac5a508c140562df40f9c50d546cf0a5558d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2dac5a508c140562df40f9c50d546cf0a5558d8

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Feb 24 10:19:51 2020 +1000

glx/drisw: return false if shmid == -1

If an attempt to create an shm pixmap in XCreateDrawable fails
then it ends up with the shmid == -1. This means the get image
path needs to fallback so return false in this case to use the
non-shm get image path.

Fixes: 02c3dad0f3b4 ("Call shmget() with permission 0600 instead of 0777")

Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3823>
(cherry picked from commit 246e4aeaef4c1f1071c64e9681fc9229aac22020)

---

 .pick_status.json   | 2 +-
 src/glx/drisw_glx.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 3e7f79208dd..de8f1c62a51 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -58,7 +58,7 @@
         "description": "glx/drisw: return false if shmid == -1",
         "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 6e37f0274b0..dfa3218d759 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -303,6 +303,9 @@ swrastGetImageShm2(__DRIdrawable * read,
       if (!XCreateDrawable(prp, shmid, dpy))
          return GL_FALSE;
    }
+
+   if (prp->shminfo.shmid == -1)
+      return GL_FALSE;
    readable = pread->xDrawable;
 
    ximage = prp->ximage;



More information about the mesa-commit mailing list