Add a fix from upstream to fix xterm crash under Xwayland (fdo#97974)

- Add a fix from upstream to fix glamor / xwayland not working with glvnd
- Add a fix from upstream to fix input devices no longer working
  after a vt-switch
This commit is contained in:
Hans de Goede 2016-10-05 15:59:16 +02:00
parent 8e5d763690
commit 8aa464b9f9
4 changed files with 192 additions and 1 deletions

View File

@ -0,0 +1,78 @@
From c622887701c70dab7b39515e4d48b2ce70822f1a Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 4 Oct 2016 13:34:33 -0400
Subject: [PATCH 1/7] glamor: Use eglGetPlatformDisplayEXT not eglGetDisplay
eglGetDisplay forces the implementation to guess which kind of display
it's been handed. glvnd does something different from Mesa, and in
general it's impossible for the library to get this right. Instead use
the API where you specify what kind of display it is.
The explicit call to eglGetProcAddress is to work around a bug in
libepoxy 1.3, which does not understand EGL client extensions and so its
resolver code will crash.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
glamor/glamor_egl.c | 9 ++++++++-
hw/xwayland/xwayland-glamor.c | 8 +++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 2b9e0e1..51d8147 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -736,6 +736,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
{
struct glamor_egl_screen_private *glamor_egl;
const char *version;
+ PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay;
EGLint config_attribs[] = {
#ifdef GLAMOR_GLES2
@@ -768,7 +769,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
ErrorF("couldn't get display device\n");
goto error;
}
- glamor_egl->display = eglGetDisplay(glamor_egl->gbm);
+
+ getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
+ eglGetProcAddress("eglGetPlatformDisplayEXT");
+
+ if (getPlatformDisplay)
+ glamor_egl->display = getPlatformDisplay (EGL_PLATFORM_GBM_MESA,
+ glamor_egl->gbm, NULL);
#else
glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd);
#endif
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 068c224..23402f9 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -280,6 +280,7 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen)
GLAMOR_GL_CORE_VER_MINOR,
EGL_NONE
};
+ PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay;
if (xwl_screen->egl_display)
return;
@@ -292,7 +293,12 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen)
return;
}
- xwl_screen->egl_display = eglGetDisplay(xwl_screen->gbm);
+ getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
+ eglGetProcAddress("eglGetPlatformDisplayEXT");
+
+ if (getPlatformDisplay)
+ xwl_screen->egl_display = getPlatformDisplay(EGL_PLATFORM_GBM_MESA,
+ xwl_screen->gbm, NULL);
if (xwl_screen->egl_display == EGL_NO_DISPLAY) {
ErrorF("eglGetDisplay() failed\n");
return;
--
2.9.3

View File

@ -0,0 +1,63 @@
From 18ed71c29863580e960293ff67465aaed69be9bb Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Wed, 5 Oct 2016 08:36:21 +0200
Subject: [PATCH 2/7] glamor: Fix pixmap offset for bitplane in
glamor_copy_fbo_cpu
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit cba28d5 - "glamor: Handle bitplane in glamor_copy_fbo_cpu"
introduced a regression as the computed pixmap offset would not match
the actual coordinates and write data elsewhere in memory causing a
segfault in fbBltOne().
Translate the pixmap coordinates so that the data is read and written at
the correct location.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97974
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
glamor/glamor_copy.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index 8a329d2..3ca56fb 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -230,20 +230,22 @@ glamor_copy_cpu_fbo(DrawablePtr src,
goto bail;
}
+ src_pix->drawable.x = -dst->x;
+ src_pix->drawable.y = -dst->y;
+
fbGetDrawable(&src_pix->drawable, src_bits, src_stride, src_bpp, src_xoff,
src_yoff);
if (src->bitsPerPixel > 1)
- fbCopyNto1(src, &src_pix->drawable, gc, box, nbox,
- dst_xoff + dx, dst_yoff + dy, reverse, upsidedown,
- bitplane, closure);
+ fbCopyNto1(src, &src_pix->drawable, gc, box, nbox, dx, dy,
+ reverse, upsidedown, bitplane, closure);
else
- fbCopy1toN(src, &src_pix->drawable, gc, box, nbox,
- dst_xoff + dx, dst_yoff + dy, reverse, upsidedown,
- bitplane, closure);
+ fbCopy1toN(src, &src_pix->drawable, gc, box, nbox, dx, dy,
+ reverse, upsidedown, bitplane, closure);
- glamor_upload_boxes(dst_pixmap, box, nbox, 0, 0, 0, 0,
- (uint8_t *) src_bits, src_stride * sizeof(FbBits));
+ glamor_upload_boxes(dst_pixmap, box, nbox, src_xoff, src_yoff,
+ dst_xoff, dst_yoff, (uint8_t *) src_bits,
+ src_stride * sizeof(FbBits));
fbDestroyPixmap(src_pix);
} else {
fbGetDrawable(src, src_bits, src_stride, src_bpp, src_xoff, src_yoff);
--
2.9.3

View File

@ -0,0 +1,39 @@
From 909cc5e8d1a51184259803ca66a1fc352c547e02 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 5 Oct 2016 14:40:00 +0200
Subject: [PATCH 3/7] inputthread: Fix inputthread not listening if a fd gets
re-added immediately after removal
When a fd is removed dev->state gets set to device_state_removed,
if the fd then gets re-added before InputThreadDoWork() deals with
the removal, the InputThreadDevice struct gets reused, but its
state would stay device_state_removed, so it would still get removed
on the first InputThreadDoWork() run, resulting in a non functioning
input device.
This commit fixes this by (re-)setting dev->state to device_state_running
when a InputThreadDevice struct gets reused.
This fixes input devices sometimes no longer working after a vt-switch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
os/inputthread.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/os/inputthread.c b/os/inputthread.c
index 6aa0a9c..ab1559f 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -206,6 +206,8 @@ InputThreadRegisterDev(int fd,
if (dev) {
dev->readInputProc = readInputProc;
dev->readInputArgs = readInputArgs;
+ /* Override possible unhandled state == device_state_removed */
+ dev->state = device_state_running;
} else {
dev = calloc(1, sizeof(InputThreadDevice));
if (dev == NULL) {
--
2.9.3

View File

@ -45,7 +45,7 @@
Summary: X.Org X11 X server
Name: xorg-x11-server
Version: 1.19.0
Release: 0.1%{?gitdate:.%{gitdate}}%{dist}
Release: 0.2%{?gitdate:.%{gitdate}}%{dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X
@ -77,6 +77,11 @@ Source31: xserver-sdk-abi-requires.git
# maintainer convenience script
Source40: driver-abi-rebuild.sh
# Various fixes pending upstream
Patch1: 0001-glamor-Use-eglGetPlatformDisplayEXT-not-eglGetDispla.patch
Patch2: 0002-glamor-Fix-pixmap-offset-for-bitplane-in-glamor_copy.patch
Patch3: 0003-inputthread-Fix-inputthread-not-listening-if-a-fd-ge.patch
#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch
Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch
@ -595,6 +600,12 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog
* Wed Oct 5 2016 Hans de Goede <hdegoede@redhat.com> - 1.19.0-0.2.20160929
- Add a fix from upstream to fix xterm crash under Xwayland (fdo#97974)
- Add a fix from upstream to fix glamor / xwayland not working with glvnd
- Add a fix from upstream to fix input devices no longer working
after a vt-switch
* Thu Sep 29 2016 Hans de Goede <hdegoede@redhat.com> - 1.19.0-0.1.20160929
- Rebase to current git master (1.19-rc1+)
- Drop Obsoletes for the driver packages removed from F21 (its been 2