1
0
forked from rpms/mesa

import mesa-20.1.4-1.el8

This commit is contained in:
CentOS Sources 2020-11-03 07:07:56 -05:00 committed by Andrew Lukoshko
parent f053d63396
commit 8ba06a9079
9 changed files with 10460 additions and 178 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/mesa-19.3.4.tar.xz
SOURCES/mesa-20.1.4.tar.xz

View File

@ -1 +1 @@
73dccea365efef46c700bcfd87d14209381efa3d SOURCES/mesa-19.3.4.tar.xz
78243cd7152a8ba759f8f2bdfcf0a877b455e351 SOURCES/mesa-20.1.4.tar.xz

View File

@ -1,77 +0,0 @@
From 7881d29f2c729e4a8a5af21a0abcf3db18e22918 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
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

View File

@ -0,0 +1,34 @@
From d3ec950f0d8492b980a91844ffd744d7e7824277 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Sat, 6 Jun 2020 16:58:00 +1000
Subject: [PATCH] nir: use bitfield_insert instead of bfi in
nir_lower_double_ops
NVIDIA hardware doesn't have an equivilant to bfi, but we do already have
a lowering for bitfield_insert->bfi.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5373>
---
src/compiler/nir/nir_lower_double_ops.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c
index f9c93a910a5..73226fd62ef 100644
--- a/src/compiler/nir/nir_lower_double_ops.c
+++ b/src/compiler/nir/nir_lower_double_ops.c
@@ -49,7 +49,9 @@ set_exponent(nir_builder *b, nir_ssa_def *src, nir_ssa_def *exp)
/* The exponent is bits 52-62, or 20-30 of the high word, so set the exponent
* to 1023
*/
- nir_ssa_def *new_hi = nir_bfi(b, nir_imm_int(b, 0x7ff00000), exp, hi);
+ nir_ssa_def *new_hi = nir_bitfield_insert(b, hi, exp,
+ nir_imm_int(b, 20),
+ nir_imm_int(b, 11));
/* recombine */
return nir_pack_64_2x32_split(b, lo, new_hi);
}
--
2.26.2

View File

@ -1,77 +0,0 @@
From 74e4f90deeae466ed19d2a31d8f62f6fc5e1709b Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
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

View File

@ -1,4 +1,4 @@
VERSION ?= 19.3.4
VERSION ?= 20.1.4
SANITIZE ?= 1
DIRNAME = mesa-${VERSION}
@ -10,7 +10,7 @@ clean:
rm -f mesa-${VERSION}.tar.xz
clone: clean
curl -O https://mesa.freedesktop.org/archive/mesa-${VERSION}.tar.xz
curl -O https://archive.mesa3d.org/mesa-${VERSION}.tar.xz
tar xf mesa-${VERSION}.tar.xz
sanitize: clone vl_mpeg12_decoder.c vl_decoder.c

View File

@ -1,12 +0,0 @@
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);
}

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
%define platform_drivers ,i965
%define with_vmware 1
%define with_xa 1
%define with_iris 1
%endif
%ifarch %{ix86} x86_64
@ -40,8 +41,8 @@
Name: mesa
Summary: Mesa graphics libraries
Version: 19.3.4
Release: 2%{?rctag:.%{rctag}}%{?dist}
Version: 20.1.4
Release: 1%{?rctag:.%{rctag}}%{?dist}
License: MIT
URL: http://www.mesa3d.org
@ -55,11 +56,9 @@ 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
# 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
# Add support for TU11x nvidia
Patch10: 0001-nir-use-bitfield_insert-instead-of-bfi-in-nir_lower_.patch
Patch11: nouveau-tu1xx-support.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -328,7 +327,7 @@ export ASFLAGS="--generate-missing-build-notes=yes"
-Ddri3=true \
-Ddri-drivers=%{?dri_drivers} \
%if 0%{?with_hardware}
-Dgallium-drivers=swrast,virgl,nouveau%{?with_vmware:,svga},radeonsi,r600%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_kmsro:,kmsro} \
-Dgallium-drivers=swrast%{?with_iris:,iris},virgl,nouveau%{?with_vmware:,svga},radeonsi,r600%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_kmsro:,kmsro} \
%else
-Dgallium-drivers=swrast,virgl \
%endif
@ -355,6 +354,7 @@ export ASFLAGS="--generate-missing-build-notes=yes"
-Dbuild-tests=false \
-Dselinux=true \
-Dosmesa=gallium \
-Dvulkan-device-select-layer=true \
%{nil}
%meson_build
@ -489,6 +489,7 @@ done
%{_libdir}/dri/radeonsi_dri.so
%ifarch %{ix86} x86_64
%{_libdir}/dri/i965_dri.so
%{_libdir}/dri/iris_dri.so
%endif
%if 0%{?with_vc4}
%{_libdir}/dri/vc4_dri.so
@ -537,12 +538,38 @@ done
%{_datadir}/vulkan/icd.d/intel_icd.i686.json
%{_datadir}/vulkan/icd.d/radeon_icd.i686.json
%endif
%{_libdir}/libVkLayer_MESA_device_select.so
%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
%files vulkan-devel
%{_includedir}/vulkan/
%endif
%changelog
* Wed Aug 05 2020 Dave Airlie <airlied@redhat.com> - 20.1.4-1
- Update to 20.1.4
- Update nouveau tu1xx support patch (Karol)
* Mon Jun 29 2020 Dave Airlie <airlied@redhat.com> - 20.1.2-3
- a fix on top of the big-endian fix (#1847064)
* Mon Jun 29 2020 Dave Airlie <airlied@redhat.com> - 20.1.2-2
- add another fix for big-endian llvmpipe (#1847064)
* Mon Jun 29 2020 Dave Airlie <airlied@redhat.com> - 20.1.2-1
- Update to 20.1.2
- add fix for big-endian llvmpipe (#1847064)
* Thu Jun 11 2020 Dave Airlie <airlied@redhat.com> - 20.1.1-1
- Update to 20.1.1
- Add support for turing
* Thu May 28 2020 Dave Airlie <airlied@redhat.com> - 20.1.0-1
- Update to 20.1.0 final
* Mon May 25 2020 Dave Airlie <airlied@redhat.com> - 20.1.0-0.1.rc4
- Update to 20.1.0-rc4
* Thu Feb 20 2020 Dave Airlie <airlied@redhat.com> - 19.3.4-2
- Fix put image shm fallback path.