diff --git a/.gitignore b/.gitignore index 3d01925..4b27d16 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/mesa-19.3.0-rc4.tar.xz +SOURCES/mesa-19.3.4.tar.xz diff --git a/.mesa.metadata b/.mesa.metadata index 0dd6d67..1e49d90 100644 --- a/.mesa.metadata +++ b/.mesa.metadata @@ -1 +1 @@ -f4eeb09a7dece984364a509154170a85deee9ea0 SOURCES/mesa-19.3.0-rc4.tar.xz +73dccea365efef46c700bcfd87d14209381efa3d SOURCES/mesa-19.3.4.tar.xz diff --git a/SOURCES/0001-dri-add-another-get-shm-variant.patch b/SOURCES/0001-dri-add-another-get-shm-variant.patch new file mode 100644 index 0000000..2d3cc3b --- /dev/null +++ b/SOURCES/0001-dri-add-another-get-shm-variant.patch @@ -0,0 +1,77 @@ +From 7881d29f2c729e4a8a5af21a0abcf3db18e22918 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Fri, 14 Feb 2020 15:00:13 +1000 +Subject: [PATCH 1/2] 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") +--- + include/GL/internal/dri_interface.h | 15 ++++++++++++++- + src/gallium/state_trackers/dri/drisw.c | 3 +++ + 2 files changed, 17 insertions(+), 1 deletion(-) + +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; + } +-- +2.21.1 + diff --git a/SOURCES/0001-llvmpipe-ppc-fix-if-ifdef-confusion-in-backport.patch b/SOURCES/0001-llvmpipe-ppc-fix-if-ifdef-confusion-in-backport.patch deleted file mode 100644 index c2d5a67..0000000 --- a/SOURCES/0001-llvmpipe-ppc-fix-if-ifdef-confusion-in-backport.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 27d0c526ec926de8eca10917b4a1b68080f45187 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Thu, 21 Nov 2019 05:53:03 +1000 -Subject: [PATCH] llvmpipe/ppc: fix if/ifdef confusion in backport. - -Fixes: 32aba91c07f (llvmpipe: use ppc64le/ppc64 Large code model for JIT-compiled shaders) ---- - src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -index ee27f346254..89d3fb9133b 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -@@ -469,7 +469,7 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, - */ - builder.setCodeModel(CodeModel::Large); - --#if PIPE_ARCH_LITTLE_ENDIAN -+#ifdef PIPE_ARCH_LITTLE_ENDIAN - /* - * Versions of LLVM prior to 4.0 lacked a table entry for "POWER8NVL", - * resulting in (big-endian) "generic" being returned on --- -2.21.0 - diff --git a/SOURCES/0002-glx-add-getImageShm2-path.patch b/SOURCES/0002-glx-add-getImageShm2-path.patch new file mode 100644 index 0000000..d8062b3 --- /dev/null +++ b/SOURCES/0002-glx-add-getImageShm2-path.patch @@ -0,0 +1,77 @@ +From 74e4f90deeae466ed19d2a31d8f62f6fc5e1709b Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Fri, 14 Feb 2020 15:03:24 +1000 +Subject: [PATCH 2/2] glx: add getImageShm2 path + +If the glx side shmid is -1 (because the X server failed to attach) +then we should let the caller know to fallback. + +Fixes: 02c3dad0f3b4 ("Call shmget() with permission 0600 instead of 0777") +--- + src/glx/drisw_glx.c | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c +index 069f64d5216..dfa3218d759 100644 +--- a/src/glx/drisw_glx.c ++++ b/src/glx/drisw_glx.c +@@ -288,10 +288,10 @@ swrastGetImage(__DRIdrawable * read, + swrastGetImage2(read, x, y, w, h, 0, data, loaderPrivate); + } + +-static void +-swrastGetImageShm(__DRIdrawable * read, +- int x, int y, int w, int h, +- int shmid, void *loaderPrivate) ++static GLboolean ++swrastGetImageShm2(__DRIdrawable * read, ++ int x, int y, int w, int h, ++ int shmid, void *loaderPrivate) + { + struct drisw_drawable *prp = loaderPrivate; + __GLXDRIdrawable *pread = &(prp->base); +@@ -301,8 +301,11 @@ swrastGetImageShm(__DRIdrawable * read, + + if (!prp->ximage || shmid != prp->shminfo.shmid) { + if (!XCreateDrawable(prp, shmid, dpy)) +- return; ++ return GL_FALSE; + } ++ ++ if (prp->shminfo.shmid == -1) ++ return GL_FALSE; + readable = pread->xDrawable; + + ximage = prp->ximage; +@@ -312,10 +315,19 @@ swrastGetImageShm(__DRIdrawable * read, + ximage->bytes_per_line = bytes_per_line(w * ximage->bits_per_pixel, 32); + + XShmGetImage(dpy, readable, ximage, x, y, ~0L); ++ return GL_TRUE; ++} ++ ++static void ++swrastGetImageShm(__DRIdrawable * read, ++ int x, int y, int w, int h, ++ int shmid, void *loaderPrivate) ++{ ++ swrastGetImageShm2(read, x, y, w, h, shmid, loaderPrivate); + } + + static const __DRIswrastLoaderExtension swrastLoaderExtension_shm = { +- .base = {__DRI_SWRAST_LOADER, 5 }, ++ .base = {__DRI_SWRAST_LOADER, 6 }, + + .getDrawableInfo = swrastGetDrawableInfo, + .putImage = swrastPutImage, +@@ -325,6 +337,7 @@ static const __DRIswrastLoaderExtension swrastLoaderExtension_shm = { + .putImageShm = swrastPutImageShm, + .getImageShm = swrastGetImageShm, + .putImageShm2 = swrastPutImageShm2, ++ .getImageShm2 = swrastGetImageShm2, + }; + + static const __DRIextension *loader_extensions_shm[] = { +-- +2.21.1 + diff --git a/SOURCES/Makefile b/SOURCES/Makefile index a3b6b3b..68bdaa7 100644 --- a/SOURCES/Makefile +++ b/SOURCES/Makefile @@ -1,4 +1,4 @@ -VERSION ?= 19.3.0-rc4 +VERSION ?= 19.3.4 SANITIZE ?= 1 DIRNAME = mesa-${VERSION} diff --git a/SOURCES/dri-shm-fix-put-image.patch b/SOURCES/dri-shm-fix-put-image.patch new file mode 100644 index 0000000..7548e56 --- /dev/null +++ b/SOURCES/dri-shm-fix-put-image.patch @@ -0,0 +1,12 @@ +diff -up mesa-19.3.3/src/glx/drisw_glx.c.dma mesa-19.3.3/src/glx/drisw_glx.c +--- mesa-19.3.3/src/glx/drisw_glx.c.dma 2020-02-14 12:37:42.551008273 +1000 ++++ mesa-19.3.3/src/glx/drisw_glx.c 2020-02-14 12:37:49.683081406 +1000 +@@ -199,7 +199,7 @@ swrastXPutImage(__DRIdrawable * draw, in + XShmPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h, False); + XSync(dpy, False); + } else { +- ximage->width = w; ++ ximage->width = ximage->bytes_per_line / ((ximage->bits_per_pixel + 7)/ 8); + ximage->height = h; + XPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h); + } diff --git a/SPECS/mesa.spec b/SPECS/mesa.spec index 571fc8d..0952e53 100644 --- a/SPECS/mesa.spec +++ b/SPECS/mesa.spec @@ -36,12 +36,12 @@ %global sanitize 0 -%global rctag rc4 +#global rctag rc4 Name: mesa Summary: Mesa graphics libraries -Version: 19.3.0 -Release: 3%{?rctag:.%{rctag}}%{?dist} +Version: 19.3.4 +Release: 2%{?rctag:.%{rctag}}%{?dist} License: MIT URL: http://www.mesa3d.org @@ -55,7 +55,12 @@ Source3: Makefile # Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD. Source4: Mesa-MLAA-License-Clarification-Email.txt -Patch1: 0001-llvmpipe-ppc-fix-if-ifdef-confusion-in-backport.patch +# fix for shm black images with Xephyr (#1798702) +# upstream in 19.3.5 most likely +Patch0: 0001-dri-add-another-get-shm-variant.patch +Patch1: 0002-glx-add-getImageShm2-path.patch +Patch2: dri-shm-fix-put-image.patch + BuildRequires: gcc BuildRequires: gcc-c++ @@ -538,6 +543,15 @@ done %endif %changelog +* Thu Feb 20 2020 Dave Airlie - 19.3.4-2 +- Fix put image shm fallback path. + +* Sat Feb 15 2020 Dave Airlie - 19.3.4-1 +- Update to 19.3.4 release (s390x fix) + +* Thu Jan 30 2020 Dave Airlie - 19.3.3-1 +- Update to 19.3.3 release + * Mon Nov 25 2019 Dave Airlie - 19.3.0-3 - drop khr-devel subpackage from here