diff --git a/.pick_status.json b/.pick_status.json index 732fc6ebd70..bcc53eb14e6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -76,7 +76,7 @@ "description": "dri: add another get shm variant.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "02c3dad0f3b4d26e0faa5cc51d06bc50d693dcdc" }, 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); }; /** 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; }