diff options
author | Dave Airlie <[email protected]> | 2020-02-14 15:00:13 +1000 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2020-02-25 08:54:30 -0800 |
commit | b5b626396e01344b08d204b37cbd6080f547251e (patch) | |
tree | 7a190be9494d3dcb51ce9302e4bf7cf3a1cbe5bd /include | |
parent | 9243bbc9f9b2b6924bdfa2b31e02df8cdd367ed2 (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>
(cherry picked from commit 466a0b2e4953018646ee344f5f6f6e9e84b66a1a)
Diffstat (limited to 'include')
-rw-r--r-- | include/GL/internal/dri_interface.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 09782c8baeb..e40106575c0 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -634,7 +634,7 @@ struct __DRIdamageExtensionRec { * SWRast Loader extension. */ #define __DRI_SWRAST_LOADER "DRI_SWRastLoader" -#define __DRI_SWRAST_LOADER_VERSION 5 +#define __DRI_SWRAST_LOADER_VERSION 6 struct __DRIswrastLoaderExtensionRec { __DRIextension base; @@ -711,6 +711,19 @@ struct __DRIswrastLoaderExtensionRec { int width, int height, int stride, int shmid, char *shmaddr, unsigned offset, void *loaderPrivate); + + /** + * get shm image to drawable (v2) + * + * There are some cases where GLX can't use SHM, but DRI + * still tries, we need to get a return type for when to + * fallback to the non-shm path. + * + * \since 6 + */ + GLboolean (*getImageShm2)(__DRIdrawable *readable, + int x, int y, int width, int height, + int shmid, void *loaderPrivate); }; /** |