summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorReza Jahanbakhshi2021-12-08 16:11:45 +0100
committerReza Jahanbakhshi2021-12-08 16:11:45 +0100
commit647f4acdb590673f79e640057f8e2bc2ab29c503 (patch)
treeabb05b9647dca49b5f76434bfb4c4424af6789aa
parent5e16b5c8460d17fe5310f2c2eb904d479aa4f553 (diff)
downloadaur-647f4acdb590673f79e640057f8e2bc2ab29c503.tar.gz
Replace the temporary patch for GLX drawable type is not supported issue and applied the patch from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14120
Patch application is automatic now based on the sources variable. Combined hash of patch files are added to the version string.
-rw-r--r--.SRCINFO8
-rw-r--r--0001-glx-fix-regression-for-drawable-type-detection.patch54
-rw-r--r--PKGBUILD31
-rw-r--r--fix-pbuffer.patch26
4 files changed, 83 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index afc971b05808..95c49c488267 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = mesa-git
pkgdesc = an open-source implementation of the OpenGL specification, git version
- pkgver = 22.0.0_devel.147797.92d84f189c7
+ pkgver = 22.0.0_devel.147865.cdc480585c9.72594e4e5a9fbb575c2fce1a871bb4c9
pkgrel = 1
url = https://www.mesa3d.org
arch = x86_64
@@ -62,12 +62,12 @@ pkgbase = mesa-git
conflicts = mesa-libgl
source = mesa::git+https://gitlab.freedesktop.org/mesa/mesa.git#branch=main
source = LICENSE
- source = fix-pbuffer.patch
+ source = 0001-glx-fix-regression-for-drawable-type-detection.patch
md5sums = SKIP
md5sums = 5c65a0fe315dd347e09b1f2826a1df5a
- md5sums = 4ced312d276450afb43d5296458b5e0e
+ md5sums = a3e0a0d14546591186b2f40dc9fb29a3
sha512sums = SKIP
sha512sums = 25da77914dded10c1f432ebcbf29941124138824ceecaf1367b3deedafaecabc082d463abcfa3d15abff59f177491472b505bcb5ba0c4a51bb6b93b4721a23c2
- sha512sums = 921e6ef4a883e51604ec5a76bf7a3805633dc60178578faae9caeec840535cac91e4d6ce0d5826553340d8c76a1d369d92725ec89c346a270335b45ae6a4dade
+ sha512sums = 111679f418790e1c7d82e447b800dec2db8d092643774e9f6e5063a6d6787d368d48afd78821731414d28910ebe30fd3438f9058fab2f620ee86ea33e1930780
pkgname = mesa-git
diff --git a/0001-glx-fix-regression-for-drawable-type-detection.patch b/0001-glx-fix-regression-for-drawable-type-detection.patch
new file mode 100644
index 000000000000..0ff1c812a05d
--- /dev/null
+++ b/0001-glx-fix-regression-for-drawable-type-detection.patch
@@ -0,0 +1,54 @@
+From e3ef7eedc94fe4eb2af2f79324bfaf4e56b37961 Mon Sep 17 00:00:00 2001
+From: Qiang Yu <yuq825@gmail.com>
+Date: Wed, 8 Dec 2021 10:57:45 +0800
+Subject: [PATCH] glx: fix regression for drawable type detection
+
+Newer version of XServer supporting GLX_DRAWABLE_TYPE query also
+support query with raw X11 window ID besides GLXWindow ID. So we
+should not limit the suppported type to GLXPbuffer when query
+success.
+
+Otherwise can't start GLX application on newer XServer with:
+
+ libGL error: GLX drawable type is not supported
+ libGL error: GLX drawable type is not supported
+ X Error of failed request: GLXBadContext
+ Major opcode of failed request: 149 (GLX)
+ Minor opcode of failed request: 5 (X_GLXMakeCurrent)
+ Serial number of failed request: 35
+ Current serial number in output stream: 35
+
+Fixes: 6625c960c58 ("glx: check drawable type before create drawble")
+
+Signed-off-by: Qiang Yu <yuq825@gmail.com>
+---
+ src/glx/dri_common.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
+index 0be684dda95..27e78fb3799 100644
+--- a/src/glx/dri_common.c
++++ b/src/glx/dri_common.c
+@@ -392,15 +392,13 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
+
+ /* Infer the GLX drawable type. */
+ if (__glXGetDrawableAttribute(dpy, glxDrawable, GLX_DRAWABLE_TYPE, &type)) {
+- if (type != GLX_PBUFFER_BIT) {
+- ErrorMessageF("GLX drawable type is not supported\n");
++ /* Xserver may support query with raw X11 window. */
++ if (type == GLX_PIXMAP_BIT) {
++ ErrorMessageF("GLXPixmap drawable type is not supported\n");
+ return NULL;
+ }
+ } else {
+- /* Xserver may not implement GLX_DRAWABLE_TYPE query yet, or glxDrawable
+- * is a X window. Assume it's a GLXPbuffer in former case, because we don't
+- * know GLXPixmap and GLXWindow's X drawable ID anyway.
+- */
++ /* Xserver may not implement GLX_DRAWABLE_TYPE query yet. */
+ type = GLX_PBUFFER_BIT | GLX_WINDOW_BIT;
+ }
+
+--
+2.34.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 8e05f1c5feb7..eece7113505b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,7 +12,7 @@
pkgname=mesa-git
pkgdesc="an open-source implementation of the OpenGL specification, git version"
-pkgver=22.0.0_devel.147797.92d84f189c7
+pkgver=22.0.0_devel.147865.cdc480585c9.72594e4e5a9fbb575c2fce1a871bb4c9
pkgrel=1
arch=('x86_64')
makedepends=('git' 'python-mako' 'xorgproto'
@@ -27,13 +27,13 @@ url="https://www.mesa3d.org"
license=('custom')
source=('mesa::git+https://gitlab.freedesktop.org/mesa/mesa.git#branch=main'
'LICENSE'
- 'fix-pbuffer.patch')
+ '0001-glx-fix-regression-for-drawable-type-detection.patch')
md5sums=('SKIP'
'5c65a0fe315dd347e09b1f2826a1df5a'
- '4ced312d276450afb43d5296458b5e0e')
+ 'a3e0a0d14546591186b2f40dc9fb29a3')
sha512sums=('SKIP'
'25da77914dded10c1f432ebcbf29941124138824ceecaf1367b3deedafaecabc082d463abcfa3d15abff59f177491472b505bcb5ba0c4a51bb6b93b4721a23c2'
- '921e6ef4a883e51604ec5a76bf7a3805633dc60178578faae9caeec840535cac91e4d6ce0d5826553340d8c76a1d369d92725ec89c346a270335b45ae6a4dade')
+ '111679f418790e1c7d82e447b800dec2db8d092643774e9f6e5063a6d6787d368d48afd78821731414d28910ebe30fd3438f9058fab2f620ee86ea33e1930780')
# NINJAFLAGS is an env var used to pass commandline options to ninja
# NOTE: It's your responbility to validate the value of $NINJAFLAGS. If unsure, don't set it.
@@ -83,8 +83,20 @@ esac
pkgver() {
cd mesa
+ local _ver
read -r _ver <VERSION
- echo ${_ver/-/_}.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)
+
+ local _patchver
+ local _patchfile
+ for _patchfile in "${source[@]}"; do
+ _patchfile="${_patchfile%%::*}"
+ _patchfile="${_patchfile##*/}"
+ [[ $_patchfile = *.patch ]] || continue
+ _patchver="${_patchver}$(md5sum ${srcdir}/${_patchfile} | cut -c1-32)"
+ done
+ _patchver="$(echo -n $_patchver | md5sum | cut -c1-32)"
+
+ echo ${_ver/-/_}.$(git rev-list --count HEAD).$(git rev-parse --short HEAD).${_patchver}
}
prepare() {
@@ -94,7 +106,14 @@ prepare() {
rm -rf _build
fi
- patch --directory=mesa --forward --strip=1 --input="${srcdir}/fix-pbuffer.patch"
+ local _patchfile
+ for _patchfile in "${source[@]}"; do
+ _patchfile="${_patchfile%%::*}"
+ _patchfile="${_patchfile##*/}"
+ [[ $_patchfile = *.patch ]] || continue
+ echo "Applying patch $_patchfile..."
+ patch --directory=mesa --forward --strip=1 --input="${srcdir}/${_patchfile}"
+ done
}
build () {
diff --git a/fix-pbuffer.patch b/fix-pbuffer.patch
deleted file mode 100644
index a6be2d1d102d..000000000000
--- a/fix-pbuffer.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
-index 0be684dda95..a700956f292 100644
---- a/src/glx/dri_common.c
-+++ b/src/glx/dri_common.c
-@@ -390,20 +390,7 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
- * case which use the same XID for both X pixmap and GLX drawable.
- */
-
-- /* Infer the GLX drawable type. */
-- if (__glXGetDrawableAttribute(dpy, glxDrawable, GLX_DRAWABLE_TYPE, &type)) {
-- if (type != GLX_PBUFFER_BIT) {
-- ErrorMessageF("GLX drawable type is not supported\n");
-- return NULL;
-- }
-- } else {
-- /* Xserver may not implement GLX_DRAWABLE_TYPE query yet, or glxDrawable
-- * is a X window. Assume it's a GLXPbuffer in former case, because we don't
-- * know GLXPixmap and GLXWindow's X drawable ID anyway.
-- */
-- type = GLX_PBUFFER_BIT | GLX_WINDOW_BIT;
-- }
--
-+ type = GLX_PBUFFER_BIT | GLX_WINDOW_BIT;
- pdraw = psc->driScreen->createDrawable(psc, glxDrawable, glxDrawable,
- type, config);
-