diff options
author | Dave Airlie <[email protected]> | 2020-02-14 15:00:13 +1000 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-25 01:23:01 +0000 |
commit | 466a0b2e4953018646ee344f5f6f6e9e84b66a1a (patch) | |
tree | c736e198ff4c9838749589500ee7b8f87fb741cc /src/gallium/state_trackers | |
parent | a91067d3f5c8357548ca2756023b81daf013e47c (diff) |
dri: add another get shm variant.
When Brian in 02c3dad0f3b4d26e0faa5cc51d06bc50d693dcdc restricted
the shm permissions it means we hit the fallback paths in some
scenarios we hadn't before.
When you use Xephyr to xdmcp from one user to another the new perms
stop the X server (running as user a) attaching to the SHM segments
from gnome-shell (running as user b).
In this case however only the GLX side of the code had insight into this,
and the dri could was meant of fall back, and it worked for put image
fine but the get image path was broken, since there was no indication
in the broken case of the need to fallback.
This adds a return type to a new interface member that lets the
caller know it has to fallback.
Fixes: 02c3dad0f3b4 ("Call shmget() with permission 0600 instead of 0777")
Reviewed-by: Michel Dänzer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3823>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/dri/drisw.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c index e3fb3f1b925..df364c47391 100644 --- a/src/gallium/state_trackers/dri/drisw.c +++ b/src/gallium/state_trackers/dri/drisw.c @@ -138,6 +138,9 @@ get_image_shm(__DRIdrawable *dPriv, int x, int y, int width, int height, if (!res->screen->resource_get_handle(res->screen, NULL, res, &whandle, PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE)) return FALSE; + if (loader->base.version > 5 && loader->getImageShm2) + return loader->getImageShm2(dPriv, x, y, width, height, whandle.handle, dPriv->loaderPrivate); + loader->getImageShm(dPriv, x, y, width, height, whandle.handle, dPriv->loaderPrivate); return TRUE; } |