SHA256
1
0
forked from pool/Mesa

Accepting request 652135 from home:michalsrb:bug1117365:X11:XOrg

- Place khrplatform.h into new package Mesa-KHR-devel. It is now
  required by all devel packages that need it. (bsc#1117365)

- Remove n_drisw-Do-not-use-drisw_put_image_shm.patch,
  add u_constify-struct-drisw_loader_funcs.patch
  and u_drisw-use-separate-drisw_loader_funcs-for-shm.patch.
  * Replace workaround with proper fix for crash in VLC and
    possibly other applications. (boo#1113533)

OBS-URL: https://build.opensuse.org/request/show/652135
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=786
This commit is contained in:
Michal Srb 2018-11-27 10:16:12 +00:00 committed by Git OBS Bridge
parent e8312376c0
commit b3ed051f81
8 changed files with 231 additions and 52 deletions

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Nov 27 08:42:43 UTC 2018 - msrb@suse.com
- Place khrplatform.h into new package Mesa-KHR-devel. It is now
required by all devel packages that need it. (bsc#1117365)
-------------------------------------------------------------------
Mon Nov 26 15:06:58 UTC 2018 - msrb@suse.com
- Remove n_drisw-Do-not-use-drisw_put_image_shm.patch,
add u_constify-struct-drisw_loader_funcs.patch
and u_drisw-use-separate-drisw_loader_funcs-for-shm.patch.
* Replace workaround with proper fix for crash in VLC and
possibly other applications. (boo#1113533)
-------------------------------------------------------------------
Fri Nov 23 17:21:06 UTC 2018 - Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@ -136,7 +136,8 @@ Patch18: n_VDPAU-XVMC-libs-Replace-hardlinks-with-copies.patch
Patch31: archlinux_0001-Fix-linkage-against-shared-glapi.patch
Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch
Patch55: n_drisw-Do-not-use-drisw_put_image_shm.patch
Patch55: u_constify-struct-drisw_loader_funcs.patch
Patch56: u_drisw-use-separate-drisw_loader_funcs-for-shm.patch
BuildRequires: autoconf >= 2.60
BuildRequires: automake
@ -327,6 +328,13 @@ OpenGL|ES and OpenVG.
This package provides the development environment for compiling
programs against the EGL library.
%package KHR-devel
Summary: Mesa Khronos development headers
Group: Development/Libraries/C and C++
%description KHR-devel
Mesa Khronos development headers.
%package libGL1
Summary: The GL/GLX runtime of the Mesa 3D graphics library
Group: System/Libraries
@ -348,6 +356,7 @@ the X Window System.
%package libGL-devel
Summary: GL/GLX development files of the OpenGL API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: Mesa-libGL1 = %{version}
%if 0%{?libglvnd}
Requires: libglvnd-devel >= 0.1.0
@ -379,6 +388,7 @@ OpenGL|ES 1.x provides an API for fixed-function hardware.
%package libGLESv1_CM-devel
Summary: Development files for the OpenGL ES 1.x API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: Mesa-libGLESv1_CM1 = %{version}
Requires: pkgconfig(egl)
%if 0%{?libglvnd}
@ -418,6 +428,7 @@ ES 3 entry points.
%package libGLESv2-devel
Summary: Development files for the OpenGL ES 2.x API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: Mesa-libGLESv2-2 = %{version}
Requires: pkgconfig(egl)
%if 0%{?libglvnd}
@ -439,6 +450,7 @@ applications using the OpenGL|ES 2.x APIs.
%package libGLESv3-devel
Summary: Development files for the OpenGL ES 3.x API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: pkgconfig(egl)
%if 0%{?libglvnd} == 0
Requires: Mesa-libGLESv2-2 = %{version}
@ -724,6 +736,7 @@ rm -rf docs/README.{VMS,WIN32,OS2}
%patch54 -p1
%patch55 -p1
%patch56 -p1
# Remove requires to libglvnd/libglvnd-devel from baselibs.conf when
# disabling libglvnd build; ugly ...
@ -851,7 +864,7 @@ rm %{buildroot}/%{_includedir}/gbm.h
rm %{buildroot}/%{_libdir}/libgbm.so*
rm %{buildroot}/%{_libdir}/pkgconfig/gbm.pc
# in libGL-devel
# in KHR-devel
rm -rf %{buildroot}/%{_includedir}/KHR
%else
@ -946,6 +959,10 @@ echo "The \"Mesa\" package does not have the ability to render, but is supplemen
%endif
%{_libdir}/pkgconfig/egl.pc
%files KHR-devel
%dir %{_includedir}/KHR
%{_includedir}/KHR
%files libGL1
%if 0%{?libglvnd}
%{_libdir}/libGLX_mesa.so*
@ -956,7 +973,6 @@ echo "The \"Mesa\" package does not have the ability to render, but is supplemen
%files libGL-devel
%dir %{_includedir}/GL
%{_includedir}/KHR
%{_includedir}/GL/*.h
%exclude %{_includedir}/GL/osmesa.h
%if 0%{?libglvnd} == 0

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Nov 27 08:42:43 UTC 2018 - msrb@suse.com
- Place khrplatform.h into new package Mesa-KHR-devel. It is now
required by all devel packages that need it. (bsc#1117365)
-------------------------------------------------------------------
Mon Nov 26 15:06:58 UTC 2018 - msrb@suse.com
- Remove n_drisw-Do-not-use-drisw_put_image_shm.patch,
add u_constify-struct-drisw_loader_funcs.patch
and u_drisw-use-separate-drisw_loader_funcs-for-shm.patch.
* Replace workaround with proper fix for crash in VLC and
possibly other applications. (boo#1113533)
-------------------------------------------------------------------
Fri Nov 23 17:21:06 UTC 2018 - Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@ -135,7 +135,8 @@ Patch18: n_VDPAU-XVMC-libs-Replace-hardlinks-with-copies.patch
Patch31: archlinux_0001-Fix-linkage-against-shared-glapi.patch
Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch
Patch55: n_drisw-Do-not-use-drisw_put_image_shm.patch
Patch55: u_constify-struct-drisw_loader_funcs.patch
Patch56: u_drisw-use-separate-drisw_loader_funcs-for-shm.patch
BuildRequires: autoconf >= 2.60
BuildRequires: automake
@ -326,6 +327,13 @@ OpenGL|ES and OpenVG.
This package provides the development environment for compiling
programs against the EGL library.
%package KHR-devel
Summary: Mesa Khronos development headers
Group: Development/Libraries/C and C++
%description KHR-devel
Mesa Khronos development headers.
%package libGL1
Summary: The GL/GLX runtime of the Mesa 3D graphics library
Group: System/Libraries
@ -347,6 +355,7 @@ the X Window System.
%package libGL-devel
Summary: GL/GLX development files of the OpenGL API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: Mesa-libGL1 = %{version}
%if 0%{?libglvnd}
Requires: libglvnd-devel >= 0.1.0
@ -378,6 +387,7 @@ OpenGL|ES 1.x provides an API for fixed-function hardware.
%package libGLESv1_CM-devel
Summary: Development files for the OpenGL ES 1.x API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: Mesa-libGLESv1_CM1 = %{version}
Requires: pkgconfig(egl)
%if 0%{?libglvnd}
@ -417,6 +427,7 @@ ES 3 entry points.
%package libGLESv2-devel
Summary: Development files for the OpenGL ES 2.x API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: Mesa-libGLESv2-2 = %{version}
Requires: pkgconfig(egl)
%if 0%{?libglvnd}
@ -438,6 +449,7 @@ applications using the OpenGL|ES 2.x APIs.
%package libGLESv3-devel
Summary: Development files for the OpenGL ES 3.x API
Group: Development/Libraries/C and C++
Requires: Mesa-KHR-devel = %{version}
Requires: pkgconfig(egl)
%if 0%{?libglvnd} == 0
Requires: Mesa-libGLESv2-2 = %{version}
@ -723,6 +735,7 @@ rm -rf docs/README.{VMS,WIN32,OS2}
%patch54 -p1
%patch55 -p1
%patch56 -p1
# Remove requires to libglvnd/libglvnd-devel from baselibs.conf when
# disabling libglvnd build; ugly ...
@ -850,7 +863,7 @@ rm %{buildroot}/%{_includedir}/gbm.h
rm %{buildroot}/%{_libdir}/libgbm.so*
rm %{buildroot}/%{_libdir}/pkgconfig/gbm.pc
# in libGL-devel
# in KHR-devel
rm -rf %{buildroot}/%{_includedir}/KHR
%else
@ -945,6 +958,10 @@ echo "The \"Mesa\" package does not have the ability to render, but is supplemen
%endif
%{_libdir}/pkgconfig/egl.pc
%files KHR-devel
%dir %{_includedir}/KHR
%{_includedir}/KHR
%files libGL1
%if 0%{?libglvnd}
%{_libdir}/libGLX_mesa.so*
@ -955,7 +972,6 @@ echo "The \"Mesa\" package does not have the ability to render, but is supplemen
%files libGL-devel
%dir %{_includedir}/GL
%{_includedir}/KHR
%{_includedir}/GL/*.h
%exclude %{_includedir}/GL/osmesa.h
%if 0%{?libglvnd} == 0

View File

@ -39,21 +39,25 @@ Mesa-libGL1
requires "libglvnd-<targettype> >= 0.1.0"
Mesa-libGL-devel
requires "Mesa-libGL1-<targettype> = <version>"
requires "Mesa-KHR-devel<targettype> = <version>"
requires "libglvnd-devel-<targettype> >= 0.1.0"
Mesa-libGLESv1_CM1
requires "libglvnd-<targettype> >= 0.1.0"
Mesa-libGLESv1_CM-devel
requires "Mesa-libEGL-devel-<targettype> = <version>"
requires "Mesa-libGLESv1_CM1-<targettype> = <version>"
requires "Mesa-KHR-devel<targettype> = <version>"
requires "libglvnd-devel-<targettype> >= 0.1.0"
Mesa-libGLESv2-2
requires "libglvnd-<targettype> >= 0.1.0"
Mesa-libGLESv2-devel
requires "Mesa-libEGL-devel-<targettype> = <version>"
requires "Mesa-libGLESv2-2-<targettype> = <version>"
requires "Mesa-KHR-devel<targettype> = <version>"
requires "libglvnd-devel-<targettype> >= 0.1.0"
Mesa-libGLESv3-devel
requires "Mesa-libEGL-devel-<targettype> = <version>"
requires "Mesa-KHR-devel<targettype> = <version>"
libOSMesa8
obsoletes "libOSMesa9-<targettype> < <version>"
provides "libOSMesa9-<targettype> = <version>"

View File

@ -1,44 +0,0 @@
From 44e72286f76d244f6f2acf2cbf7204b6d7377be8 Mon Sep 17 00:00:00 2001
From: Michal Srb <msrb@suse.com>
Date: Tue, 13 Nov 2018 09:31:53 +0100
Subject: [PATCH] drisw: Do not use drisw_put_image_shm
The put_image_shm is temporarily disabled to workaround crashes in
applications that create two software-rendering OpenGL contexts, each
time using different version of loader. This caused crashes because the
drisw_lf variable is shared between them.
https://bugzilla.opensuse.org/show_bug.cgi?id=1113533
---
src/gallium/state_trackers/dri/drisw.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index 886f94dc02..62ced60e92 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -446,10 +446,21 @@ drisw_init_screen(__DRIscreen * sPriv)
sPriv->driverPrivate = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
+
+ /* The put_image_shm is temporarily disabled to workaround crashes in
+ * applications that create two software-rendering OpenGL contexts, each
+ * time using different version of loader. This caused crashes because the
+ * drisw_lf variable is shared between them.
+ *
+ * https://bugzilla.opensuse.org/show_bug.cgi?id=1113533
+ *
+ */
+#if 0
if (loader->base.version >= 4) {
if (loader->putImageShm)
drisw_lf.put_image_shm = drisw_put_image_shm;
}
+#endif
if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf)) {
dri_init_options(screen);
--
2.16.4

View File

@ -0,0 +1,76 @@
Git-commit: 9c3582dda880ef2a5ae6c55d2f457afbf6a5496d
Author: Michal Srb <msrb@suse.com>
Subject: Constify struct drisw_loader_funcs.
Patch-Mainline: To be upstreamed
References: boo#1113533
---
src/gallium/auxiliary/pipe-loader/pipe_loader.h | 2 +-
src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 2 +-
src/gallium/winsys/sw/dri/dri_sw_winsys.c | 4 ++--
src/gallium/winsys/sw/dri/dri_sw_winsys.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 05be94cae3..9b26414534 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -142,7 +142,7 @@ pipe_loader_release(struct pipe_loader_device **devs, int ndev);
*/
bool
pipe_loader_sw_probe_dri(struct pipe_loader_device **devs,
- struct drisw_loader_funcs *drisw_lf);
+ const struct drisw_loader_funcs *drisw_lf);
/**
* Initialize a kms backed sw device given an fd.
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index d387ce90d3..587b6f8567 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -132,7 +132,7 @@ pipe_loader_sw_probe_teardown_common(struct pipe_loader_sw_device *sdev)
#ifdef HAVE_PIPE_LOADER_DRI
bool
-pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, struct drisw_loader_funcs *drisw_lf)
+pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, const struct drisw_loader_funcs *drisw_lf)
{
struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device);
int i;
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
index d519bcfedd..cd44b036c6 100644
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
@@ -62,7 +62,7 @@ struct dri_sw_winsys
{
struct sw_winsys base;
- struct drisw_loader_funcs *lf;
+ const struct drisw_loader_funcs *lf;
};
static inline struct dri_sw_displaytarget *
@@ -282,7 +282,7 @@ dri_destroy_sw_winsys(struct sw_winsys *winsys)
}
struct sw_winsys *
-dri_create_sw_winsys(struct drisw_loader_funcs *lf)
+dri_create_sw_winsys(const struct drisw_loader_funcs *lf)
{
struct dri_sw_winsys *ws;
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.h b/src/gallium/winsys/sw/dri/dri_sw_winsys.h
index 329ac06a05..47e3777d4c 100644
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.h
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.h
@@ -33,6 +33,6 @@
struct sw_winsys;
-struct sw_winsys *dri_create_sw_winsys(struct drisw_loader_funcs *lf);
+struct sw_winsys *dri_create_sw_winsys(const struct drisw_loader_funcs *lf);
#endif
--
2.16.4

View File

@ -0,0 +1,81 @@
Git-commit: ed4e414267994331730f48cfa8d8bf6dce586969
Author: Michal Srb <msrb@suse.com>
Subject: drisw: Use separate drisw_loader_funcs for shm
Patch-Mainline: To be upstreamed
References: boo#1113533
The original code was modifying the global drisw_lf variable, which is bad
when there are multiple contexts in single process, each initialized with
different loader. One may support put_image_shm and the other not.
Since there are currently only two possible combinations, lets create two
global tables, one for each. Lets make them const, since we won't change them
and they can be shared.
This fixes crash in VLC. It used two GL contexts (each in different thread), one
was initialized by its Qt GUI, the other by its video output plugin. The first
one set the put_image_shm=drisw_put_image_shm, the second did not, but
since the same structure was used, the drisw_put_image_shm was used too. Then
it crashed because the second loader did not have putImageShm set.
Downstream bug:
https://bugzilla.opensuse.org/show_bug.cgi?id=1113533
v2: Added Fixes and described the VLC bug.
Fixes: 63c427fa71a ("drisw: use putImageShm if available")
Signed-off-by: Michal Srb <msrb@suse.com>
---
src/gallium/state_trackers/dri/drisw.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index 886f94dc02..5a0d2e1354 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -421,12 +421,19 @@ static const __DRIextension *drisw_screen_extensions[] = {
NULL
};
-static struct drisw_loader_funcs drisw_lf = {
+static const struct drisw_loader_funcs drisw_lf = {
.get_image = drisw_get_image,
.put_image = drisw_put_image,
.put_image2 = drisw_put_image2
};
+static const struct drisw_loader_funcs drisw_shm_lf = {
+ .get_image = drisw_get_image,
+ .put_image = drisw_put_image,
+ .put_image2 = drisw_put_image2,
+ .put_image_shm = drisw_put_image_shm
+};
+
static const __DRIconfig **
drisw_init_screen(__DRIscreen * sPriv)
{
@@ -434,6 +441,7 @@ drisw_init_screen(__DRIscreen * sPriv)
const __DRIconfig **configs;
struct dri_screen *screen;
struct pipe_screen *pscreen = NULL;
+ const struct drisw_loader_funcs *lf = &drisw_lf;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
@@ -448,10 +456,10 @@ drisw_init_screen(__DRIscreen * sPriv)
sPriv->extensions = drisw_screen_extensions;
if (loader->base.version >= 4) {
if (loader->putImageShm)
- drisw_lf.put_image_shm = drisw_put_image_shm;
+ lf = &drisw_shm_lf;
}
- if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf)) {
+ if (pipe_loader_sw_probe_dri(&screen->dev, lf)) {
dri_init_options(screen);
pscreen = pipe_loader_create_screen(screen->dev);
--
2.16.4