summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--repo/android-tools/android-tools.xibuild22
-rw-r--r--repo/at-spi2-atk/at-spi2-atk.xibuild16
-rw-r--r--repo/at-spi2-core/at-spi2-core.xibuild2
-rw-r--r--repo/cabal/cabal.project.freeze68
-rw-r--r--repo/cabal/cabal.xibuild60
-rw-r--r--repo/cairo/cairo.xibuild3
-rw-r--r--repo/elogind/elogind.xibuild2
-rw-r--r--repo/encodings/encodings.xibuild6
-rw-r--r--repo/font-adobe-utopia-type1/font-adobe-utopia-type1.xibuild6
-rw-r--r--repo/font-alias/font-alias.xibuild6
-rw-r--r--repo/font-bh-ttf/font-bh-ttf.xibuild6
-rw-r--r--repo/font-bh-type1/font-bh-type1.xibuild6
-rw-r--r--repo/font-ibm-type1/font-ibm-type1.xibuild6
-rw-r--r--repo/font-misc-ethiopic/font-misc-ethiopic.xibuild6
-rw-r--r--repo/font-util/font-util.xibuild2
-rw-r--r--repo/font-xfree86-type1/font-xfree86-type1.xibuild6
-rw-r--r--repo/gdk-pixbuf/gdk-pixbuf.xibuild3
-rw-r--r--repo/glib/glib.trigger16
-rw-r--r--repo/glib/glib.xibuild44
-rw-r--r--repo/glib/gparamspec.patch33
-rw-r--r--repo/grub/grub.xibuild2
-rw-r--r--repo/gtk2/gtk2.xibuild10
-rw-r--r--repo/gtk3/gtk3.xibuild31
-rw-r--r--repo/iceauth/iceauth.xibuild2
-rw-r--r--repo/intel-vaapi-driver/intel-vaapi-driver.xibuild2
-rw-r--r--repo/intltool/intltool.xibuild3
-rw-r--r--repo/libdmx/libdmx.xibuild2
-rw-r--r--repo/libdrm/libdrm.xibuild4
-rw-r--r--repo/libepoxy/libepoxy.xibuild2
-rw-r--r--repo/libevdev/libevdev.xibuild2
-rw-r--r--repo/libfontenc/libfontenc.xibuild2
-rw-r--r--repo/libfs/libfs.xibuild2
-rw-r--r--repo/libice/libice.xibuild2
-rw-r--r--repo/libinput/libinput.xibuild2
-rw-r--r--repo/libpciaccess/libpciaccess.xibuild2
-rw-r--r--repo/libpthread-stubs/libpthread-stubs.xibuild24
-rw-r--r--repo/libsm/libsm.xibuild2
-rw-r--r--repo/libvdpau-va-gl/libvdpau-va-gl.xibuild2
-rw-r--r--repo/libvdpau/libvdpau.xibuild2
-rw-r--r--repo/libx11/libx11.xibuild4
-rw-r--r--repo/libxau/libxau.xibuild2
-rw-r--r--repo/libxaw/libxaw.xibuild2
-rw-r--r--repo/libxcb/libxcb.xibuild30
-rw-r--r--repo/libxcomposite/libxcomposite.xibuild2
-rw-r--r--repo/libxcursor/libxcursor.xibuild2
-rw-r--r--repo/libxdamage/libxdamage.xibuild5
-rw-r--r--repo/libxdmcp/libxdmcp.xibuild4
-rw-r--r--repo/libxext/libxext.xibuild2
-rw-r--r--repo/libxfixes/libxfixes.xibuild2
-rw-r--r--repo/libxfont2/libxfont2.xibuild2
-rw-r--r--repo/libxft/libxft.xibuild4
-rw-r--r--repo/libxi/libxi.xibuild2
-rw-r--r--repo/libxinerama/libxinerama.xibuild2
-rw-r--r--repo/libxkbfile/libxkbfile.xibuild2
-rw-r--r--repo/libxmu/libxmu.xibuild2
-rw-r--r--repo/libxpm/libxpm.xibuild2
-rw-r--r--repo/libxrandr/libxrandr.xibuild2
-rw-r--r--repo/libxrender/libxrender.xibuild4
-rw-r--r--repo/libxres/libxres.xibuild2
-rw-r--r--repo/libxscrnsaver/libxscrnsaver.xibuild2
-rw-r--r--repo/libxshmfence/libxshmfence.xibuild2
-rw-r--r--repo/libxt/libxt.xibuild2
-rw-r--r--repo/libxtst/libxtst.xibuild2
-rw-r--r--repo/libxv/libxv.xibuild2
-rw-r--r--repo/libxvmc/libxvmc.xibuild2
-rw-r--r--repo/libxxf86dga/libxxf86dga.xibuild2
-rw-r--r--repo/libxxf86vm/libxxf86vm.xibuild2
-rw-r--r--repo/luit/luit.xibuild2
-rw-r--r--repo/mesa/0001-freedreno-Enable-A619.patch37
-rw-r--r--repo/mesa/add-use-elf-tls.patch29
-rw-r--r--repo/mesa/mesa-21.3.7-add_xdemos-1.patch3197
-rw-r--r--repo/mesa/mesa-21.3.7-nouveau_fixes-1.patch2878
-rw-r--r--repo/mesa/mesa.xibuild13
-rw-r--r--repo/mesa/musl-fix-includes.patch13
-rw-r--r--repo/meson/fix-ninja-output-test.patch12
-rw-r--r--repo/meson/meson.xibuild25
-rw-r--r--repo/meson/skip-broken-tests.patch36
-rw-r--r--repo/mkfontscale/mkfontscale.xibuild2
-rw-r--r--repo/p7zip/p7zip.xibuild42
-rw-r--r--repo/pandoc/cabal.config223
-rw-r--r--repo/pandoc/pandoc.xibuild65
-rw-r--r--repo/pango/disable-broken-test.patch24
-rw-r--r--repo/pango/pango.pre-deinstall3
-rw-r--r--repo/pango/pango.trigger4
-rw-r--r--repo/pango/pango.xibuild32
-rw-r--r--repo/poppler/poppler-glib.xibuild2
-rw-r--r--repo/python-docutils/python-docutils.xibuild5
-rw-r--r--repo/python-setuptools/python-setuptools.xibuild49
-rw-r--r--repo/sessreg/sessreg.xibuild2
-rw-r--r--repo/setxkbmap/setxkbmap.xibuild2
-rw-r--r--repo/smproxy/smproxy.xibuild2
-rw-r--r--repo/ubase/ubase.xibuild4
-rw-r--r--repo/unrar/makefile.patch (renamed from skip/unrar/makefile.patch)22
-rw-r--r--repo/unrar/unrar.xibuild (renamed from skip/unrar/unrar.xibuild)0
-rw-r--r--repo/x11perf/x11perf.xibuild2
-rw-r--r--repo/xauth/xauth.xibuild2
-rw-r--r--repo/xbacklight/xbacklight.xibuild2
-rw-r--r--repo/xbitmaps/xbitmaps.xibuild2
-rw-r--r--repo/xcb-proto/xcb-proto.xibuild2
-rw-r--r--repo/xcb-util-cursor/xcb-util-cursor.xibuild2
-rw-r--r--repo/xcb-util-image/xcb-util-image.xibuild2
-rw-r--r--repo/xcb-util-keysyms/xcb-util-keysyms.xibuild2
-rw-r--r--repo/xcb-util-renderutil/xcb-util-renderutil.xibuild2
-rw-r--r--repo/xcb-util-wm/xcb-util-wm.xibuild2
-rw-r--r--repo/xcb-util/xcb-util.xibuild2
-rw-r--r--repo/xclock/xclock.xibuild2
-rw-r--r--repo/xcmsdb/xcmsdb.xibuild2
-rw-r--r--repo/xcursor-themes/xcursor-themes.xibuild2
-rw-r--r--repo/xcursorgen/xcursorgen.xibuild2
-rw-r--r--repo/xdpyinfo/xdpyinfo.xibuild2
-rw-r--r--repo/xdriinfo/xdriinfo.xibuild2
-rw-r--r--repo/xev/xev.xibuild2
-rw-r--r--repo/xeyes/xeyes.xibuild2
-rw-r--r--repo/xf86-input-evdev/xf86-input-evdev.xibuild2
-rw-r--r--repo/xf86-input-libinput/xf86-input-libinput.xibuild2
-rw-r--r--repo/xf86-input-synaptics/xf86-input-synaptics.xibuild2
-rw-r--r--repo/xf86-input-wacom/xf86-input-wacom.xibuild2
-rw-r--r--repo/xf86-video-amdgpu/xf86-video-amdgpu.xibuild2
-rw-r--r--repo/xf86-video-ati/xf86-video-ati.xibuild2
-rw-r--r--repo/xf86-video-fbdev/xf86-video-fbdev.xibuild2
-rw-r--r--repo/xf86-video-nouveau/xf86-video-nouveau.xibuild2
-rw-r--r--repo/xf86-video-qxl/xf86-video-qxl.xibuild2
-rw-r--r--repo/xf86-video-vmware/xf86-video-vmware.xibuild2
-rw-r--r--repo/xgamma/xgamma.xibuild2
-rw-r--r--repo/xhost/xhost.xibuild2
-rw-r--r--repo/xinput/xinput.xibuild2
-rw-r--r--repo/xkbcomp/xkbcomp.xibuild2
-rw-r--r--repo/xkbevd/xkbevd.xibuild2
-rw-r--r--repo/xkbutils/xkbutils.xibuild2
-rw-r--r--repo/xkeyboardconfig/xkeyboardconfig.xibuild2
-rw-r--r--repo/xkill/xkill.xibuild2
-rw-r--r--repo/xlsatoms/xlsatoms.xibuild2
-rw-r--r--repo/xlsclients/xlsclients.xibuild2
-rw-r--r--repo/xmessage/xmessage.xibuild2
-rw-r--r--repo/xmodmap/xmodmap.xibuild2
-rw-r--r--repo/xorg-server/xorg-server.xibuild2
-rw-r--r--repo/xorg-xinit/xorg-xinit.xibuild2
-rw-r--r--repo/xorgproto/xorgproto.xibuild8
-rw-r--r--repo/xpr/xpr.xibuild2
-rw-r--r--repo/xprop/xprop.xibuild2
-rw-r--r--repo/xrandr/xrandr.xibuild4
-rw-r--r--repo/xrdb/xrdb.xibuild2
-rw-r--r--repo/xrefresh/xrefresh.xibuild2
-rw-r--r--repo/xset/xset.xibuild2
-rw-r--r--repo/xsetroot/xsetroot.xibuild2
-rw-r--r--repo/xterm/xterm.xibuild2
-rw-r--r--repo/xtrans/xtrans.xibuild2
-rw-r--r--repo/xvinfo/xvinfo.xibuild2
-rw-r--r--repo/xwd/xwd.xibuild2
-rw-r--r--repo/xwininfo/xwininfo.xibuild2
-rw-r--r--repo/xwud/xwud.xibuild2
-rw-r--r--repo/zynaddsubfx/.zynaddsubfx.xibuild.swpbin0 -> 12288 bytes
-rw-r--r--repo/zynaddsubfx/zynaddsubfx.xibuild23
-rw-r--r--skip/xf86-video-vga.xibuild2
154 files changed, 980 insertions, 6406 deletions
diff --git a/repo/android-tools/android-tools.xibuild b/repo/android-tools/android-tools.xibuild
new file mode 100644
index 0000000..4ad7009
--- /dev/null
+++ b/repo/android-tools/android-tools.xibuild
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+NAME="android-tools"
+DESC="Android platform tools"
+
+MAKEDEPS="pcre2 linux-headers libusb gtest go perl cmake protobuf brotli zstd lz4 ninja"
+
+PKG_VER=31.0.3p2
+SOURCE="https://github.com/nmeum/android-tools/releases/download/$PKG_VER/android-tools-$PKG_VER.tar.xz"
+
+build() {
+ cmake -B build -G Ninja \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DCMAKE_BUILD_TYPE=None
+ cmake --build build
+}
+
+package() {
+ DESTDIR="$PKG_DEST" cmake --install build
+}
+
diff --git a/repo/at-spi2-atk/at-spi2-atk.xibuild b/repo/at-spi2-atk/at-spi2-atk.xibuild
index 9cdecd9..c3c1539 100644
--- a/repo/at-spi2-atk/at-spi2-atk.xibuild
+++ b/repo/at-spi2-atk/at-spi2-atk.xibuild
@@ -3,20 +3,4 @@
NAME="at-spi2-atk"
DESC="A GTK+ module that bridges ATK to D-Bus at-spi"
-MAKEDEPS="meson ninja "
DEPS="at-spi2-core atk dbus glib "
-
-PKG_VER=2.38.0
-SOURCE="https://download.gnome.org/sources/at-spi2-atk/${PKG_VER%.*}/at-spi2-atk-$PKG_VER.tar.xz"
-
-build () {
- mkdir build &&
- cd build &&
- meson --prefix=/usr \
- .. &&
- ninja
-}
-
-package () {
- DESTDIR=$PKG_DEST ninja install
-}
diff --git a/repo/at-spi2-core/at-spi2-core.xibuild b/repo/at-spi2-core/at-spi2-core.xibuild
index 0f7917c..830a333 100644
--- a/repo/at-spi2-core/at-spi2-core.xibuild
+++ b/repo/at-spi2-core/at-spi2-core.xibuild
@@ -6,7 +6,7 @@ DESC="Protocol definitions and daemon for D-Bus at-spi"
MAKEDEPS="meson ninja "
DEPS="dbus glib intltool libx11 libxi libxtst musl "
-PKG_VER=2.44.1
+PKG_VER=2.46.0
SOURCE="https://download.gnome.org/sources/at-spi2-core/${PKG_VER%.*}/at-spi2-core-$PKG_VER.tar.xz"
build () {
diff --git a/repo/cabal/cabal.project.freeze b/repo/cabal/cabal.project.freeze
new file mode 100644
index 0000000..f4c0bd7
--- /dev/null
+++ b/repo/cabal/cabal.project.freeze
@@ -0,0 +1,68 @@
+active-repositories: hackage.haskell.org:merge
+constraints: any.Cabal ==3.8.1.0,
+ any.Cabal-syntax ==3.8.1.0,
+ any.HTTP ==4000.4.1,
+ HTTP -conduit10 +network-uri -warn-as-error -warp-tests,
+ any.array ==0.5.4.0,
+ any.async ==2.2.4,
+ async -bench,
+ any.base ==4.15.1.0,
+ any.base-orphans ==0.8.7,
+ any.base16-bytestring ==1.0.2.0,
+ any.base64-bytestring ==1.2.1.0,
+ any.binary ==0.8.8.0,
+ any.bytestring ==0.10.12.1,
+ cabal-install +lukko +native-dns,
+ any.cabal-install-solver ==3.8.1.0,
+ cabal-install-solver -debug-conflict-sets -debug-expensive-assertions -debug-tracetree,
+ any.containers ==0.6.4.1,
+ any.cryptohash-sha256 ==0.11.102.1,
+ cryptohash-sha256 -exe +use-cbits,
+ any.deepseq ==1.4.5.0,
+ any.directory ==1.3.6.2,
+ any.echo ==0.1.4,
+ echo -example,
+ any.ed25519 ==0.0.5.0,
+ ed25519 +no-donna +test-doctests +test-hlint +test-properties,
+ any.edit-distance ==0.2.2.1,
+ any.exceptions ==0.10.4,
+ any.filepath ==1.4.2.1,
+ any.ghc-bignum ==1.1,
+ any.ghc-boot-th ==9.0.2,
+ any.ghc-prim ==0.7.0,
+ any.hackage-security ==0.6.2.2,
+ hackage-security +base48 -cabal-syntax +lukko -mtl21 -old-directory +use-network-uri,
+ any.hashable ==1.4.1.0,
+ hashable +containers +integer-gmp -random-initial-seed,
+ any.hsc2hs ==0.68.8,
+ hsc2hs -in-ghc-tree,
+ any.lukko ==0.1.1.3,
+ lukko +ofd-locking,
+ any.mtl ==2.2.2,
+ any.network ==3.1.2.7,
+ network -devel,
+ any.network-uri ==2.6.4.1,
+ any.parsec ==3.1.14.0,
+ any.pretty ==1.1.3.6,
+ any.process ==1.6.15.0,
+ any.random ==1.2.1.1,
+ any.regex-base ==0.94.0.2,
+ any.regex-posix ==0.96.0.1,
+ regex-posix -_regex-posix-clib,
+ any.resolv ==0.1.2.0,
+ any.rts ==1.0.2,
+ any.safe-exceptions ==0.1.7.3,
+ any.splitmix ==0.1.0.4,
+ splitmix -optimised-mixer,
+ any.stm ==2.5.0.0,
+ any.tar ==0.5.1.1,
+ tar -old-bytestring -old-time,
+ any.template-haskell ==2.17.0.0,
+ any.text ==1.2.5.0,
+ any.th-compat ==0.1.4,
+ any.time ==1.9.3,
+ any.transformers ==0.5.6.2,
+ any.unix ==2.7.2.2,
+ any.zlib ==0.6.3.0,
+ zlib -bundled-c-zlib -non-blocking-ffi -pkg-config
+index-state: hackage.haskell.org 2022-08-16T18:13:49Z
diff --git a/repo/cabal/cabal.xibuild b/repo/cabal/cabal.xibuild
new file mode 100644
index 0000000..64bcd18
--- /dev/null
+++ b/repo/cabal/cabal.xibuild
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+NAME="cabal"
+DESC="The Haskell Cabal"
+
+MAKEDEPS="ghc gmp libffi zlib cabal-bootstrap"
+
+PKG_VER=3.8.1.0
+SOURCE="https://hackage.haskell.org/package/cabal-install-$PKG_VER/cabal-install-$PKG_VER.tar.gz"
+
+ADDITIONAL="
+cabal.project.freeze
+"
+
+cabal_update() {
+ cd $BUILD_ROOT
+ # Build a freeze file to make the build reproducible.
+ # This freeze file is stored in $source and thus tracked in Git.
+ HOME="$_cabal_home" cabal v2-update --allow-newer
+ (
+ cd "$BUILD_ROOT"
+ HOME="$_cabal_home" cabal v2-freeze \
+ --allow-newer --shadow-installed-packages
+ mv cabal.project.freeze "$startdir/"
+ )
+}
+
+prepare() {
+ apply_patches
+ ln -sf "$BUILD_ROOT/cabal.project.freeze" \
+ "$BUILD_ROOT/cabal.project.freeze"
+}
+
+build() {
+ HOME="$_cabal_home" cabal v2-update
+ HOME="$_cabal_home" cabal v2-build all \
+ --allow-newer \
+ --jobs=${JOBS:-1} \
+ --prefix=/usr \
+ --docdir=/usr/share/doc/cabal \
+ --sysconfdir=/etc
+}
+
+package() {
+ # With v2- cabal no longer wants us to separate v2-build and
+ # v2-install, however, we don't want to build everything in a
+ # fakeroot. We work around this by copying binaries build in the
+ # previous step manually.
+ #
+ # See https://github.com/haskell/cabal/issues/6919#issuecomment-761563498
+ HOME="$_cabal_home" cabal list-bin --allow-newer all:exes | \
+ xargs install -Dm755 -t "$PKG_DEST"/usr/bin
+
+ mkdir -p "$PKG_DEST"/usr/share/man/man1
+ HOME="$_cabal_home" cabal man --raw \
+ > "$PKG_DEST"/usr/share/man/man1/cabal.1
+
+ install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal/LICENSE"
+}
+
diff --git a/repo/cairo/cairo.xibuild b/repo/cairo/cairo.xibuild
index 4dec347..466cf96 100644
--- a/repo/cairo/cairo.xibuild
+++ b/repo/cairo/cairo.xibuild
@@ -1,7 +1,6 @@
#!/bin/sh
-MAKEDEPS="make"
-DEPS="musl libx11 freetype2 libpng libxcb libxext libxrender pixman zlib glib"
+MAKEDEPS="make libx11 freetype2 libpng libxcb libxext libxrender pixman zlib glib poppler-glib"
PKG_VER=1.17.4
SOURCE=https://cairographics.org/snapshots/cairo-$PKG_VER.tar.xz
diff --git a/repo/elogind/elogind.xibuild b/repo/elogind/elogind.xibuild
index d974c90..c9fa661 100644
--- a/repo/elogind/elogind.xibuild
+++ b/repo/elogind/elogind.xibuild
@@ -1,6 +1,6 @@
#!/bin/sh
-MAKEDEPS="make docbook4-xml docbook-xsl docbook-dtd libxslt util-linux glib acl m4"
+MAKEDEPS="make docbook4-xml docbook-xsl docbook-dtd libxslt util-linux glib acl m4 ubase"
DEPS="pam gperf eudev"
PKG_VER=246.10
diff --git a/repo/encodings/encodings.xibuild b/repo/encodings/encodings.xibuild
index 6252d8a..e6af5e1 100644
--- a/repo/encodings/encodings.xibuild
+++ b/repo/encodings/encodings.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.5
SOURCE=https://www.x.org/pub/individual/font/encodings-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-adobe-utopia-type1/font-adobe-utopia-type1.xibuild b/repo/font-adobe-utopia-type1/font-adobe-utopia-type1.xibuild
index 7dc766d..e86c287 100644
--- a/repo/font-adobe-utopia-type1/font-adobe-utopia-type1.xibuild
+++ b/repo/font-adobe-utopia-type1/font-adobe-utopia-type1.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.4
SOURCE=https://www.x.org/pub/individual/font/font-adobe-utopia-type1-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-alias/font-alias.xibuild b/repo/font-alias/font-alias.xibuild
index 2d54f3a..342abfe 100644
--- a/repo/font-alias/font-alias.xibuild
+++ b/repo/font-alias/font-alias.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.4
SOURCE=https://www.x.org/pub/individual/font/font-alias-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-bh-ttf/font-bh-ttf.xibuild b/repo/font-bh-ttf/font-bh-ttf.xibuild
index 7d9d58c..e4fad81 100644
--- a/repo/font-bh-ttf/font-bh-ttf.xibuild
+++ b/repo/font-bh-ttf/font-bh-ttf.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.3
SOURCE=https://www.x.org/pub/individual/font/font-bh-ttf-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-bh-type1/font-bh-type1.xibuild b/repo/font-bh-type1/font-bh-type1.xibuild
index 5224ed4..e7a41e3 100644
--- a/repo/font-bh-type1/font-bh-type1.xibuild
+++ b/repo/font-bh-type1/font-bh-type1.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.3
SOURCE=https://www.x.org/pub/individual/font/font-bh-type1-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-ibm-type1/font-ibm-type1.xibuild b/repo/font-ibm-type1/font-ibm-type1.xibuild
index fbf0fdf..6a137b9 100644
--- a/repo/font-ibm-type1/font-ibm-type1.xibuild
+++ b/repo/font-ibm-type1/font-ibm-type1.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.3
SOURCE=https://www.x.org/pub/individual/font/font-ibm-type1-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-misc-ethiopic/font-misc-ethiopic.xibuild b/repo/font-misc-ethiopic/font-misc-ethiopic.xibuild
index 872fa2c..1e9b77a 100644
--- a/repo/font-misc-ethiopic/font-misc-ethiopic.xibuild
+++ b/repo/font-misc-ethiopic/font-misc-ethiopic.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.4
SOURCE=https://www.x.org/pub/individual/font/font-misc-ethiopic-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
-ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
-ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
} \ No newline at end of file
diff --git a/repo/font-util/font-util.xibuild b/repo/font-util/font-util.xibuild
index 92b8078..64a81a1 100644
--- a/repo/font-util/font-util.xibuild
+++ b/repo/font-util/font-util.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.3.2
SOURCE=https://www.x.org/pub/individual/font/font-util-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/font-xfree86-type1/font-xfree86-type1.xibuild b/repo/font-xfree86-type1/font-xfree86-type1.xibuild
index aba89b8..9dd50e2 100644
--- a/repo/font-xfree86-type1/font-xfree86-type1.xibuild
+++ b/repo/font-xfree86-type1/font-xfree86-type1.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.4
SOURCE=https://www.x.org/pub/individual/font/font-xfree86-type1-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
@@ -15,6 +15,6 @@ package () {
make DESTDIR=$PKG_DEST install
install -d -m755 $PKG_DEST/usr/share/fonts &&
- ln -sf $XORG_PREFIX/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
- ln -sf $XORG_PREFIX/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
+ ln -sf /usr/share/fonts/X11/OTF $PKG_DEST/usr/share/fonts/X11-OTF &&
+ ln -sf /usr/share/fonts/X11/TTF $PKG_DEST/usr/share/fonts/X11-TTF
}
diff --git a/repo/gdk-pixbuf/gdk-pixbuf.xibuild b/repo/gdk-pixbuf/gdk-pixbuf.xibuild
index d6f45f6..53db676 100644
--- a/repo/gdk-pixbuf/gdk-pixbuf.xibuild
+++ b/repo/gdk-pixbuf/gdk-pixbuf.xibuild
@@ -3,8 +3,7 @@
NAME="gdk-pixbuf"
DESC="GTK+ image loading library"
-MAKEDEPS="meson ninja gobject-introspection"
-DEPS="sbase glib shared-mime-info intltool libpng libjpeg-turbo tiff musl"
+MAKEDEPS="meson ninja gobject-introspection sbase glib shared-mime-info intltool libpng libjpeg-turbo tiff musl python-docutils"
PKG_VER=2.42.9
SOURCE="https://download.gnome.org/sources/gdk-pixbuf/${PKG_VER%.*}/gdk-pixbuf-$PKG_VER.tar.xz"
diff --git a/repo/glib/glib.trigger b/repo/glib/glib.trigger
new file mode 100644
index 0000000..e042aac
--- /dev/null
+++ b/repo/glib/glib.trigger
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+for i in "$@"; do
+ if ! [ -e "$i" ]; then
+ continue
+ fi
+ case "$i" in
+ */modules|*gtk-4.0)
+ /usr/bin/gio-querymodules "$i"
+ ;;
+ */schemas)
+ /usr/bin/glib-compile-schemas "$i"
+ ;;
+ esac
+done
+
diff --git a/repo/glib/glib.xibuild b/repo/glib/glib.xibuild
index dcf3a02..f92f62c 100644
--- a/repo/glib/glib.xibuild
+++ b/repo/glib/glib.xibuild
@@ -1,36 +1,32 @@
#!/bin/sh
-MAKEDEPS="meson ninja docbook-xsl docbook-dtd"
-DEPS="pcre libffi zlib musl libxslt gdbm"
+NAME="glib"
+DESC="Common C routines used by Gtk+ and other libs"
+
+MAKEDEPS=" bzip2 docbook-xml docbook-xsl gettext libxml2 libxslt python pcre2 meson zlib libffi util-linux"
+
+PKG_VER=2.74.0
+SOURCE="https://download.gnome.org/sources/glib/${PKG_VER%.*}/glib-$PKG_VER.tar.xz"
-PKG_VER=2.73.3
-SOURCE=https://download.gnome.org/sources/glib/$(echo $PKG_VER | cut -d. -f-2)/glib-$PKG_VER.tar.xz
-DESC="Low level core library"
ADDITIONAL="
0001-gquark-fix-initialization-with-c-constructors.patch
deprecated-no-warn.patch
-musl-libintl.patch"
-
-prepare () {
+glib.trigger
+gparamspec.patch
+"
+
+prepare () {
apply_patches
}
-build () {
- mkdir build &&
- cd build &&
-
- meson --prefix=/usr \
- --buildtype=release \
- -Dman=false \
- .. &&
- ninja
+build() {
+ meson --prefix=/usr \
+ --default-library=both \
+ -Dman=true \
+ . output
+ meson compile ${JOBS:+-j ${JOBS}} -C output
}
-package () {
- DESTDIR=$PKG_DEST ninja install
- mkdir -p $PKG_DEST/usr/share/doc/glib-$PKG_VER &&
- cp -r ../docs/reference/NEWS $PKG_DEST/usr/share/doc/glib-$PKG_VER
- cp -r ../docs/reference/gio $PKG_DEST/usr/share/doc/glib-$PKG_VER
- cp -r ../docs/reference/glib $PKG_DEST/usr/share/doc/glib-$PKG_VER
- cp -r ../docs/reference/gobject $PKG_DEST/usr/share/doc/glib-$PKG_VER
+package() {
+ DESTDIR="$PKG_DEST" meson install --no-rebuild -C output
}
diff --git a/repo/glib/gparamspec.patch b/repo/glib/gparamspec.patch
new file mode 100644
index 0000000..ef1dcfb
--- /dev/null
+++ b/repo/glib/gparamspec.patch
@@ -0,0 +1,33 @@
+From ea3f17d598d550345e94e4571130e429443e91cb Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Sun, 25 Sep 2022 14:20:24 +0100
+Subject: [PATCH] Empty values are not valid GParamSpec
+
+The validate() vfunc for GParamSpecParam returns FALSE for empty GValue,
+which means the is_valid() vfunc should do the same.
+
+This avoids a segfault when calling g_param_value_is_valid() on a
+GParamSpecParam.
+
+Fixes: #2770
+---
+ gobject/gparamspecs.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c
+index f17b3488b9..17b8606572 100644
+--- a/gobject/gparamspecs.c
++++ b/gobject/gparamspecs.c
+@@ -894,6 +894,9 @@ param_param_is_valid (GParamSpec *pspec,
+ {
+ GParamSpec *param = value->data[0].v_pointer;
+
++ if (param == NULL)
++ return FALSE;
++
+ return g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec));
+ }
+
+--
+GitLab
+
diff --git a/repo/grub/grub.xibuild b/repo/grub/grub.xibuild
index 049328b..ac331b3 100644
--- a/repo/grub/grub.xibuild
+++ b/repo/grub/grub.xibuild
@@ -20,7 +20,7 @@ prepare () {
build () {
./configure --prefix=/usr --sysconfdir=/etc --disable-werror \
- --disable-efiemu --enable-grub-mkfont --with-platform=efi
+ --disable-efiemu --enable-grub-mkfont --with-platform=efi --with-platform=pc
make
}
diff --git a/repo/gtk2/gtk2.xibuild b/repo/gtk2/gtk2.xibuild
index e04a379..258c2c5 100644
--- a/repo/gtk2/gtk2.xibuild
+++ b/repo/gtk2/gtk2.xibuild
@@ -3,8 +3,8 @@
NAME="gtk2"
DESC="The GTK+ Toolkit (v2)"
-MAKEDEPS="meson ninja libpng shared-mime-info"
-DEPS="atk at-spi2-atk sbase cairo gobject-introspection fontconfig fribidi gdk-pixbuf glib harfbuzz libepoxy intltool libx11 libxcomposite libxcursor libxdamage libxext libxfixes libxi libxinerama libxkbcommon libxrandr musl pango shared-mime-info wayland "
+#MAKEDEPS="meson ninja libpng shared-mime-info atk glib cairo pango gdk-pixbuf"
+MAKEDEPS=" meson ninja atk at-spi2-atk sbase cairo gobject-introspection fontconfig fribidi gdk-pixbuf glib harfbuzz libepoxy intltool libx11 libxcomposite libxcursor libxdamage libxext libxfixes libxi libxinerama libxkbcommon libxrandr musl pango shared-mime-info wayland libtool"
PKG_VER=2.24.33
SOURCE="https://download.gnome.org/sources/gtk+/${PKG_VER%.*}/gtk+-$PKG_VER.tar.xz"
@@ -12,9 +12,9 @@ SOURCE="https://download.gnome.org/sources/gtk+/${PKG_VER%.*}/gtk+-$PKG_VER.tar.
prepare () {
# don't build demos
sed -e "s/^\(SRC_SUBDIRS =.*\)demos\(.*\)$/\1\2/" -i Makefile.am Makefile.in
- aclocal -I m4
- autoreconf
- automake --add-missing
+ #aclocal -I m4
+ #autoreconf
+ #automake --add-missing
}
build () {
diff --git a/repo/gtk3/gtk3.xibuild b/repo/gtk3/gtk3.xibuild
index 145d949..6a88d01 100644
--- a/repo/gtk3/gtk3.xibuild
+++ b/repo/gtk3/gtk3.xibuild
@@ -9,31 +9,20 @@ DEPS="atk at-spi2-atk sbase cairo gobject-introspection fontconfig fribidi gdk-p
PKG_VER=3.24.34
SOURCE="https://download.gnome.org/sources/gtk+/${PKG_VER%.*}/gtk+-$PKG_VER.tar.xz"
-
-prepare () {
- # don't build demos
- sed -e "s/^\(SRC_SUBDIRS =.*\)demos\(.*\)$/\1\2/" -i Makefile.am Makefile.in
- aclocal -I m4
- autoreconf
- automake --add-missing
-}
-
build () {
- ./configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-xinput=yes \
- --without-libjasper \
- --with-included-loaders=png \
- --with-gdktarget=x11 \
- --enable-man
-
- make
+ mkdir build &&
+ cd build &&
+ meson --prefix=/usr \
+ -Db_lto=true \
+ -Dman=true \
+ -Dgtk_doc=false \
+ -Dbroadway_backend=true \
+ .. &&
+ ninja
}
package () {
- make DESTDIR=$PKG_DEST install
+ DESTDIR=$PKG_DEST ninja install
}
postinstall () {
diff --git a/repo/iceauth/iceauth.xibuild b/repo/iceauth/iceauth.xibuild
index b197866..f86fbb8 100644
--- a/repo/iceauth/iceauth.xibuild
+++ b/repo/iceauth/iceauth.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.8
SOURCE=https://www.x.org/pub/individual/app/iceauth-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/intel-vaapi-driver/intel-vaapi-driver.xibuild b/repo/intel-vaapi-driver/intel-vaapi-driver.xibuild
index 4452392..8a47e9a 100644
--- a/repo/intel-vaapi-driver/intel-vaapi-driver.xibuild
+++ b/repo/intel-vaapi-driver/intel-vaapi-driver.xibuild
@@ -9,7 +9,7 @@ PKG_VER=2.4.1
SOURCE=https://github.com/intel/intel-vaapi-driver/releases/download/$PKG_VER/intel-vaapi-driver-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/intltool/intltool.xibuild b/repo/intltool/intltool.xibuild
index aee502e..23e47bc 100644
--- a/repo/intltool/intltool.xibuild
+++ b/repo/intltool/intltool.xibuild
@@ -1,7 +1,6 @@
#!/bin/sh
-MAKEDEPS="make "
-DEPS="perl-xml-parser"
+MAKEDEPS="make perl-xml-parser"
PKG_VER=0.51.0
SOURCE=https://launchpad.net/intltool/trunk/$PKG_VER/+download/intltool-$PKG_VER.tar.gz
diff --git a/repo/libdmx/libdmx.xibuild b/repo/libdmx/libdmx.xibuild
index 9380c76..62658cc 100644
--- a/repo/libdmx/libdmx.xibuild
+++ b/repo/libdmx/libdmx.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/lib/libdmx-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libdmx-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libdmx-$PKG_VER
make
}
diff --git a/repo/libdrm/libdrm.xibuild b/repo/libdrm/libdrm.xibuild
index dc2c25e..6584e27 100644
--- a/repo/libdrm/libdrm.xibuild
+++ b/repo/libdrm/libdrm.xibuild
@@ -12,10 +12,10 @@ build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX \
+ meson --prefix=/usr \
--buildtype=release \
-Dudev=true \
- -Dvalgrind=false &&
+ -Dvalgrind=disabled &&
ninja
}
diff --git a/repo/libepoxy/libepoxy.xibuild b/repo/libepoxy/libepoxy.xibuild
index 3d79d77..03ab090 100644
--- a/repo/libepoxy/libepoxy.xibuild
+++ b/repo/libepoxy/libepoxy.xibuild
@@ -1,6 +1,6 @@
#!/bin/sh
-MAKEDEPS="meson ninja doxygen"
+MAKEDEPS="meson ninja doxygen mesa"
DEPS="mesa"
PKG_VER=1.5.9
diff --git a/repo/libevdev/libevdev.xibuild b/repo/libevdev/libevdev.xibuild
index c889ef2..788ca77 100644
--- a/repo/libevdev/libevdev.xibuild
+++ b/repo/libevdev/libevdev.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.13.0
SOURCE=https://www.freedesktop.org/software/libevdev/libevdev-$PKG_VER.tar.xz
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/libfontenc/libfontenc.xibuild b/repo/libfontenc/libfontenc.xibuild
index 6f9c0c3..6acbad5 100644
--- a/repo/libfontenc/libfontenc.xibuild
+++ b/repo/libfontenc/libfontenc.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/lib/libfontenc-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libfontenc-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libfontenc-$PKG_VER
make
}
diff --git a/repo/libfs/libfs.xibuild b/repo/libfs/libfs.xibuild
index 2e635dd..aeb40e0 100644
--- a/repo/libfs/libfs.xibuild
+++ b/repo/libfs/libfs.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.8
SOURCE=https://www.x.org/pub/individual/lib/libFS-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libFS-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libFS-$PKG_VER
make
}
diff --git a/repo/libice/libice.xibuild b/repo/libice/libice.xibuild
index b819df4..57bde19 100644
--- a/repo/libice/libice.xibuild
+++ b/repo/libice/libice.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.10
SOURCE=https://www.x.org/pub/individual/lib/libICE-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libICE-$PKG_VER ICE_LIBS=-lpthread
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libICE-$PKG_VER ICE_LIBS=-lpthread
make
}
diff --git a/repo/libinput/libinput.xibuild b/repo/libinput/libinput.xibuild
index 6686c9f..4141159 100644
--- a/repo/libinput/libinput.xibuild
+++ b/repo/libinput/libinput.xibuild
@@ -12,7 +12,7 @@ build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX \
+ meson --prefix=/usr \
--buildtype=release \
-Ddebug-gui=false \
-Dtests=false \
diff --git a/repo/libpciaccess/libpciaccess.xibuild b/repo/libpciaccess/libpciaccess.xibuild
index 6af00dc..b54a0e0 100644
--- a/repo/libpciaccess/libpciaccess.xibuild
+++ b/repo/libpciaccess/libpciaccess.xibuild
@@ -7,7 +7,7 @@ PKG_VER=0.16
SOURCE=https://www.x.org/pub/individual/lib/libpciaccess-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libpciaccess-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libpciaccess-$PKG_VER
make
}
diff --git a/repo/libpthread-stubs/libpthread-stubs.xibuild b/repo/libpthread-stubs/libpthread-stubs.xibuild
new file mode 100644
index 0000000..cbdeaec
--- /dev/null
+++ b/repo/libpthread-stubs/libpthread-stubs.xibuild
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+NAME="libpthread-stubs"
+DESC="Pthread functions stubs for platforms missing them"
+
+MAKEDEPS=""
+
+PKG_VER=0.4
+SOURCE="https://xcb.freedesktop.org/dist/libpthread-stubs-$PKG_VER.tar.bz2"
+
+build() {
+ ./configure \
+ --prefix=/usr
+ make
+}
+
+check() {
+ make check
+}
+
+package() {
+ make DESTDIR="$PKG_DEST" install
+}
+
diff --git a/repo/libsm/libsm.xibuild b/repo/libsm/libsm.xibuild
index 9e132d9..8d0ad62 100644
--- a/repo/libsm/libsm.xibuild
+++ b/repo/libsm/libsm.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.3
SOURCE=https://www.x.org/pub/individual/lib/libSM-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libSM-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libSM-$PKG_VER
make
}
diff --git a/repo/libvdpau-va-gl/libvdpau-va-gl.xibuild b/repo/libvdpau-va-gl/libvdpau-va-gl.xibuild
index 0a15532..4cf3b20 100644
--- a/repo/libvdpau-va-gl/libvdpau-va-gl.xibuild
+++ b/repo/libvdpau-va-gl/libvdpau-va-gl.xibuild
@@ -12,7 +12,7 @@ build () {
mkdir build &&
cd build &&
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$XORG_PREFIX .. &&
+ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. &&
make
}
diff --git a/repo/libvdpau/libvdpau.xibuild b/repo/libvdpau/libvdpau.xibuild
index 82c599c..e56ee57 100644
--- a/repo/libvdpau/libvdpau.xibuild
+++ b/repo/libvdpau/libvdpau.xibuild
@@ -12,7 +12,7 @@ build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX .. &&
+ meson --prefix=/usr .. &&
ninja
}
diff --git a/repo/libx11/libx11.xibuild b/repo/libx11/libx11.xibuild
index 90b6d57..726aee8 100644
--- a/repo/libx11/libx11.xibuild
+++ b/repo/libx11/libx11.xibuild
@@ -1,13 +1,13 @@
#!/bin/sh
-MAKEDEPS="make asciidoc xmlto lynx"
+MAKEDEPS="make asciidoc xmlto lynx xorgproto xtrans libxcb"
DEPS="fontconfig libxcb elogind xtrans"
PKG_VER=1.7.3.1
SOURCE=https://www.x.org/pub/individual/lib/libX11-$PKG_VER.tar.xz
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libX11-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libX11-$PKG_VER
make
}
diff --git a/repo/libxau/libxau.xibuild b/repo/libxau/libxau.xibuild
index adb0567..2251d81 100644
--- a/repo/libxau/libxau.xibuild
+++ b/repo/libxau/libxau.xibuild
@@ -8,7 +8,7 @@ SOURCE=https://www.x.org/pub/individual/lib/libXau-$PKG_VER.tar.bz2
DESC="X11 authorisation library"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/libxaw/libxaw.xibuild b/repo/libxaw/libxaw.xibuild
index e7e4788..b60fd8b 100644
--- a/repo/libxaw/libxaw.xibuild
+++ b/repo/libxaw/libxaw.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.14
SOURCE=https://www.x.org/pub/individual/lib/libXaw-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXaw-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXaw-$PKG_VER
make
}
diff --git a/repo/libxcb/libxcb.xibuild b/repo/libxcb/libxcb.xibuild
index b26cce5..645370d 100644
--- a/repo/libxcb/libxcb.xibuild
+++ b/repo/libxcb/libxcb.xibuild
@@ -1,21 +1,23 @@
#!/bin/sh
-MAKEDEPS="make doxygen libxslt"
-DEPS="libxau xcb-proto libxdmcp "
-
-PKG_VER=1.15
-SOURCE=https://xorg.freedesktop.org/archive/individual/lib/libxcb-$PKG_VER.tar.xz
+NAME="libxcb"
DESC="X11 client-side library"
-build () {
- CFLAGS="${CFLAGS:--O2 -g} -Wno-error=format-extra-args" \
- PYTHON=python3 \
- ./configure $XORG_CONFIG \
- --without-doxygen \
- --docdir='${datadir}'/doc/libxcb-$PKG_VER &&
- make
+MAKEDEPS="libxau xcb-proto libpthread-stubs libxdmcp libxslt python"
+
+PKG_VER=1.14
+SOURCE="https://xorg.freedesktop.org/archive/individual/lib/libxcb-$PKG_VER.tar.xz"
+
+build() {
+ ./configure \
+ --prefix=/usr \
+ --enable-xkb \
+ --enable-xinput \
+ --disable-xprint
+ make
}
-package () {
- make DESTDIR=$PKG_DEST install
+package() {
+ make DESTDIR="$PKG_DEST" install
}
+
diff --git a/repo/libxcomposite/libxcomposite.xibuild b/repo/libxcomposite/libxcomposite.xibuild
index 5cf3082..724662a 100644
--- a/repo/libxcomposite/libxcomposite.xibuild
+++ b/repo/libxcomposite/libxcomposite.xibuild
@@ -7,7 +7,7 @@ PKG_VER=0.4.5
SOURCE=https://www.x.org/pub/individual/lib/libXcomposite-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXcomposite-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXcomposite-$PKG_VER
make
}
diff --git a/repo/libxcursor/libxcursor.xibuild b/repo/libxcursor/libxcursor.xibuild
index 4ae2314..756af4e 100644
--- a/repo/libxcursor/libxcursor.xibuild
+++ b/repo/libxcursor/libxcursor.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.0
SOURCE=https://www.x.org/pub/individual/lib/libXcursor-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXcursor-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXcursor-$PKG_VER
make
}
diff --git a/repo/libxdamage/libxdamage.xibuild b/repo/libxdamage/libxdamage.xibuild
index cc03c7f..22cb20e 100644
--- a/repo/libxdamage/libxdamage.xibuild
+++ b/repo/libxdamage/libxdamage.xibuild
@@ -1,13 +1,12 @@
#!/bin/sh
-MAKEDEPS="make asciidoc xmlto lynx"
-DEPS="fontconfig libxcb elogind"
+MAKEDEPS="make asciidoc xmlto lynx fontconfig libxfixes libxcb elogind"
PKG_VER=1.1.5
SOURCE=https://www.x.org/pub/individual/lib/libXdamage-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXdamage-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXdamage-$PKG_VER
make
}
diff --git a/repo/libxdmcp/libxdmcp.xibuild b/repo/libxdmcp/libxdmcp.xibuild
index 2a0a481..b28349f 100644
--- a/repo/libxdmcp/libxdmcp.xibuild
+++ b/repo/libxdmcp/libxdmcp.xibuild
@@ -1,6 +1,6 @@
#!/bin/sh
-MAKEDEPS="make xmlto libxslt"
+MAKEDEPS="make xmlto libxslt libxdmcp"
DEPS="xorgproto"
PKG_VER=1.1.3
@@ -8,7 +8,7 @@ SOURCE=https://www.x.org/pub/individual/lib/libXdmcp-$PKG_VER.tar.bz2
DESC="X11 Display Manager Control Protocol library"
build () {
- ./configure $XORG_CONFIG --docdir=/usr/share/doc/libXdmcp-$PKG_VER &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXdmcp-$PKG_VER &&
make
}
diff --git a/repo/libxext/libxext.xibuild b/repo/libxext/libxext.xibuild
index f20a096..8f3849d 100644
--- a/repo/libxext/libxext.xibuild
+++ b/repo/libxext/libxext.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.3.4
SOURCE=https://www.x.org/pub/individual/lib/libXext-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXext-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXext-$PKG_VER
make
}
diff --git a/repo/libxfixes/libxfixes.xibuild b/repo/libxfixes/libxfixes.xibuild
index 0f337ce..12451c0 100644
--- a/repo/libxfixes/libxfixes.xibuild
+++ b/repo/libxfixes/libxfixes.xibuild
@@ -7,7 +7,7 @@ PKG_VER=6.0.0
SOURCE=https://www.x.org/pub/individual/lib/libXfixes-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXfixes-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXfixes-$PKG_VER
make
}
diff --git a/repo/libxfont2/libxfont2.xibuild b/repo/libxfont2/libxfont2.xibuild
index c2ba59d..d1b2d09 100644
--- a/repo/libxfont2/libxfont2.xibuild
+++ b/repo/libxfont2/libxfont2.xibuild
@@ -7,7 +7,7 @@ PKG_VER=2.0.5
SOURCE=https://www.x.org/pub/individual/lib/libXfont2-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXfont2-$PKG_VER --disable-devel-docs
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXfont2-$PKG_VER --disable-devel-docs
make
}
diff --git a/repo/libxft/libxft.xibuild b/repo/libxft/libxft.xibuild
index 3e2f91d..144a66c 100644
--- a/repo/libxft/libxft.xibuild
+++ b/repo/libxft/libxft.xibuild
@@ -1,13 +1,13 @@
#!/bin/sh
-MAKEDEPS="make asciidoc xmlto lynx"
+MAKEDEPS="make asciidoc xmlto lynx libxrender"
DEPS="fontconfig libxcb elogind"
PKG_VER=2.3.4
SOURCE=https://www.x.org/pub/individual/lib/libXft-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXft-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXft-$PKG_VER
make
}
diff --git a/repo/libxi/libxi.xibuild b/repo/libxi/libxi.xibuild
index 0b24abd..adc06ad 100644
--- a/repo/libxi/libxi.xibuild
+++ b/repo/libxi/libxi.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.8
SOURCE=https://www.x.org/pub/individual/lib/libXi-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXi-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXi-$PKG_VER
make
}
diff --git a/repo/libxinerama/libxinerama.xibuild b/repo/libxinerama/libxinerama.xibuild
index 047bdd0..b89189c 100644
--- a/repo/libxinerama/libxinerama.xibuild
+++ b/repo/libxinerama/libxinerama.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/lib/libXinerama-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXinerama-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXinerama-$PKG_VER
make
}
diff --git a/repo/libxkbfile/libxkbfile.xibuild b/repo/libxkbfile/libxkbfile.xibuild
index 9825b82..7c0d913 100644
--- a/repo/libxkbfile/libxkbfile.xibuild
+++ b/repo/libxkbfile/libxkbfile.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.0
SOURCE=https://www.x.org/pub/individual/lib/libxkbfile-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libxkbfile-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libxkbfile-$PKG_VER
make
}
diff --git a/repo/libxmu/libxmu.xibuild b/repo/libxmu/libxmu.xibuild
index 5127ccc..4dd4417 100644
--- a/repo/libxmu/libxmu.xibuild
+++ b/repo/libxmu/libxmu.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.3
SOURCE=https://www.x.org/pub/individual/lib/libXmu-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXmu-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXmu-$PKG_VER
make
}
diff --git a/repo/libxpm/libxpm.xibuild b/repo/libxpm/libxpm.xibuild
index cfdfadc..b109f76 100644
--- a/repo/libxpm/libxpm.xibuild
+++ b/repo/libxpm/libxpm.xibuild
@@ -7,7 +7,7 @@ PKG_VER=3.5.13
SOURCE=https://www.x.org/pub/individual/lib/libXpm-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXpm-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXpm-$PKG_VER
make
}
diff --git a/repo/libxrandr/libxrandr.xibuild b/repo/libxrandr/libxrandr.xibuild
index b41ffbd..a7c6899 100644
--- a/repo/libxrandr/libxrandr.xibuild
+++ b/repo/libxrandr/libxrandr.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.5.2
SOURCE=https://www.x.org/pub/individual/lib/libXrandr-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXrandr-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXrandr-$PKG_VER
make
}
diff --git a/repo/libxrender/libxrender.xibuild b/repo/libxrender/libxrender.xibuild
index 55126aa..a5ecc0f 100644
--- a/repo/libxrender/libxrender.xibuild
+++ b/repo/libxrender/libxrender.xibuild
@@ -1,13 +1,13 @@
#!/bin/sh
-MAKEDEPS="make asciidoc xmlto lynx"
+MAKEDEPS="make asciidoc xmlto lynx xcb-proto libx11 libxcb"
DEPS="fontconfig libxcb elogind"
PKG_VER=0.9.10
SOURCE=https://www.x.org/pub/individual/lib/libXrender-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXrender-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXrender-$PKG_VER
make
}
diff --git a/repo/libxres/libxres.xibuild b/repo/libxres/libxres.xibuild
index 0639324..98a8834 100644
--- a/repo/libxres/libxres.xibuild
+++ b/repo/libxres/libxres.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.1
SOURCE=https://www.x.org/pub/individual/lib/libXres-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXres-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXres-$PKG_VER
make
}
diff --git a/repo/libxscrnsaver/libxscrnsaver.xibuild b/repo/libxscrnsaver/libxscrnsaver.xibuild
index 27b710c..80ebb82 100644
--- a/repo/libxscrnsaver/libxscrnsaver.xibuild
+++ b/repo/libxscrnsaver/libxscrnsaver.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.3
SOURCE=https://www.x.org/pub/individual/lib/libXScrnSaver-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXScrnSaver-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXScrnSaver-$PKG_VER
make
}
diff --git a/repo/libxshmfence/libxshmfence.xibuild b/repo/libxshmfence/libxshmfence.xibuild
index 224612b..3b4f48f 100644
--- a/repo/libxshmfence/libxshmfence.xibuild
+++ b/repo/libxshmfence/libxshmfence.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.3
SOURCE=https://www.x.org/pub/individual/lib/libxshmfence-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libxshmfence-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libxshmfence-$PKG_VER
make
}
diff --git a/repo/libxt/libxt.xibuild b/repo/libxt/libxt.xibuild
index 293683d..0376276 100644
--- a/repo/libxt/libxt.xibuild
+++ b/repo/libxt/libxt.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.1
SOURCE=https://www.x.org/pub/individual/lib/libXt-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXt-$PKG_VER --with-appdefaultdir=/etc/X11/app-defaults
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXt-$PKG_VER --with-appdefaultdir=/etc/X11/app-defaults
make
}
diff --git a/repo/libxtst/libxtst.xibuild b/repo/libxtst/libxtst.xibuild
index 3df8477..ff43b39 100644
--- a/repo/libxtst/libxtst.xibuild
+++ b/repo/libxtst/libxtst.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.3
SOURCE=https://www.x.org/pub/individual/lib/libXtst-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXtst-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXtst-$PKG_VER
make
}
diff --git a/repo/libxv/libxv.xibuild b/repo/libxv/libxv.xibuild
index c7fa2b6..6eb3313 100644
--- a/repo/libxv/libxv.xibuild
+++ b/repo/libxv/libxv.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.11
SOURCE=https://www.x.org/pub/individual/lib/libXv-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXv-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXv-$PKG_VER
make
}
diff --git a/repo/libxvmc/libxvmc.xibuild b/repo/libxvmc/libxvmc.xibuild
index 7fcd0a8..f634e94 100644
--- a/repo/libxvmc/libxvmc.xibuild
+++ b/repo/libxvmc/libxvmc.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.12
SOURCE=https://www.x.org/pub/individual/lib/libXvMC-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXvMC-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXvMC-$PKG_VER
make
}
diff --git a/repo/libxxf86dga/libxxf86dga.xibuild b/repo/libxxf86dga/libxxf86dga.xibuild
index ba5a0b9..ce59a51 100644
--- a/repo/libxxf86dga/libxxf86dga.xibuild
+++ b/repo/libxxf86dga/libxxf86dga.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.5
SOURCE=https://www.x.org/pub/individual/lib/libXxf86dga-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXxf86dga-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXxf86dga-$PKG_VER
make
}
diff --git a/repo/libxxf86vm/libxxf86vm.xibuild b/repo/libxxf86vm/libxxf86vm.xibuild
index c3995c0..a8221de 100644
--- a/repo/libxxf86vm/libxxf86vm.xibuild
+++ b/repo/libxxf86vm/libxxf86vm.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/lib/libXxf86vm-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/libXxf86vm-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/libXxf86vm-$PKG_VER
make
}
diff --git a/repo/luit/luit.xibuild b/repo/luit/luit.xibuild
index 7a2beed..8f92fe2 100644
--- a/repo/luit/luit.xibuild
+++ b/repo/luit/luit.xibuild
@@ -11,7 +11,7 @@ prepare () {
}
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/mesa/0001-freedreno-Enable-A619.patch b/repo/mesa/0001-freedreno-Enable-A619.patch
new file mode 100644
index 0000000..e815b69
--- /dev/null
+++ b/repo/mesa/0001-freedreno-Enable-A619.patch
@@ -0,0 +1,37 @@
+From 6366f2452865ccc7103211b8e6d8ad9e65c6a95e Mon Sep 17 00:00:00 2001
+From: Konrad Dybcio <konrad.dybcio@somainline.org>
+Date: Sun, 10 Oct 2021 20:16:12 +0200
+Subject: [PATCH] freedreno: Enable A619
+
+Enable A619 as found in various SKUs of the SM Lagoon SoC, such as SM6350 and
+SM7225.
+
+Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
+---
+ src/freedreno/common/freedreno_devices.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py
+index e13b5c6c2c1..e2d311c0d74 100644
+--- a/src/freedreno/common/freedreno_devices.py
++++ b/src/freedreno/common/freedreno_devices.py
+@@ -202,7 +202,7 @@ add_gpus([
+ # info parameters are keyed to the sub-generation. These templates reduce
+ # the copypaste
+
+-# a615, a618, a630:
++# a615, a616, a618, a619 and a630:
+ a6xx_gen1 = dict(
+ fibers_per_sp = 128 * 16,
+ reg_size_vec4 = 96,
+@@ -267,6 +267,7 @@ a6xx_gen4 = dict(
+ add_gpus([
+ GPUId(615),
+ GPUId(618),
++ GPUId(619),
+ ], A6xxGPUInfo(
+ a6xx_gen1,
+ num_sp_cores = 1,
+--
+2.30.1 (Apple Git-130)
+
diff --git a/repo/mesa/add-use-elf-tls.patch b/repo/mesa/add-use-elf-tls.patch
deleted file mode 100644
index 629c5ac..0000000
--- a/repo/mesa/add-use-elf-tls.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/meson.build b/meson.build
-index e1e94e7..b355f94 100644
---- a/meson.build
-+++ b/meson.build
-@@ -447,7 +447,9 @@ endif
-
- # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
- use_elf_tls = false
--if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
-+with_use_elf_tls = get_option('use-elf-tls')
-+if with_use_elf_tls and
-+ (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
- (not with_platform_android or get_option('platform-sdk-version') >= 29) and
- (not with_platform_windows or not with_shared_glapi))
- pre_args += '-DUSE_ELF_TLS'
-diff --git a/meson_options.txt b/meson_options.txt
-index a7030ab..73bd28e 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -465,3 +465,9 @@ option(
- value : true,
- description : 'use msse2 flag for mingw x86. Default: true',
- )
-+option(
-+ 'use-elf-tls',
-+ type : 'boolean',
-+ value : false,
-+ description : 'Build support for initial-exec TLS model'
-+)
diff --git a/repo/mesa/mesa-21.3.7-add_xdemos-1.patch b/repo/mesa/mesa-21.3.7-add_xdemos-1.patch
deleted file mode 100644
index 6b41e57..0000000
--- a/repo/mesa/mesa-21.3.7-add_xdemos-1.patch
+++ /dev/null
@@ -1,3197 +0,0 @@
-Submitted By: DJ Lucas <dj@linuxfromscratch.org>
- based on previous patches submitted
- by Armin K and Fernando de Oliveira
-Date: 2020-10-16
-Initial Package Version: 19.0.4
-Upstream Status: Not applicable.
-Origin: Self.
-Description: This patch adds two OpenGL demos, glxinfo and
- glxgears and respective man pages.
-
-diff -Naurp mesa-20.2.1-orig/src/glx/meson.build mesa-20.2.1/src/glx/meson.build
---- mesa-20.2.1-orig/src/glx/meson.build 2020-10-14 12:19:10.623185200 -0500
-+++ mesa-20.2.1/src/glx/meson.build 2020-10-15 23:06:45.823362439 -0500
-@@ -165,6 +165,8 @@ libgl = shared_library(
- install : true,
- )
-
-+subdir('xdemos')
-+
- if with_tests
- subdir('tests')
- endif
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/glinfo_common.c mesa-20.2.1/src/glx/xdemos/glinfo_common.c
---- mesa-20.2.1-orig/src/glx/xdemos/glinfo_common.c 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/glinfo_common.c 2020-10-15 23:06:45.826695773 -0500
-@@ -0,0 +1,800 @@
-+/*
-+ * Copyright (C) 1999-2014 Brian Paul All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included
-+ * in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+#include <assert.h>
-+#include <ctype.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include "glinfo_common.h"
-+
-+#ifdef _WIN32
-+#define snprintf _snprintf
-+#endif
-+
-+
-+/**
-+ * Return the GL enum name for a numeric value.
-+ * We really only care about the compressed texture formats for now.
-+ */
-+static const char *
-+enum_name(GLenum val)
-+{
-+ static const struct {
-+ const char *name;
-+ GLenum val;
-+ } enums [] = {
-+ { "GL_COMPRESSED_ALPHA", 0x84E9 },
-+ { "GL_COMPRESSED_LUMINANCE", 0x84EA },
-+ { "GL_COMPRESSED_LUMINANCE_ALPHA", 0x84EB },
-+ { "GL_COMPRESSED_INTENSITY", 0x84EC },
-+ { "GL_COMPRESSED_RGB", 0x84ED },
-+ { "GL_COMPRESSED_RGBA", 0x84EE },
-+ { "GL_COMPRESSED_TEXTURE_FORMATS", 0x86A3 },
-+ { "GL_COMPRESSED_RGB", 0x84ED },
-+ { "GL_COMPRESSED_RGBA", 0x84EE },
-+ { "GL_COMPRESSED_TEXTURE_FORMATS", 0x86A3 },
-+ { "GL_COMPRESSED_ALPHA", 0x84E9 },
-+ { "GL_COMPRESSED_LUMINANCE", 0x84EA },
-+ { "GL_COMPRESSED_LUMINANCE_ALPHA", 0x84EB },
-+ { "GL_COMPRESSED_INTENSITY", 0x84EC },
-+ { "GL_COMPRESSED_SRGB", 0x8C48 },
-+ { "GL_COMPRESSED_SRGB_ALPHA", 0x8C49 },
-+ { "GL_COMPRESSED_SLUMINANCE", 0x8C4A },
-+ { "GL_COMPRESSED_SLUMINANCE_ALPHA", 0x8C4B },
-+ { "GL_COMPRESSED_RED", 0x8225 },
-+ { "GL_COMPRESSED_RG", 0x8226 },
-+ { "GL_COMPRESSED_RED_RGTC1", 0x8DBB },
-+ { "GL_COMPRESSED_SIGNED_RED_RGTC1", 0x8DBC },
-+ { "GL_COMPRESSED_RG_RGTC2", 0x8DBD },
-+ { "GL_COMPRESSED_SIGNED_RG_RGTC2", 0x8DBE },
-+ { "GL_COMPRESSED_RGB8_ETC2", 0x9274 },
-+ { "GL_COMPRESSED_SRGB8_ETC2", 0x9275 },
-+ { "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", 0x9276 },
-+ { "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", 0x9277 },
-+ { "GL_COMPRESSED_RGBA8_ETC2_EAC", 0x9278 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", 0x9279 },
-+ { "GL_COMPRESSED_R11_EAC", 0x9270 },
-+ { "GL_COMPRESSED_SIGNED_R11_EAC", 0x9271 },
-+ { "GL_COMPRESSED_RG11_EAC", 0x9272 },
-+ { "GL_COMPRESSED_SIGNED_RG11_EAC", 0x9273 },
-+ { "GL_COMPRESSED_ALPHA_ARB", 0x84E9 },
-+ { "GL_COMPRESSED_LUMINANCE_ARB", 0x84EA },
-+ { "GL_COMPRESSED_LUMINANCE_ALPHA_ARB", 0x84EB },
-+ { "GL_COMPRESSED_INTENSITY_ARB", 0x84EC },
-+ { "GL_COMPRESSED_RGB_ARB", 0x84ED },
-+ { "GL_COMPRESSED_RGBA_ARB", 0x84EE },
-+ { "GL_COMPRESSED_TEXTURE_FORMATS_ARB", 0x86A3 },
-+ { "GL_COMPRESSED_RGBA_BPTC_UNORM_ARB", 0x8E8C },
-+ { "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB", 0x8E8D },
-+ { "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB", 0x8E8E },
-+ { "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB", 0x8E8F },
-+ { "GL_COMPRESSED_RGBA_ASTC_4x4_KHR", 0x93B0 },
-+ { "GL_COMPRESSED_RGBA_ASTC_5x4_KHR", 0x93B1 },
-+ { "GL_COMPRESSED_RGBA_ASTC_5x5_KHR", 0x93B2 },
-+ { "GL_COMPRESSED_RGBA_ASTC_6x5_KHR", 0x93B3 },
-+ { "GL_COMPRESSED_RGBA_ASTC_6x6_KHR", 0x93B4 },
-+ { "GL_COMPRESSED_RGBA_ASTC_8x5_KHR", 0x93B5 },
-+ { "GL_COMPRESSED_RGBA_ASTC_8x6_KHR", 0x93B6 },
-+ { "GL_COMPRESSED_RGBA_ASTC_8x8_KHR", 0x93B7 },
-+ { "GL_COMPRESSED_RGBA_ASTC_10x5_KHR", 0x93B8 },
-+ { "GL_COMPRESSED_RGBA_ASTC_10x6_KHR", 0x93B9 },
-+ { "GL_COMPRESSED_RGBA_ASTC_10x8_KHR", 0x93BA },
-+ { "GL_COMPRESSED_RGBA_ASTC_10x10_KHR", 0x93BB },
-+ { "GL_COMPRESSED_RGBA_ASTC_12x10_KHR", 0x93BC },
-+ { "GL_COMPRESSED_RGBA_ASTC_12x12_KHR", 0x93BD },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR", 0x93D0 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR", 0x93D1 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR", 0x93D2 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR", 0x93D3 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR", 0x93D4 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR", 0x93D5 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR", 0x93D6 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR", 0x93D7 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR", 0x93D8 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR", 0x93D9 },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR", 0x93DA },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR", 0x93DB },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR", 0x93DC },
-+ { "GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR", 0x93DD },
-+ { "GL_COMPRESSED_RGB_FXT1_3DFX", 0x86B0 },
-+ { "GL_COMPRESSED_RGBA_FXT1_3DFX", 0x86B1 },
-+ { "GL_COMPRESSED_LUMINANCE_LATC1_EXT", 0x8C70 },
-+ { "GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT", 0x8C71 },
-+ { "GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT", 0x8C72 },
-+ { "GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT", 0x8C73 },
-+ { "GL_COMPRESSED_RED_RGTC1_EXT", 0x8DBB },
-+ { "GL_COMPRESSED_SIGNED_RED_RGTC1_EXT", 0x8DBC },
-+ { "GL_COMPRESSED_RED_GREEN_RGTC2_EXT", 0x8DBD },
-+ { "GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT", 0x8DBE },
-+ { "GL_COMPRESSED_RGB_S3TC_DXT1_EXT", 0x83F0 },
-+ { "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT", 0x83F1 },
-+ { "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT", 0x83F2 },
-+ { "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT", 0x83F3 },
-+ { "GL_COMPRESSED_SRGB_EXT", 0x8C48 },
-+ { "GL_COMPRESSED_SRGB_ALPHA_EXT", 0x8C49 },
-+ { "GL_COMPRESSED_SLUMINANCE_EXT", 0x8C4A },
-+ { "GL_COMPRESSED_SLUMINANCE_ALPHA_EXT", 0x8C4B },
-+ { "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT", 0x8C4C },
-+ { "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT", 0x8C4D },
-+ { "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT", 0x8C4E },
-+ { "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT", 0x8C4F },
-+ { "GL_PALETTE4_RGB8_OES", 0x8B90 },
-+ { "GL_PALETTE4_RGBA8_OES", 0x8B91 },
-+ { "GL_PALETTE4_R5_G6_B5_OES", 0x8B92 },
-+ { "GL_PALETTE4_RGBA4_OES", 0x8B93 },
-+ { "GL_PALETTE4_RGB5_A1_OES", 0x8B94 },
-+ { "GL_PALETTE8_RGB8_OES", 0x8B95 },
-+ { "GL_PALETTE8_RGBA8_OES", 0x8B96 },
-+ { "GL_PALETTE8_R5_G6_B5_OES", 0x8B97 },
-+ { "GL_PALETTE8_RGBA4_OES", 0x8B98 },
-+ { "GL_PALETTE8_RGB5_A1_OES", 0x8B99 }
-+ };
-+ const int n = sizeof(enums) / sizeof(enums[0]);
-+ static char buffer[100];
-+ int i;
-+ for (i = 0; i < n; i++) {
-+ if (enums[i].val == val) {
-+ return enums[i].name;
-+ }
-+ }
-+ /* enum val not found, just print hexadecimal value into static buffer */
-+ snprintf(buffer, sizeof(buffer), "0x%x", val);
-+ return buffer;
-+}
-+
-+
-+/*
-+ * qsort callback for string comparison.
-+ */
-+static int
-+compare_string_ptr(const void *p1, const void *p2)
-+{
-+ return strcmp(* (char * const *) p1, * (char * const *) p2);
-+}
-+
-+/*
-+ * Print a list of extensions, with word-wrapping.
-+ */
-+void
-+print_extension_list(const char *ext, GLboolean singleLine)
-+{
-+ char **extensions;
-+ int num_extensions;
-+ const char *indentString = " ";
-+ const int indent = 4;
-+ const int max = 79;
-+ int width, i, j, k;
-+
-+ if (!ext || !ext[0])
-+ return;
-+
-+ /* count the number of extensions, ignoring successive spaces */
-+ num_extensions = 0;
-+ j = 1;
-+ do {
-+ if ((ext[j] == ' ' || ext[j] == 0) && ext[j - 1] != ' ') {
-+ ++num_extensions;
-+ }
-+ } while(ext[j++]);
-+
-+ /* copy individual extensions to an array */
-+ extensions = malloc(num_extensions * sizeof *extensions);
-+ if (!extensions) {
-+ fprintf(stderr, "Error: malloc() failed\n");
-+ exit(1);
-+ }
-+ i = j = k = 0;
-+ while (1) {
-+ if (ext[j] == ' ' || ext[j] == 0) {
-+ /* found end of an extension name */
-+ const int len = j - i;
-+
-+ if (len) {
-+ assert(k < num_extensions);
-+
-+ extensions[k] = malloc(len + 1);
-+ if (!extensions[k]) {
-+ fprintf(stderr, "Error: malloc() failed\n");
-+ exit(1);
-+ }
-+
-+ memcpy(extensions[k], ext + i, len);
-+ extensions[k][len] = 0;
-+
-+ ++k;
-+ };
-+
-+ i += len + 1;
-+
-+ if (ext[j] == 0) {
-+ break;
-+ }
-+ }
-+ j++;
-+ }
-+ assert(k == num_extensions);
-+
-+ /* sort extensions alphabetically */
-+ qsort(extensions, num_extensions, sizeof extensions[0], compare_string_ptr);
-+
-+ /* print the extensions */
-+ width = indent;
-+ printf("%s", indentString);
-+ for (k = 0; k < num_extensions; ++k) {
-+ const int len = strlen(extensions[k]);
-+ if ((!singleLine) && (width + len > max)) {
-+ /* start a new line */
-+ printf("\n");
-+ width = indent;
-+ printf("%s", indentString);
-+ }
-+ /* print the extension name */
-+ printf("%s", extensions[k]);
-+
-+ /* either we're all done, or we'll continue with next extension */
-+ width += len + 1;
-+
-+ if (singleLine) {
-+ printf("\n");
-+ width = indent;
-+ printf("%s", indentString);
-+ }
-+ else if (k < (num_extensions -1)) {
-+ printf(", ");
-+ width += 2;
-+ }
-+ }
-+ printf("\n");
-+
-+ for (k = 0; k < num_extensions; ++k) {
-+ free(extensions[k]);
-+ }
-+ free(extensions);
-+}
-+
-+
-+
-+
-+/**
-+ * Get list of OpenGL extensions using core profile's glGetStringi().
-+ */
-+char *
-+build_core_profile_extension_list(const struct ext_functions *extfuncs)
-+{
-+ GLint i, n, totalLen;
-+ char *buffer;
-+
-+ glGetIntegerv(GL_NUM_EXTENSIONS, &n);
-+
-+ /* compute totalLen */
-+ totalLen = 0;
-+ for (i = 0; i < n; i++) {
-+ const char *ext = (const char *) extfuncs->GetStringi(GL_EXTENSIONS, i);
-+ if (ext)
-+ totalLen += strlen(ext) + 1; /* plus a space */
-+ }
-+
-+ if (!totalLen)
-+ return NULL;
-+
-+ buffer = malloc(totalLen + 1);
-+ if (buffer) {
-+ int pos = 0;
-+ for (i = 0; i < n; i++) {
-+ const char *ext = (const char *) extfuncs->GetStringi(GL_EXTENSIONS, i);
-+ strcpy(buffer + pos, ext);
-+ pos += strlen(ext);
-+ buffer[pos++] = ' ';
-+ }
-+ buffer[pos] = '\0';
-+ }
-+ return buffer;
-+}
-+
-+
-+/** Is extension 'ext' supported? */
-+GLboolean
-+extension_supported(const char *ext, const char *extensionsList)
-+{
-+ while (1) {
-+ const char *p = strstr(extensionsList, ext);
-+ if (p) {
-+ /* check that next char is a space or end of string */
-+ int extLen = strlen(ext);
-+ if (p[extLen] == 0 || p[extLen] == ' ') {
-+ return 1;
-+ }
-+ else {
-+ /* We found a superset string, keep looking */
-+ extensionsList += extLen;
-+ }
-+ }
-+ else {
-+ break;
-+ }
-+ }
-+ return 0;
-+}
-+
-+
-+/**
-+ * Is verNum >= verString?
-+ * \param verString such as "2.1", "3.0", etc.
-+ * \param verNum such as 20, 21, 30, 31, 32, etc.
-+ */
-+static GLboolean
-+version_supported(const char *verString, int verNum)
-+{
-+ int v;
-+
-+ if (!verString ||
-+ !isdigit(verString[0]) ||
-+ verString[1] != '.' ||
-+ !isdigit(verString[2])) {
-+ return GL_FALSE;
-+ }
-+
-+ v = (verString[0] - '0') * 10 + (verString[2] - '0');
-+
-+ return verNum >= v;
-+}
-+
-+
-+struct token_name
-+{
-+ GLenum token;
-+ const char *name;
-+};
-+
-+
-+static void
-+print_shader_limit_list(const struct token_name *lim)
-+{
-+ GLint max[1];
-+ unsigned i;
-+
-+ for (i = 0; lim[i].token; i++) {
-+ glGetIntegerv(lim[i].token, max);
-+ if (glGetError() == GL_NO_ERROR) {
-+ printf(" %s = %d\n", lim[i].name, max[0]);
-+ }
-+ }
-+}
-+
-+
-+/**
-+ * Print interesting limits for vertex/fragment shaders.
-+ */
-+static void
-+print_shader_limits(GLenum target)
-+{
-+ static const struct token_name vertex_limits[] = {
-+ { GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB" },
-+ { GL_MAX_VARYING_FLOATS_ARB, "GL_MAX_VARYING_FLOATS_ARB" },
-+ { GL_MAX_VERTEX_ATTRIBS_ARB, "GL_MAX_VERTEX_ATTRIBS_ARB" },
-+ { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
-+ { GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" },
-+ { GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" },
-+ { GL_MAX_TEXTURE_COORDS_ARB, "GL_MAX_TEXTURE_COORDS_ARB" },
-+ { GL_MAX_VERTEX_OUTPUT_COMPONENTS , "GL_MAX_VERTEX_OUTPUT_COMPONENTS " },
-+ { (GLenum) 0, NULL }
-+ };
-+ static const struct token_name fragment_limits[] = {
-+ { GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" },
-+ { GL_MAX_TEXTURE_COORDS_ARB, "GL_MAX_TEXTURE_COORDS_ARB" },
-+ { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
-+ { GL_MAX_FRAGMENT_INPUT_COMPONENTS , "GL_MAX_FRAGMENT_INPUT_COMPONENTS " },
-+ { (GLenum) 0, NULL }
-+ };
-+ static const struct token_name geometry_limits[] = {
-+ { GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS" },
-+ { GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS" },
-+ { GL_MAX_GEOMETRY_OUTPUT_VERTICES , "GL_MAX_GEOMETRY_OUTPUT_VERTICES " },
-+ { GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS" },
-+ { GL_MAX_GEOMETRY_INPUT_COMPONENTS , "GL_MAX_GEOMETRY_INPUT_COMPONENTS " },
-+ { GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS" },
-+ { (GLenum) 0, NULL }
-+ };
-+
-+ switch (target) {
-+ case GL_VERTEX_SHADER:
-+ printf(" GL_VERTEX_SHADER_ARB:\n");
-+ print_shader_limit_list(vertex_limits);
-+ break;
-+
-+ case GL_FRAGMENT_SHADER:
-+ printf(" GL_FRAGMENT_SHADER_ARB:\n");
-+ print_shader_limit_list(fragment_limits);
-+ break;
-+
-+ case GL_GEOMETRY_SHADER:
-+ printf(" GL_GEOMETRY_SHADER:\n");
-+ print_shader_limit_list(geometry_limits);
-+ break;
-+ }
-+}
-+
-+
-+/**
-+ * Print interesting limits for vertex/fragment programs.
-+ */
-+static void
-+print_program_limits(GLenum target,
-+ const struct ext_functions *extfuncs)
-+{
-+#if defined(GL_ARB_vertex_program) || defined(GL_ARB_fragment_program)
-+ struct token_name {
-+ GLenum token;
-+ const char *name;
-+ };
-+ static const struct token_name common_limits[] = {
-+ { GL_MAX_PROGRAM_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_INSTRUCTIONS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" },
-+ { GL_MAX_PROGRAM_TEMPORARIES_ARB, "GL_MAX_PROGRAM_TEMPORARIES_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, "GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB" },
-+ { GL_MAX_PROGRAM_PARAMETERS_ARB, "GL_MAX_PROGRAM_PARAMETERS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, "GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB" },
-+ { GL_MAX_PROGRAM_ATTRIBS_ARB, "GL_MAX_PROGRAM_ATTRIBS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB, "GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB" },
-+ { GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB, "GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB, "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" },
-+ { GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB" },
-+ { GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB" },
-+ { (GLenum) 0, NULL }
-+ };
-+ static const struct token_name fragment_limits[] = {
-+ { GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" },
-+ { GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" },
-+ { GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" },
-+ { GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB, "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" },
-+ { (GLenum) 0, NULL }
-+ };
-+
-+ GLint max[1];
-+ int i;
-+
-+ if (target == GL_VERTEX_PROGRAM_ARB) {
-+ printf(" GL_VERTEX_PROGRAM_ARB:\n");
-+ }
-+ else if (target == GL_FRAGMENT_PROGRAM_ARB) {
-+ printf(" GL_FRAGMENT_PROGRAM_ARB:\n");
-+ }
-+ else {
-+ return; /* something's wrong */
-+ }
-+
-+ for (i = 0; common_limits[i].token; i++) {
-+ extfuncs->GetProgramivARB(target, common_limits[i].token, max);
-+ if (glGetError() == GL_NO_ERROR) {
-+ printf(" %s = %d\n", common_limits[i].name, max[0]);
-+ }
-+ }
-+ if (target == GL_FRAGMENT_PROGRAM_ARB) {
-+ for (i = 0; fragment_limits[i].token; i++) {
-+ extfuncs->GetProgramivARB(target, fragment_limits[i].token, max);
-+ if (glGetError() == GL_NO_ERROR) {
-+ printf(" %s = %d\n", fragment_limits[i].name, max[0]);
-+ }
-+ }
-+ }
-+#endif /* GL_ARB_vertex_program / GL_ARB_fragment_program */
-+}
-+
-+
-+/**
-+ * Print interesting OpenGL implementation limits.
-+ * \param version 20, 21, 30, 31, 32, etc.
-+ */
-+void
-+print_limits(const char *extensions, const char *oglstring, int version,
-+ const struct ext_functions *extfuncs)
-+{
-+ struct token_name {
-+ GLuint count;
-+ GLenum token;
-+ const char *name;
-+ const char *extension; /* NULL or GL extension name or version string */
-+ };
-+ static const struct token_name limits[] = {
-+ { 1, GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH", NULL },
-+ { 1, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", NULL },
-+ { 1, GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES", NULL },
-+ { 1, GL_MAX_COLOR_MATRIX_STACK_DEPTH, "GL_MAX_COLOR_MATRIX_STACK_DEPTH", "GL_ARB_imaging" },
-+ { 1, GL_MAX_ELEMENTS_VERTICES, "GL_MAX_ELEMENTS_VERTICES", NULL },
-+ { 1, GL_MAX_ELEMENTS_INDICES, "GL_MAX_ELEMENTS_INDICES", NULL },
-+ { 1, GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER", NULL },
-+ { 1, GL_MAX_LIGHTS, "GL_MAX_LIGHTS", NULL },
-+ { 1, GL_MAX_LIST_NESTING, "GL_MAX_LIST_NESTING", NULL },
-+ { 1, GL_MAX_MODELVIEW_STACK_DEPTH, "GL_MAX_MODELVIEW_STACK_DEPTH", NULL },
-+ { 1, GL_MAX_NAME_STACK_DEPTH, "GL_MAX_NAME_STACK_DEPTH", NULL },
-+ { 1, GL_MAX_PIXEL_MAP_TABLE, "GL_MAX_PIXEL_MAP_TABLE", NULL },
-+ { 1, GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH", NULL },
-+ { 1, GL_MAX_TEXTURE_STACK_DEPTH, "GL_MAX_TEXTURE_STACK_DEPTH", NULL },
-+ { 1, GL_MAX_TEXTURE_SIZE, "GL_MAX_TEXTURE_SIZE", NULL },
-+ { 1, GL_MAX_3D_TEXTURE_SIZE, "GL_MAX_3D_TEXTURE_SIZE", NULL },
-+#if defined(GL_EXT_texture_array)
-+ { 1, GL_MAX_ARRAY_TEXTURE_LAYERS_EXT, "GL_MAX_ARRAY_TEXTURE_LAYERS", "GL_EXT_texture_array" },
-+#endif
-+ { 2, GL_MAX_VIEWPORT_DIMS, "GL_MAX_VIEWPORT_DIMS", NULL },
-+ { 2, GL_ALIASED_LINE_WIDTH_RANGE, "GL_ALIASED_LINE_WIDTH_RANGE", NULL },
-+ { 2, GL_SMOOTH_LINE_WIDTH_RANGE, "GL_SMOOTH_LINE_WIDTH_RANGE", NULL },
-+ { 2, GL_ALIASED_POINT_SIZE_RANGE, "GL_ALIASED_POINT_SIZE_RANGE", NULL },
-+ { 2, GL_SMOOTH_POINT_SIZE_RANGE, "GL_SMOOTH_POINT_SIZE_RANGE", NULL },
-+#if defined(GL_ARB_texture_cube_map)
-+ { 1, GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", "GL_ARB_texture_cube_map" },
-+#endif
-+#if defined(GL_NV_texture_rectangle)
-+ { 1, GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV", "GL_NV_texture_rectangle" },
-+#endif
-+#if defined(GL_ARB_multitexture)
-+ { 1, GL_MAX_TEXTURE_UNITS_ARB, "GL_MAX_TEXTURE_UNITS_ARB", "GL_ARB_multitexture" },
-+#endif
-+#if defined(GL_EXT_texture_lod_bias)
-+ { 1, GL_MAX_TEXTURE_LOD_BIAS_EXT, "GL_MAX_TEXTURE_LOD_BIAS_EXT", "GL_EXT_texture_lod_bias" },
-+#endif
-+#if defined(GL_EXT_texture_filter_anisotropic)
-+ { 1, GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT", "GL_EXT_texture_filter_anisotropic" },
-+#endif
-+#if defined(GL_ARB_draw_buffers)
-+ { 1, GL_MAX_DRAW_BUFFERS_ARB, "GL_MAX_DRAW_BUFFERS_ARB", "GL_ARB_draw_buffers" },
-+#endif
-+#if defined(GL_ARB_blend_func_extended)
-+ { 1, GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, "GL_MAX_DUAL_SOURCE_DRAW_BUFFERS", "GL_ARB_blend_func_extended" },
-+#endif
-+#if defined (GL_ARB_framebuffer_object)
-+ { 1, GL_MAX_RENDERBUFFER_SIZE, "GL_MAX_RENDERBUFFER_SIZE", "GL_ARB_framebuffer_object" },
-+ { 1, GL_MAX_COLOR_ATTACHMENTS, "GL_MAX_COLOR_ATTACHMENTS", "GL_ARB_framebuffer_object" },
-+ { 1, GL_MAX_SAMPLES, "GL_MAX_SAMPLES", "GL_ARB_framebuffer_object" },
-+#endif
-+#if defined (GL_EXT_transform_feedback)
-+ { 1, GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, "GL_MAX_TRANSFORM_FEEDBACK_BUFFERS", "GL_EXT_transform_feedback" },
-+ { 1, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT, "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", "GL_EXT_transform_feedback" },
-+ { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", "GL_EXT_transform_feedback", },
-+ { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", "GL_EXT_transform_feedback" },
-+#endif
-+#if defined (GL_ARB_texture_buffer_object)
-+ { 1, GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT, "GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT", "GL_ARB_texture_buffer_object" },
-+ { 1, GL_MAX_TEXTURE_BUFFER_SIZE, "GL_MAX_TEXTURE_BUFFER_SIZE", "GL_ARB_texture_buffer_object" },
-+#endif
-+#if defined (GL_ARB_texture_multisample)
-+ { 1, GL_MAX_COLOR_TEXTURE_SAMPLES, "GL_MAX_COLOR_TEXTURE_SAMPLES", "GL_ARB_texture_multisample" },
-+ { 1, GL_MAX_DEPTH_TEXTURE_SAMPLES, "GL_MAX_DEPTH_TEXTURE_SAMPLES", "GL_ARB_texture_multisample" },
-+ { 1, GL_MAX_INTEGER_SAMPLES, "GL_MAX_INTEGER_SAMPLES", "GL_ARB_texture_multisample" },
-+#endif
-+#if defined (GL_ARB_uniform_buffer_object)
-+ { 1, GL_MAX_VERTEX_UNIFORM_BLOCKS, "GL_MAX_VERTEX_UNIFORM_BLOCKS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_FRAGMENT_UNIFORM_BLOCKS, "GL_MAX_FRAGMENT_UNIFORM_BLOCKS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_GEOMETRY_UNIFORM_BLOCKS, "GL_MAX_GEOMETRY_UNIFORM_BLOCKS" , "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_COMBINED_UNIFORM_BLOCKS, "GL_MAX_COMBINED_UNIFORM_BLOCKS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_UNIFORM_BUFFER_BINDINGS, "GL_MAX_UNIFORM_BUFFER_BINDINGS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_UNIFORM_BLOCK_SIZE, "GL_MAX_UNIFORM_BLOCK_SIZE", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, "GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, "GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, "GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "GL_ARB_uniform_buffer_object" },
-+ { 1, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT", "GL_ARB_uniform_buffer_object" },
-+#endif
-+#if defined (GL_ARB_vertex_attrib_binding)
-+ { 1, GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", "GL_ARB_vertex_attrib_binding" },
-+ { 1, GL_MAX_VERTEX_ATTRIB_BINDINGS, "GL_MAX_VERTEX_ATTRIB_BINDINGS", "GL_ARB_vertex_attrib_binding" },
-+#endif
-+#if defined(GL_VERSION_4_4)
-+ { 1, GL_MAX_VERTEX_ATTRIB_STRIDE, "GL_MAX_VERTEX_ATTRIB_STRIDE", "4.4" },
-+#endif
-+ { 0, (GLenum) 0, NULL, NULL }
-+ };
-+ GLint i, max[2];
-+
-+ printf("%s limits:\n", oglstring);
-+ for (i = 0; limits[i].count; i++) {
-+ if (!limits[i].extension ||
-+ version_supported(limits[i].extension, version) ||
-+ extension_supported(limits[i].extension, extensions)) {
-+ glGetIntegerv(limits[i].token, max);
-+ if (glGetError() == GL_NO_ERROR) {
-+ if (limits[i].count == 1)
-+ printf(" %s = %d\n", limits[i].name, max[0]);
-+ else /* XXX fix if we ever query something with more than 2 values */
-+ printf(" %s = %d, %d\n", limits[i].name, max[0], max[1]);
-+ }
-+ }
-+ }
-+
-+ /* these don't fit into the above mechanism, unfortunately */
-+ if (extension_supported("GL_ARB_imaging", extensions)) {
-+ extfuncs->GetConvolutionParameteriv(GL_CONVOLUTION_2D,
-+ GL_MAX_CONVOLUTION_WIDTH, max);
-+ extfuncs->GetConvolutionParameteriv(GL_CONVOLUTION_2D,
-+ GL_MAX_CONVOLUTION_HEIGHT, max+1);
-+ printf(" GL_MAX_CONVOLUTION_WIDTH/HEIGHT = %d, %d\n", max[0], max[1]);
-+ }
-+
-+ if (extension_supported("GL_ARB_texture_compression", extensions)) {
-+ GLint i, n;
-+ GLint *formats;
-+ glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &n);
-+ printf(" GL_NUM_COMPRESSED_TEXTURE_FORMATS = %d\n", n);
-+ formats = (GLint *) malloc(n * sizeof(GLint));
-+ glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
-+ for (i = 0; i < n; i++) {
-+ printf(" %s\n", enum_name(formats[i]));
-+ }
-+ free(formats);
-+ }
-+#if defined(GL_ARB_vertex_program)
-+ if (extension_supported("GL_ARB_vertex_program", extensions)) {
-+ print_program_limits(GL_VERTEX_PROGRAM_ARB, extfuncs);
-+ }
-+#endif
-+#if defined(GL_ARB_fragment_program)
-+ if (extension_supported("GL_ARB_fragment_program", extensions)) {
-+ print_program_limits(GL_FRAGMENT_PROGRAM_ARB, extfuncs);
-+ }
-+#endif
-+ if (extension_supported("GL_ARB_vertex_shader", extensions)) {
-+ print_shader_limits(GL_VERTEX_SHADER_ARB);
-+ }
-+ if (extension_supported("GL_ARB_fragment_shader", extensions)) {
-+ print_shader_limits(GL_FRAGMENT_SHADER_ARB);
-+ }
-+ if (version >= 32) {
-+ print_shader_limits(GL_GEOMETRY_SHADER);
-+ }
-+}
-+
-+
-+
-+/**
-+ * Return string representation for bits in a bitmask.
-+ */
-+const char *
-+bitmask_to_string(const struct bit_info bits[], int numBits, int mask)
-+{
-+ static char buffer[256], *p;
-+ int i;
-+
-+ strcpy(buffer, "(none)");
-+ p = buffer;
-+ for (i = 0; i < numBits; i++) {
-+ if (mask & bits[i].bit) {
-+ if (p > buffer)
-+ *p++ = ',';
-+ strcpy(p, bits[i].name);
-+ p += strlen(bits[i].name);
-+ }
-+ }
-+
-+ return buffer;
-+}
-+
-+/**
-+ * Return string representation for the bitmask returned by
-+ * GL_CONTEXT_PROFILE_MASK (OpenGL 3.2 or later).
-+ */
-+const char *
-+profile_mask_string(int mask)
-+{
-+ const static struct bit_info bits[] = {
-+#ifdef GL_CONTEXT_CORE_PROFILE_BIT
-+ { GL_CONTEXT_CORE_PROFILE_BIT, "core profile"},
-+#endif
-+#ifdef GL_CONTEXT_COMPATIBILITY_PROFILE_BIT
-+ { GL_CONTEXT_COMPATIBILITY_PROFILE_BIT, "compatibility profile" }
-+#endif
-+ };
-+
-+ return bitmask_to_string(bits, ELEMENTS(bits), mask);
-+}
-+
-+
-+/**
-+ * Return string representation for the bitmask returned by
-+ * GL_CONTEXT_FLAGS (OpenGL 3.0 or later).
-+ */
-+const char *
-+context_flags_string(int mask)
-+{
-+ const static struct bit_info bits[] = {
-+#ifdef GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
-+ { GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, "forward-compatible" },
-+#endif
-+#ifdef GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB
-+ { GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB, "robust-access" },
-+#endif
-+ };
-+
-+ return bitmask_to_string(bits, ELEMENTS(bits), mask);
-+}
-+
-+
-+static void
-+usage(void)
-+{
-+#ifdef _WIN32
-+ printf("Usage: wglinfo [-v] [-t] [-h] [-b] [-l] [-s]\n");
-+#else
-+ printf("Usage: glxinfo [-v] [-t] [-h] [-b] [-l] [-s] [-i] [-display <dname>]\n");
-+ printf("\t-display <dname>: Print GLX visuals on specified server.\n");
-+ printf("\t-i: Force an indirect rendering context.\n");
-+#endif
-+ printf("\t-B: brief output, print only the basics.\n");
-+ printf("\t-v: Print visuals info in verbose form.\n");
-+ printf("\t-t: Print verbose table.\n");
-+ printf("\t-h: This information.\n");
-+ printf("\t-b: Find the 'best' visual and print its number.\n");
-+ printf("\t-l: Print interesting OpenGL limits.\n");
-+ printf("\t-s: Print a single extension per line.\n");
-+}
-+
-+void
-+parse_args(int argc, char *argv[], struct options *options)
-+{
-+ int i;
-+
-+ options->mode = Normal;
-+ options->findBest = GL_FALSE;
-+ options->limits = GL_FALSE;
-+ options->singleLine = GL_FALSE;
-+ options->displayName = NULL;
-+ options->allowDirect = GL_TRUE;
-+
-+ for (i = 1; i < argc; i++) {
-+#ifndef _WIN32
-+ if (strcmp(argv[i], "-display") == 0 && i + 1 < argc) {
-+ options->displayName = argv[i + 1];
-+ i++;
-+ }
-+ else if (strcmp(argv[i], "-i") == 0) {
-+ options->allowDirect = GL_FALSE;
-+ }
-+ else
-+#endif
-+ if (strcmp(argv[i], "-t") == 0) {
-+ options->mode = Wide;
-+ }
-+ else if (strcmp(argv[i], "-v") == 0) {
-+ options->mode = Verbose;
-+ }
-+ else if (strcmp(argv[i], "-B") == 0) {
-+ options->mode = Brief;
-+ }
-+ else if (strcmp(argv[i], "-b") == 0) {
-+ options->findBest = GL_TRUE;
-+ }
-+ else if (strcmp(argv[i], "-l") == 0) {
-+ options->limits = GL_TRUE;
-+ }
-+ else if (strcmp(argv[i], "-h") == 0) {
-+ usage();
-+ exit(0);
-+ }
-+ else if(strcmp(argv[i], "-s") == 0) {
-+ options->singleLine = GL_TRUE;
-+ }
-+ else {
-+ printf("Unknown option `%s'\n", argv[i]);
-+ usage();
-+ exit(0);
-+ }
-+ }
-+}
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/glinfo_common.h mesa-20.2.1/src/glx/xdemos/glinfo_common.h
---- mesa-20.2.1-orig/src/glx/xdemos/glinfo_common.h 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/glinfo_common.h 2020-10-15 23:06:45.826695773 -0500
-@@ -0,0 +1,142 @@
-+/*
-+ * Copyright (C) 1999-2014 Brian Paul All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included
-+ * in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+
-+/**
-+ * Common code shared by glxinfo and wglinfo.
-+ */
-+
-+#ifndef GLINFO_COMMON_H
-+#define GLINFO_COMMON_H
-+
-+
-+#ifdef _WIN32
-+/* GL/glext.h is not commonly available on Windows. */
-+#include <GL/glew.h>
-+#else
-+#include <GL/gl.h>
-+#include <GL/glext.h>
-+#endif
-+
-+typedef void (APIENTRY * GETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-+typedef const GLubyte *(APIENTRY * GETSTRINGIPROC) (GLenum name, GLuint index);
-+typedef void (APIENTRY * GETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-+
-+
-+/**
-+ * Ext functions needed in common code but must be provided by
-+ * glxinfo or wglinfo.
-+ */
-+struct ext_functions
-+{
-+ GETPROGRAMIVARBPROC GetProgramivARB;
-+ GETSTRINGIPROC GetStringi;
-+ GETCONVOLUTIONPARAMETERIVPROC GetConvolutionParameteriv;
-+};
-+
-+
-+#define ELEMENTS(array) (sizeof(array) / sizeof(array[0]))
-+
-+
-+struct bit_info
-+{
-+ int bit;
-+ const char *name;
-+};
-+
-+
-+typedef enum
-+{
-+ Normal,
-+ Wide,
-+ Verbose,
-+ Brief
-+} InfoMode;
-+
-+
-+struct options
-+{
-+ InfoMode mode;
-+ GLboolean findBest;
-+ GLboolean limits;
-+ GLboolean singleLine;
-+ /* GLX only */
-+ char *displayName;
-+ GLboolean allowDirect;
-+};
-+
-+
-+/** list of known OpenGL versions */
-+static const struct { int major, minor; } gl_versions[] = {
-+ {4, 5},
-+ {4, 4},
-+ {4, 3},
-+ {4, 2},
-+ {4, 1},
-+ {4, 0},
-+
-+ {3, 3},
-+ {3, 2},
-+ {3, 1},
-+ {3, 0},
-+
-+ {2, 1},
-+ {2, 0},
-+
-+ {1, 5},
-+ {1, 4},
-+ {1, 3},
-+ {1, 2},
-+ {1, 1},
-+ {1, 0},
-+
-+ {0, 0} /* end of list */
-+};
-+
-+
-+void
-+print_extension_list(const char *ext, GLboolean singleLine);
-+
-+char *
-+build_core_profile_extension_list(const struct ext_functions *extfuncs);
-+
-+GLboolean
-+extension_supported(const char *ext, const char *extensionsList);
-+
-+void
-+print_limits(const char *extensions, const char *oglstring, int version,
-+ const struct ext_functions *extfuncs);
-+
-+const char *
-+bitmask_to_string(const struct bit_info bits[], int numBits, int mask);
-+
-+const char *
-+profile_mask_string(int mask);
-+
-+const char *
-+context_flags_string(int mask);
-+
-+
-+void
-+parse_args(int argc, char *argv[], struct options *options);
-+
-+
-+#endif /* GLINFO_COMMON_H */
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/glxgears.1 mesa-20.2.1/src/glx/xdemos/glxgears.1
---- mesa-20.2.1-orig/src/glx/xdemos/glxgears.1 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/glxgears.1 2020-10-15 23:06:45.826695773 -0500
-@@ -0,0 +1,37 @@
-+.TH glxgears 1 "2006-11-29"
-+.SH NAME
-+glxgears \- ``gears'' demo for GLX
-+.SH SYNOPSIS
-+.B glxgears
-+.RI [ options ]
-+.SH DESCRIPTION
-+The \fIglxgears\fP program is a port of the ``gears'' demo to GLX. It displays
-+a set of rotating gears and prints out the frame rate at regular intervals. It
-+has become quite popular as basic benchmarking tool.
-+.SH OPTIONS
-+.TP 8
-+.B \-display \fIdisplay\fP
-+Specify which X display to run on.
-+.TP 8
-+.B \-stereo
-+Use a stereo enabled GLX visual.
-+.TP 8
-+.B \-samples \fIN\fP
-+Run in multisample mode with at least N samples.
-+.TP 8
-+.B \-fullscreen
-+Run in fullscreen mode.
-+.TP 8
-+.B \-info
-+Display OpenGL renderer information.
-+.TP 8
-+.B \-geometry \fIWxH+X+Y\fP
-+Window geometry.
-+.SH AUTHOR
-+glxgears was written by Brian Paul <brian.paul@tungstengraphics.com>.
-+.PP
-+This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
-+Debian project and updated by Fernando de Oliveira <famobr at yahoo dot
-+com dot br>, for the Linux From Scratch (LFS) project (but may be used by
-+others).
-+
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/glxgears.c mesa-20.2.1/src/glx/xdemos/glxgears.c
---- mesa-20.2.1-orig/src/glx/xdemos/glxgears.c 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/glxgears.c 2020-10-15 23:06:45.826695773 -0500
-@@ -0,0 +1,809 @@
-+/*
-+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included
-+ * in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+/*
-+ * This is a port of the infamous "gears" demo to straight GLX (i.e. no GLUT)
-+ * Port by Brian Paul 23 March 2001
-+ *
-+ * See usage() below for command line options.
-+ */
-+
-+
-+#include <math.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <X11/Xlib.h>
-+#include <X11/keysym.h>
-+#include <GL/gl.h>
-+#include <GL/glx.h>
-+#include <GL/glxext.h>
-+
-+#ifndef GLX_MESA_swap_control
-+#define GLX_MESA_swap_control 1
-+typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
-+#endif
-+
-+
-+#define BENCHMARK
-+
-+#ifdef BENCHMARK
-+
-+/* XXX this probably isn't very portable */
-+
-+#include <sys/time.h>
-+#include <unistd.h>
-+
-+/* return current time (in seconds) */
-+static double
-+current_time(void)
-+{
-+ struct timeval tv;
-+#ifdef __VMS
-+ (void) gettimeofday(&tv, NULL );
-+#else
-+ struct timezone tz;
-+ (void) gettimeofday(&tv, &tz);
-+#endif
-+ return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
-+}
-+
-+#else /*BENCHMARK*/
-+
-+/* dummy */
-+static double
-+current_time(void)
-+{
-+ /* update this function for other platforms! */
-+ static double t = 0.0;
-+ static int warn = 1;
-+ if (warn) {
-+ fprintf(stderr, "Warning: current_time() not implemented!!\n");
-+ warn = 0;
-+ }
-+ return t += 1.0;
-+}
-+
-+#endif /*BENCHMARK*/
-+
-+
-+
-+#ifndef M_PI
-+#define M_PI 3.14159265
-+#endif
-+
-+
-+/** Event handler results: */
-+#define NOP 0
-+#define EXIT 1
-+#define DRAW 2
-+
-+static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
-+static GLint gear1, gear2, gear3;
-+static GLfloat angle = 0.0;
-+
-+static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */
-+static GLboolean stereo = GL_FALSE; /* Enable stereo. */
-+static GLint samples = 0; /* Choose visual with at least N samples. */
-+static GLboolean animate = GL_TRUE; /* Animation */
-+static GLfloat eyesep = 5.0; /* Eye separation. */
-+static GLfloat fix_point = 40.0; /* Fixation point distance. */
-+static GLfloat left, right, asp; /* Stereo frustum params. */
-+
-+
-+/*
-+ *
-+ * Draw a gear wheel. You'll probably want to call this function when
-+ * building a display list since we do a lot of trig here.
-+ *
-+ * Input: inner_radius - radius of hole at center
-+ * outer_radius - radius at center of teeth
-+ * width - width of gear
-+ * teeth - number of teeth
-+ * tooth_depth - depth of tooth
-+ */
-+static void
-+gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
-+ GLint teeth, GLfloat tooth_depth)
-+{
-+ GLint i;
-+ GLfloat r0, r1, r2;
-+ GLfloat angle, da;
-+ GLfloat u, v, len;
-+
-+ r0 = inner_radius;
-+ r1 = outer_radius - tooth_depth / 2.0;
-+ r2 = outer_radius + tooth_depth / 2.0;
-+
-+ da = 2.0 * M_PI / teeth / 4.0;
-+
-+ glShadeModel(GL_FLAT);
-+
-+ glNormal3f(0.0, 0.0, 1.0);
-+
-+ /* draw front face */
-+ glBegin(GL_QUAD_STRIP);
-+ for (i = 0; i <= teeth; i++) {
-+ angle = i * 2.0 * M_PI / teeth;
-+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
-+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
-+ if (i < teeth) {
-+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
-+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-+ width * 0.5);
-+ }
-+ }
-+ glEnd();
-+
-+ /* draw front sides of teeth */
-+ glBegin(GL_QUADS);
-+ da = 2.0 * M_PI / teeth / 4.0;
-+ for (i = 0; i < teeth; i++) {
-+ angle = i * 2.0 * M_PI / teeth;
-+
-+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
-+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
-+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-+ width * 0.5);
-+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-+ width * 0.5);
-+ }
-+ glEnd();
-+
-+ glNormal3f(0.0, 0.0, -1.0);
-+
-+ /* draw back face */
-+ glBegin(GL_QUAD_STRIP);
-+ for (i = 0; i <= teeth; i++) {
-+ angle = i * 2.0 * M_PI / teeth;
-+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
-+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
-+ if (i < teeth) {
-+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-+ -width * 0.5);
-+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
-+ }
-+ }
-+ glEnd();
-+
-+ /* draw back sides of teeth */
-+ glBegin(GL_QUADS);
-+ da = 2.0 * M_PI / teeth / 4.0;
-+ for (i = 0; i < teeth; i++) {
-+ angle = i * 2.0 * M_PI / teeth;
-+
-+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-+ -width * 0.5);
-+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-+ -width * 0.5);
-+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
-+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
-+ }
-+ glEnd();
-+
-+ /* draw outward faces of teeth */
-+ glBegin(GL_QUAD_STRIP);
-+ for (i = 0; i < teeth; i++) {
-+ angle = i * 2.0 * M_PI / teeth;
-+
-+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
-+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
-+ u = r2 * cos(angle + da) - r1 * cos(angle);
-+ v = r2 * sin(angle + da) - r1 * sin(angle);
-+ len = sqrt(u * u + v * v);
-+ u /= len;
-+ v /= len;
-+ glNormal3f(v, -u, 0.0);
-+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
-+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
-+ glNormal3f(cos(angle), sin(angle), 0.0);
-+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-+ width * 0.5);
-+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
-+ -width * 0.5);
-+ u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
-+ v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
-+ glNormal3f(v, -u, 0.0);
-+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-+ width * 0.5);
-+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
-+ -width * 0.5);
-+ glNormal3f(cos(angle), sin(angle), 0.0);
-+ }
-+
-+ glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
-+ glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
-+
-+ glEnd();
-+
-+ glShadeModel(GL_SMOOTH);
-+
-+ /* draw inside radius cylinder */
-+ glBegin(GL_QUAD_STRIP);
-+ for (i = 0; i <= teeth; i++) {
-+ angle = i * 2.0 * M_PI / teeth;
-+ glNormal3f(-cos(angle), -sin(angle), 0.0);
-+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
-+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
-+ }
-+ glEnd();
-+}
-+
-+
-+static void
-+draw(void)
-+{
-+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-+
-+ glPushMatrix();
-+ glRotatef(view_rotx, 1.0, 0.0, 0.0);
-+ glRotatef(view_roty, 0.0, 1.0, 0.0);
-+ glRotatef(view_rotz, 0.0, 0.0, 1.0);
-+
-+ glPushMatrix();
-+ glTranslatef(-3.0, -2.0, 0.0);
-+ glRotatef(angle, 0.0, 0.0, 1.0);
-+ glCallList(gear1);
-+ glPopMatrix();
-+
-+ glPushMatrix();
-+ glTranslatef(3.1, -2.0, 0.0);
-+ glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
-+ glCallList(gear2);
-+ glPopMatrix();
-+
-+ glPushMatrix();
-+ glTranslatef(-3.1, 4.2, 0.0);
-+ glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
-+ glCallList(gear3);
-+ glPopMatrix();
-+
-+ glPopMatrix();
-+}
-+
-+
-+static void
-+draw_gears(void)
-+{
-+ if (stereo) {
-+ /* First left eye. */
-+ glDrawBuffer(GL_BACK_LEFT);
-+
-+ glMatrixMode(GL_PROJECTION);
-+ glLoadIdentity();
-+ glFrustum(left, right, -asp, asp, 5.0, 60.0);
-+
-+ glMatrixMode(GL_MODELVIEW);
-+
-+ glPushMatrix();
-+ glTranslated(+0.5 * eyesep, 0.0, 0.0);
-+ draw();
-+ glPopMatrix();
-+
-+ /* Then right eye. */
-+ glDrawBuffer(GL_BACK_RIGHT);
-+
-+ glMatrixMode(GL_PROJECTION);
-+ glLoadIdentity();
-+ glFrustum(-right, -left, -asp, asp, 5.0, 60.0);
-+
-+ glMatrixMode(GL_MODELVIEW);
-+
-+ glPushMatrix();
-+ glTranslated(-0.5 * eyesep, 0.0, 0.0);
-+ draw();
-+ glPopMatrix();
-+ }
-+ else {
-+ draw();
-+ }
-+}
-+
-+
-+/** Draw single frame, do SwapBuffers, compute FPS */
-+static void
-+draw_frame(Display *dpy, Window win)
-+{
-+ static int frames = 0;
-+ static double tRot0 = -1.0, tRate0 = -1.0;
-+ double dt, t = current_time();
-+
-+ if (tRot0 < 0.0)
-+ tRot0 = t;
-+ dt = t - tRot0;
-+ tRot0 = t;
-+
-+ if (animate) {
-+ /* advance rotation for next frame */
-+ angle += 70.0 * dt; /* 70 degrees per second */
-+ if (angle > 3600.0)
-+ angle -= 3600.0;
-+ }
-+
-+ draw_gears();
-+ glXSwapBuffers(dpy, win);
-+
-+ frames++;
-+
-+ if (tRate0 < 0.0)
-+ tRate0 = t;
-+ if (t - tRate0 >= 5.0) {
-+ GLfloat seconds = t - tRate0;
-+ GLfloat fps = frames / seconds;
-+ printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
-+ fps);
-+ fflush(stdout);
-+ tRate0 = t;
-+ frames = 0;
-+ }
-+}
-+
-+
-+/* new window size or exposure */
-+static void
-+reshape(int width, int height)
-+{
-+ glViewport(0, 0, (GLint) width, (GLint) height);
-+
-+ if (stereo) {
-+ GLfloat w;
-+
-+ asp = (GLfloat) height / (GLfloat) width;
-+ w = fix_point * (1.0 / 5.0);
-+
-+ left = -5.0 * ((w - 0.5 * eyesep) / fix_point);
-+ right = 5.0 * ((w + 0.5 * eyesep) / fix_point);
-+ }
-+ else {
-+ GLfloat h = (GLfloat) height / (GLfloat) width;
-+
-+ glMatrixMode(GL_PROJECTION);
-+ glLoadIdentity();
-+ glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
-+ }
-+
-+ glMatrixMode(GL_MODELVIEW);
-+ glLoadIdentity();
-+ glTranslatef(0.0, 0.0, -40.0);
-+}
-+
-+
-+
-+static void
-+init(void)
-+{
-+ static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
-+ static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
-+ static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
-+ static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
-+
-+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
-+ glEnable(GL_CULL_FACE);
-+ glEnable(GL_LIGHTING);
-+ glEnable(GL_LIGHT0);
-+ glEnable(GL_DEPTH_TEST);
-+
-+ /* make the gears */
-+ gear1 = glGenLists(1);
-+ glNewList(gear1, GL_COMPILE);
-+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
-+ gear(1.0, 4.0, 1.0, 20, 0.7);
-+ glEndList();
-+
-+ gear2 = glGenLists(1);
-+ glNewList(gear2, GL_COMPILE);
-+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
-+ gear(0.5, 2.0, 2.0, 10, 0.7);
-+ glEndList();
-+
-+ gear3 = glGenLists(1);
-+ glNewList(gear3, GL_COMPILE);
-+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
-+ gear(1.3, 2.0, 0.5, 10, 0.7);
-+ glEndList();
-+
-+ glEnable(GL_NORMALIZE);
-+}
-+
-+
-+/**
-+ * Remove window border/decorations.
-+ */
-+static void
-+no_border( Display *dpy, Window w)
-+{
-+ static const unsigned MWM_HINTS_DECORATIONS = (1 << 1);
-+ static const int PROP_MOTIF_WM_HINTS_ELEMENTS = 5;
-+
-+ typedef struct
-+ {
-+ unsigned long flags;
-+ unsigned long functions;
-+ unsigned long decorations;
-+ long inputMode;
-+ unsigned long status;
-+ } PropMotifWmHints;
-+
-+ PropMotifWmHints motif_hints;
-+ Atom prop, proptype;
-+ unsigned long flags = 0;
-+
-+ /* setup the property */
-+ motif_hints.flags = MWM_HINTS_DECORATIONS;
-+ motif_hints.decorations = flags;
-+
-+ /* get the atom for the property */
-+ prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", True );
-+ if (!prop) {
-+ /* something went wrong! */
-+ return;
-+ }
-+
-+ /* not sure this is correct, seems to work, XA_WM_HINTS didn't work */
-+ proptype = prop;
-+
-+ XChangeProperty( dpy, w, /* display, window */
-+ prop, proptype, /* property, type */
-+ 32, /* format: 32-bit datums */
-+ PropModeReplace, /* mode */
-+ (unsigned char *) &motif_hints, /* data */
-+ PROP_MOTIF_WM_HINTS_ELEMENTS /* nelements */
-+ );
-+}
-+
-+
-+/*
-+ * Create an RGB, double-buffered window.
-+ * Return the window and context handles.
-+ */
-+static void
-+make_window( Display *dpy, const char *name,
-+ int x, int y, int width, int height,
-+ Window *winRet, GLXContext *ctxRet, VisualID *visRet)
-+{
-+ int attribs[64];
-+ int i = 0;
-+
-+ int scrnum;
-+ XSetWindowAttributes attr;
-+ unsigned long mask;
-+ Window root;
-+ Window win;
-+ GLXContext ctx;
-+ XVisualInfo *visinfo;
-+
-+ /* Singleton attributes. */
-+ attribs[i++] = GLX_RGBA;
-+ attribs[i++] = GLX_DOUBLEBUFFER;
-+ if (stereo)
-+ attribs[i++] = GLX_STEREO;
-+
-+ /* Key/value attributes. */
-+ attribs[i++] = GLX_RED_SIZE;
-+ attribs[i++] = 1;
-+ attribs[i++] = GLX_GREEN_SIZE;
-+ attribs[i++] = 1;
-+ attribs[i++] = GLX_BLUE_SIZE;
-+ attribs[i++] = 1;
-+ attribs[i++] = GLX_DEPTH_SIZE;
-+ attribs[i++] = 1;
-+ if (samples > 0) {
-+ attribs[i++] = GLX_SAMPLE_BUFFERS;
-+ attribs[i++] = 1;
-+ attribs[i++] = GLX_SAMPLES;
-+ attribs[i++] = samples;
-+ }
-+
-+ attribs[i++] = None;
-+
-+ scrnum = DefaultScreen( dpy );
-+ root = RootWindow( dpy, scrnum );
-+
-+ visinfo = glXChooseVisual(dpy, scrnum, attribs);
-+ if (!visinfo) {
-+ printf("Error: couldn't get an RGB, Double-buffered");
-+ if (stereo)
-+ printf(", Stereo");
-+ if (samples > 0)
-+ printf(", Multisample");
-+ printf(" visual\n");
-+ exit(1);
-+ }
-+
-+ /* window attributes */
-+ attr.background_pixel = 0;
-+ attr.border_pixel = 0;
-+ attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
-+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
-+ /* XXX this is a bad way to get a borderless window! */
-+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-+
-+ win = XCreateWindow( dpy, root, x, y, width, height,
-+ 0, visinfo->depth, InputOutput,
-+ visinfo->visual, mask, &attr );
-+
-+ if (fullscreen)
-+ no_border(dpy, win);
-+
-+ /* set hints and properties */
-+ {
-+ XSizeHints sizehints;
-+ sizehints.x = x;
-+ sizehints.y = y;
-+ sizehints.width = width;
-+ sizehints.height = height;
-+ sizehints.flags = USSize | USPosition;
-+ XSetNormalHints(dpy, win, &sizehints);
-+ XSetStandardProperties(dpy, win, name, name,
-+ None, (char **)NULL, 0, &sizehints);
-+ }
-+
-+ ctx = glXCreateContext( dpy, visinfo, NULL, True );
-+ if (!ctx) {
-+ printf("Error: glXCreateContext failed\n");
-+ exit(1);
-+ }
-+
-+ *winRet = win;
-+ *ctxRet = ctx;
-+ *visRet = visinfo->visualid;
-+
-+ XFree(visinfo);
-+}
-+
-+
-+/**
-+ * Determine whether or not a GLX extension is supported.
-+ */
-+static int
-+is_glx_extension_supported(Display *dpy, const char *query)
-+{
-+ const int scrnum = DefaultScreen(dpy);
-+ const char *glx_extensions = NULL;
-+ const size_t len = strlen(query);
-+ const char *ptr;
-+
-+ if (glx_extensions == NULL) {
-+ glx_extensions = glXQueryExtensionsString(dpy, scrnum);
-+ }
-+
-+ ptr = strstr(glx_extensions, query);
-+ return ((ptr != NULL) && ((ptr[len] == ' ') || (ptr[len] == '\0')));
-+}
-+
-+
-+/**
-+ * Attempt to determine whether or not the display is synched to vblank.
-+ */
-+static void
-+query_vsync(Display *dpy, GLXDrawable drawable)
-+{
-+ int interval = 0;
-+
-+#if defined(GLX_EXT_swap_control)
-+ if (is_glx_extension_supported(dpy, "GLX_EXT_swap_control")) {
-+ unsigned int tmp = -1;
-+ glXQueryDrawable(dpy, drawable, GLX_SWAP_INTERVAL_EXT, &tmp);
-+ interval = tmp;
-+ } else
-+#endif
-+ if (is_glx_extension_supported(dpy, "GLX_MESA_swap_control")) {
-+ PFNGLXGETSWAPINTERVALMESAPROC pglXGetSwapIntervalMESA =
-+ (PFNGLXGETSWAPINTERVALMESAPROC)
-+ glXGetProcAddressARB((const GLubyte *) "glXGetSwapIntervalMESA");
-+
-+ interval = (*pglXGetSwapIntervalMESA)();
-+ } else if (is_glx_extension_supported(dpy, "GLX_SGI_swap_control")) {
-+ /* The default swap interval with this extension is 1. Assume that it
-+ * is set to the default.
-+ *
-+ * Many Mesa-based drivers default to 0, but all of these drivers also
-+ * export GLX_MESA_swap_control. In that case, this branch will never
-+ * be taken, and the correct result should be reported.
-+ */
-+ interval = 1;
-+ }
-+
-+
-+ if (interval > 0) {
-+ printf("Running synchronized to the vertical refresh. The framerate should be\n");
-+ if (interval == 1) {
-+ printf("approximately the same as the monitor refresh rate.\n");
-+ } else if (interval > 1) {
-+ printf("approximately 1/%d the monitor refresh rate.\n",
-+ interval);
-+ }
-+ }
-+}
-+
-+/**
-+ * Handle one X event.
-+ * \return NOP, EXIT or DRAW
-+ */
-+static int
-+handle_event(Display *dpy, Window win, XEvent *event)
-+{
-+ (void) dpy;
-+ (void) win;
-+
-+ switch (event->type) {
-+ case Expose:
-+ return DRAW;
-+ case ConfigureNotify:
-+ reshape(event->xconfigure.width, event->xconfigure.height);
-+ break;
-+ case KeyPress:
-+ {
-+ char buffer[10];
-+ int code;
-+ code = XLookupKeysym(&event->xkey, 0);
-+ if (code == XK_Left) {
-+ view_roty += 5.0;
-+ }
-+ else if (code == XK_Right) {
-+ view_roty -= 5.0;
-+ }
-+ else if (code == XK_Up) {
-+ view_rotx += 5.0;
-+ }
-+ else if (code == XK_Down) {
-+ view_rotx -= 5.0;
-+ }
-+ else {
-+ XLookupString(&event->xkey, buffer, sizeof(buffer),
-+ NULL, NULL);
-+ if (buffer[0] == 27) {
-+ /* escape */
-+ return EXIT;
-+ }
-+ else if (buffer[0] == 'a' || buffer[0] == 'A') {
-+ animate = !animate;
-+ }
-+ }
-+ return DRAW;
-+ }
-+ }
-+ return NOP;
-+}
-+
-+
-+static void
-+event_loop(Display *dpy, Window win)
-+{
-+ while (1) {
-+ int op;
-+ while (!animate || XPending(dpy) > 0) {
-+ XEvent event;
-+ XNextEvent(dpy, &event);
-+ op = handle_event(dpy, win, &event);
-+ if (op == EXIT)
-+ return;
-+ else if (op == DRAW)
-+ break;
-+ }
-+
-+ draw_frame(dpy, win);
-+ }
-+}
-+
-+
-+static void
-+usage(void)
-+{
-+ printf("Usage:\n");
-+ printf(" -display <displayname> set the display to run on\n");
-+ printf(" -stereo run in stereo mode\n");
-+ printf(" -samples N run in multisample mode with at least N samples\n");
-+ printf(" -fullscreen run in fullscreen mode\n");
-+ printf(" -info display OpenGL renderer info\n");
-+ printf(" -geometry WxH+X+Y window geometry\n");
-+}
-+
-+
-+int
-+main(int argc, char *argv[])
-+{
-+ unsigned int winWidth = 300, winHeight = 300;
-+ int x = 0, y = 0;
-+ Display *dpy;
-+ Window win;
-+ GLXContext ctx;
-+ char *dpyName = NULL;
-+ GLboolean printInfo = GL_FALSE;
-+ VisualID visId;
-+ int i;
-+
-+ for (i = 1; i < argc; i++) {
-+ if (strcmp(argv[i], "-display") == 0) {
-+ dpyName = argv[i+1];
-+ i++;
-+ }
-+ else if (strcmp(argv[i], "-info") == 0) {
-+ printInfo = GL_TRUE;
-+ }
-+ else if (strcmp(argv[i], "-stereo") == 0) {
-+ stereo = GL_TRUE;
-+ }
-+ else if (i < argc-1 && strcmp(argv[i], "-samples") == 0) {
-+ samples = strtod(argv[i+1], NULL );
-+ ++i;
-+ }
-+ else if (strcmp(argv[i], "-fullscreen") == 0) {
-+ fullscreen = GL_TRUE;
-+ }
-+ else if (i < argc-1 && strcmp(argv[i], "-geometry") == 0) {
-+ XParseGeometry(argv[i+1], &x, &y, &winWidth, &winHeight);
-+ i++;
-+ }
-+ else {
-+ usage();
-+ return -1;
-+ }
-+ }
-+
-+ dpy = XOpenDisplay(dpyName);
-+ if (!dpy) {
-+ printf("Error: couldn't open display %s\n",
-+ dpyName ? dpyName : getenv("DISPLAY"));
-+ return -1;
-+ }
-+
-+ if (fullscreen) {
-+ int scrnum = DefaultScreen(dpy);
-+
-+ x = 0; y = 0;
-+ winWidth = DisplayWidth(dpy, scrnum);
-+ winHeight = DisplayHeight(dpy, scrnum);
-+ }
-+
-+ make_window(dpy, "glxgears", x, y, winWidth, winHeight, &win, &ctx, &visId);
-+ XMapWindow(dpy, win);
-+ glXMakeCurrent(dpy, win, ctx);
-+ query_vsync(dpy, win);
-+
-+ if (printInfo) {
-+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
-+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
-+ printf("VisualID %d, 0x%x\n", (int) visId, (int) visId);
-+ }
-+
-+ init();
-+
-+ /* Set initial projection/viewing transformation.
-+ * We can't be sure we'll get a ConfigureNotify event when the window
-+ * first appears.
-+ */
-+ reshape(winWidth, winHeight);
-+
-+ event_loop(dpy, win);
-+
-+ glDeleteLists(gear1, 1);
-+ glDeleteLists(gear2, 1);
-+ glDeleteLists(gear3, 1);
-+ glXMakeCurrent(dpy, None, NULL);
-+ glXDestroyContext(dpy, ctx);
-+ XDestroyWindow(dpy, win);
-+ XCloseDisplay(dpy);
-+
-+ return 0;
-+}
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/glxinfo.1 mesa-20.2.1/src/glx/xdemos/glxinfo.1
---- mesa-20.2.1-orig/src/glx/xdemos/glxinfo.1 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/glxinfo.1 2020-10-15 23:06:45.826695773 -0500
-@@ -0,0 +1,46 @@
-+.TH glxinfo 1 "2006-11-29"
-+.SH NAME
-+glxinfo \- show information about the GLX implementation
-+.SH SYNOPSIS
-+.B glxinfo
-+.RI [ options ]
-+.SH DESCRIPTION
-+The \fIglxinfo\fP program shows information about the OpenGL and GLX
-+implementations running on a given X display.
-+.PP
-+The information includes details about the server- and client-side GLX
-+implementation, the OpenGL and GLU implementations as well as a list
-+of available GLX visuals.
-+.SH OPTIONS
-+.TP 8
-+.B \-v
-+Print visuals info in verbose form.
-+.TP 8
-+.B \-t
-+Print verbose table.
-+.TP 8
-+.B \-display \fIdisplay\fP
-+Specify the X display to interrogate.
-+.TP 8
-+.B \-h
-+Print usage information.
-+.TP 8
-+.B \-i
-+Force an indirect rendering context.
-+.TP 8
-+.B \-b
-+Find the "best" visual and print its number.
-+.TP 8
-+.B \-l
-+Print interesting OpenGL limits.
-+.TP 8
-+.B \-s
-+Print a single extension per line.
-+.SH AUTHOR
-+glxinfo was written by Brian Paul <brian.paul@tungstengraphics.com>.
-+.PP
-+This manual page was written by Thierry Reding <thierry@gilfi.de>, for the
-+Debian project and updated by Fernando de Oliveira <famobr at yahoo dot
-+com dot br>, for the Linux From Scratch (LFS) project (but may be used by
-+others).
-+
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/glxinfo.c mesa-20.2.1/src/glx/xdemos/glxinfo.c
---- mesa-20.2.1-orig/src/glx/xdemos/glxinfo.c 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/glxinfo.c 2020-10-15 23:06:45.826695773 -0500
-@@ -0,0 +1,1281 @@
-+/*
-+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included
-+ * in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+
-+/*
-+ * This program is a work-alike of the IRIX glxinfo program.
-+ * Command line options:
-+ * -t print wide table
-+ * -v print verbose information
-+ * -display DisplayName specify the X display to interogate
-+ * -B brief, print only the basics
-+ * -b only print ID of "best" visual on screen 0
-+ * -i use indirect rendering connection only
-+ * -l print interesting OpenGL limits (added 5 Sep 2002)
-+ *
-+ * Brian Paul 26 January 2000
-+ */
-+
-+#define GLX_GLXEXT_PROTOTYPES
-+#define GL_GLEXT_PROTOTYPES
-+
-+#include <assert.h>
-+#include <X11/Xlib.h>
-+#include <X11/Xutil.h>
-+#include <GL/gl.h>
-+#include <GL/glx.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include "glinfo_common.h"
-+
-+
-+#ifndef GLX_NONE_EXT
-+#define GLX_NONE_EXT 0x8000
-+#endif
-+
-+#ifndef GLX_TRANSPARENT_RGB
-+#define GLX_TRANSPARENT_RGB 0x8008
-+#endif
-+
-+#ifndef GLX_RGBA_BIT
-+#define GLX_RGBA_BIT 0x00000001
-+#endif
-+
-+#ifndef GLX_COLOR_INDEX_BIT
-+#define GLX_COLOR_INDEX_BIT 0x00000002
-+#endif
-+
-+
-+struct visual_attribs
-+{
-+ /* X visual attribs */
-+ int id; /* May be visual ID or FBConfig ID */
-+ int vis_id; /* Visual ID. Only set for FBConfigs */
-+ int klass;
-+ int depth;
-+ int redMask, greenMask, blueMask;
-+ int colormapSize;
-+ int bitsPerRGB;
-+
-+ /* GL visual attribs */
-+ int supportsGL;
-+ int drawableType;
-+ int transparentType;
-+ int transparentRedValue;
-+ int transparentGreenValue;
-+ int transparentBlueValue;
-+ int transparentAlphaValue;
-+ int transparentIndexValue;
-+ int bufferSize;
-+ int level;
-+ int render_type;
-+ int doubleBuffer;
-+ int stereo;
-+ int auxBuffers;
-+ int redSize, greenSize, blueSize, alphaSize;
-+ int depthSize;
-+ int stencilSize;
-+ int accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize;
-+ int numSamples, numMultisample;
-+ int visualCaveat;
-+ int floatComponents;
-+ int packedfloatComponents;
-+ int srgb;
-+};
-+
-+
-+/**
-+ * Version of the context that was created
-+ *
-+ * 20, 21, 30, 31, 32, etc.
-+ */
-+static int version;
-+
-+/**
-+ * GL Error checking/warning.
-+ */
-+static void
-+CheckError(int line)
-+{
-+ int n;
-+ n = glGetError();
-+ if (n)
-+ printf("Warning: GL error 0x%x at line %d\n", n, line);
-+}
-+
-+
-+static void
-+print_display_info(Display *dpy)
-+{
-+ printf("name of display: %s\n", DisplayString(dpy));
-+}
-+
-+
-+/**
-+ * Choose a simple FB Config.
-+ */
-+static GLXFBConfig *
-+choose_fb_config(Display *dpy, int scrnum)
-+{
-+ int fbAttribSingle[] = {
-+ GLX_RENDER_TYPE, GLX_RGBA_BIT,
-+ GLX_RED_SIZE, 1,
-+ GLX_GREEN_SIZE, 1,
-+ GLX_BLUE_SIZE, 1,
-+ GLX_DOUBLEBUFFER, False,
-+ None };
-+ int fbAttribDouble[] = {
-+ GLX_RENDER_TYPE, GLX_RGBA_BIT,
-+ GLX_RED_SIZE, 1,
-+ GLX_GREEN_SIZE, 1,
-+ GLX_BLUE_SIZE, 1,
-+ GLX_DOUBLEBUFFER, True,
-+ None };
-+ GLXFBConfig *configs;
-+ int nConfigs;
-+
-+ configs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &nConfigs);
-+ if (!configs)
-+ configs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &nConfigs);
-+
-+ return configs;
-+}
-+
-+
-+static Bool CreateContextErrorFlag;
-+
-+static int
-+create_context_error_handler(Display *dpy, XErrorEvent *error)
-+{
-+ (void) dpy;
-+ (void) error->error_code;
-+ CreateContextErrorFlag = True;
-+ return 0;
-+}
-+
-+
-+/**
-+ * Try to create a GLX context of the given version with flags/options.
-+ * Note: A version number is required in order to get a core profile
-+ * (at least w/ NVIDIA).
-+ */
-+static GLXContext
-+create_context_flags(Display *dpy, GLXFBConfig fbconfig, int major, int minor,
-+ int contextFlags, int profileMask, Bool direct)
-+{
-+#ifdef GLX_ARB_create_context
-+ static PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB_func = 0;
-+ static Bool firstCall = True;
-+ int (*old_handler)(Display *, XErrorEvent *);
-+ GLXContext context;
-+ int attribs[20];
-+ int n = 0;
-+
-+ if (firstCall) {
-+ /* See if we have GLX_ARB_create_context_profile and get pointer to
-+ * glXCreateContextAttribsARB() function.
-+ */
-+ const char *glxExt = glXQueryExtensionsString(dpy, 0);
-+ if (extension_supported("GLX_ARB_create_context_profile", glxExt)) {
-+ glXCreateContextAttribsARB_func = (PFNGLXCREATECONTEXTATTRIBSARBPROC)
-+ glXGetProcAddress((const GLubyte *) "glXCreateContextAttribsARB");
-+ }
-+ firstCall = False;
-+ }
-+
-+ if (!glXCreateContextAttribsARB_func)
-+ return 0;
-+
-+ /* setup attribute array */
-+ if (major) {
-+ attribs[n++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
-+ attribs[n++] = major;
-+ attribs[n++] = GLX_CONTEXT_MINOR_VERSION_ARB;
-+ attribs[n++] = minor;
-+ }
-+ if (contextFlags) {
-+ attribs[n++] = GLX_CONTEXT_FLAGS_ARB;
-+ attribs[n++] = contextFlags;
-+ }
-+#ifdef GLX_ARB_create_context_profile
-+ if (profileMask) {
-+ attribs[n++] = GLX_CONTEXT_PROFILE_MASK_ARB;
-+ attribs[n++] = profileMask;
-+ }
-+#endif
-+ attribs[n++] = 0;
-+
-+ /* install X error handler */
-+ old_handler = XSetErrorHandler(create_context_error_handler);
-+ CreateContextErrorFlag = False;
-+
-+ /* try creating context */
-+ context = glXCreateContextAttribsARB_func(dpy,
-+ fbconfig,
-+ 0, /* share_context */
-+ direct,
-+ attribs);
-+
-+ /* restore error handler */
-+ XSetErrorHandler(old_handler);
-+
-+ if (CreateContextErrorFlag)
-+ context = 0;
-+
-+ if (context && direct) {
-+ if (!glXIsDirect(dpy, context)) {
-+ glXDestroyContext(dpy, context);
-+ return 0;
-+ }
-+ }
-+
-+ return context;
-+#else
-+ return 0;
-+#endif
-+}
-+
-+
-+/**
-+ * Try to create a GLX context of the newest version.
-+ */
-+static GLXContext
-+create_context_with_config(Display *dpy, GLXFBConfig config,
-+ Bool coreProfile, Bool es2Profile, Bool direct)
-+{
-+ GLXContext ctx = 0;
-+
-+ if (coreProfile) {
-+ /* Try to create a core profile, starting with the newest version of
-+ * GL that we're aware of. If we don't specify the version
-+ */
-+ int i;
-+ for (i = 0; gl_versions[i].major > 0; i++) {
-+ /* don't bother below GL 3.0 */
-+ if (gl_versions[i].major == 3 &&
-+ gl_versions[i].minor == 0)
-+ return 0;
-+ ctx = create_context_flags(dpy, config,
-+ gl_versions[i].major,
-+ gl_versions[i].minor,
-+ 0x0,
-+ GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
-+ direct);
-+ if (ctx)
-+ return ctx;
-+ }
-+ /* couldn't get core profile context */
-+ return 0;
-+ }
-+
-+ if (es2Profile) {
-+#ifdef GLX_CONTEXT_ES2_PROFILE_BIT_EXT
-+ if (extension_supported("GLX_EXT_create_context_es2_profile",
-+ glXQueryExtensionsString(dpy, 0))) {
-+ ctx = create_context_flags(dpy, config, 2, 0, 0x0,
-+ GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
-+ direct);
-+ return ctx;
-+ }
-+#endif
-+ return 0;
-+ }
-+
-+ /* GLX should return a context of the latest GL version that supports
-+ * the full profile.
-+ */
-+ ctx = glXCreateNewContext(dpy, config, GLX_RGBA_TYPE, NULL, direct);
-+
-+ /* make sure the context is direct, if direct was requested */
-+ if (ctx && direct) {
-+ if (!glXIsDirect(dpy, ctx)) {
-+ glXDestroyContext(dpy, ctx);
-+ return 0;
-+ }
-+ }
-+
-+ return ctx;
-+}
-+
-+
-+static XVisualInfo *
-+choose_xvisinfo(Display *dpy, int scrnum)
-+{
-+ int attribSingle[] = {
-+ GLX_RGBA,
-+ GLX_RED_SIZE, 1,
-+ GLX_GREEN_SIZE, 1,
-+ GLX_BLUE_SIZE, 1,
-+ None };
-+ int attribDouble[] = {
-+ GLX_RGBA,
-+ GLX_RED_SIZE, 1,
-+ GLX_GREEN_SIZE, 1,
-+ GLX_BLUE_SIZE, 1,
-+ GLX_DOUBLEBUFFER,
-+ None };
-+ XVisualInfo *visinfo;
-+
-+ visinfo = glXChooseVisual(dpy, scrnum, attribSingle);
-+ if (!visinfo)
-+ visinfo = glXChooseVisual(dpy, scrnum, attribDouble);
-+
-+ return visinfo;
-+}
-+
-+
-+static void
-+query_renderer(void)
-+{
-+#ifdef GLX_MESA_query_renderer
-+ PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC queryInteger;
-+ PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC queryString;
-+ unsigned int v[3];
-+
-+ queryInteger = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)
-+ glXGetProcAddressARB((const GLubyte *)
-+ "glXQueryCurrentRendererIntegerMESA");
-+ queryString = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)
-+ glXGetProcAddressARB((const GLubyte *)
-+ "glXQueryCurrentRendererStringMESA");
-+
-+ printf("Extended renderer info (GLX_MESA_query_renderer):\n");
-+ queryInteger(GLX_RENDERER_VENDOR_ID_MESA, v);
-+ printf(" Vendor: %s (0x%x)\n",
-+ queryString(GLX_RENDERER_VENDOR_ID_MESA), *v);
-+ queryInteger(GLX_RENDERER_DEVICE_ID_MESA, v);
-+ printf(" Device: %s (0x%x)\n",
-+ queryString(GLX_RENDERER_DEVICE_ID_MESA), *v);
-+ queryInteger(GLX_RENDERER_VERSION_MESA, v);
-+ printf(" Version: %d.%d.%d\n", v[0], v[1], v[2]);
-+ queryInteger(GLX_RENDERER_ACCELERATED_MESA, v);
-+ printf(" Accelerated: %s\n", *v ? "yes" : "no");
-+ queryInteger(GLX_RENDERER_VIDEO_MEMORY_MESA, v);
-+ printf(" Video memory: %dMB\n", *v);
-+ queryInteger(GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA, v);
-+ printf(" Unified memory: %s\n", *v ? "yes" : "no");
-+ queryInteger(GLX_RENDERER_PREFERRED_PROFILE_MESA, v);
-+ printf(" Preferred profile: %s (0x%x)\n",
-+ *v == GLX_CONTEXT_CORE_PROFILE_BIT_ARB ? "core" :
-+ *v == GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB ? "compat" :
-+ "unknown", *v);
-+ queryInteger(GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA, v);
-+ printf(" Max core profile version: %d.%d\n", v[0], v[1]);
-+ queryInteger(GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA, v);
-+ printf(" Max compat profile version: %d.%d\n", v[0], v[1]);
-+ queryInteger(GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA, v);
-+ printf(" Max GLES1 profile version: %d.%d\n", v[0], v[1]);
-+ queryInteger(GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA, v);
-+ printf(" Max GLES[23] profile version: %d.%d\n", v[0], v[1]);
-+#endif
-+}
-+
-+
-+static Bool
-+print_screen_info(Display *dpy, int scrnum,
-+ const struct options *opts,
-+ Bool coreProfile, Bool es2Profile, Bool limits,
-+ Bool coreWorked)
-+{
-+ Window win;
-+ XSetWindowAttributes attr;
-+ unsigned long mask;
-+ Window root;
-+ GLXContext ctx = NULL;
-+ XVisualInfo *visinfo;
-+ int width = 100, height = 100;
-+ GLXFBConfig *fbconfigs;
-+ const char *oglstring = coreProfile ? "OpenGL core profile" :
-+ es2Profile ? "OpenGL ES profile" : "OpenGL";
-+
-+ root = RootWindow(dpy, scrnum);
-+
-+ /*
-+ * Choose FBConfig or XVisualInfo and create a context.
-+ */
-+ fbconfigs = choose_fb_config(dpy, scrnum);
-+ if (fbconfigs) {
-+ ctx = create_context_with_config(dpy, fbconfigs[0],
-+ coreProfile, es2Profile,
-+ opts->allowDirect);
-+ if (!ctx && opts->allowDirect && !coreProfile) {
-+ /* try indirect */
-+ ctx = create_context_with_config(dpy, fbconfigs[0],
-+ coreProfile, es2Profile, False);
-+ }
-+
-+ visinfo = glXGetVisualFromFBConfig(dpy, fbconfigs[0]);
-+ XFree(fbconfigs);
-+ }
-+ else if (!coreProfile && !es2Profile) {
-+ visinfo = choose_xvisinfo(dpy, scrnum);
-+ if (visinfo)
-+ ctx = glXCreateContext(dpy, visinfo, NULL, opts->allowDirect);
-+ } else
-+ visinfo = NULL;
-+
-+ if (!visinfo && !coreProfile && !es2Profile) {
-+ fprintf(stderr, "Error: couldn't find RGB GLX visual or fbconfig\n");
-+ return False;
-+ }
-+
-+ if (!ctx) {
-+ if (!coreProfile && !es2Profile)
-+ fprintf(stderr, "Error: glXCreateContext failed\n");
-+ XFree(visinfo);
-+ return False;
-+ }
-+
-+ /*
-+ * Create a window so that we can just bind the context.
-+ */
-+ attr.background_pixel = 0;
-+ attr.border_pixel = 0;
-+ attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
-+ attr.event_mask = StructureNotifyMask | ExposureMask;
-+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-+ win = XCreateWindow(dpy, root, 0, 0, width, height,
-+ 0, visinfo->depth, InputOutput,
-+ visinfo->visual, mask, &attr);
-+
-+ if (glXMakeCurrent(dpy, win, ctx)) {
-+ const char *serverVendor = glXQueryServerString(dpy, scrnum, GLX_VENDOR);
-+ const char *serverVersion = glXQueryServerString(dpy, scrnum, GLX_VERSION);
-+ const char *serverExtensions = glXQueryServerString(dpy, scrnum, GLX_EXTENSIONS);
-+ const char *clientVendor = glXGetClientString(dpy, GLX_VENDOR);
-+ const char *clientVersion = glXGetClientString(dpy, GLX_VERSION);
-+ const char *clientExtensions = glXGetClientString(dpy, GLX_EXTENSIONS);
-+ const char *glxExtensions = glXQueryExtensionsString(dpy, scrnum);
-+ const char *glVendor = (const char *) glGetString(GL_VENDOR);
-+ const char *glRenderer = (const char *) glGetString(GL_RENDERER);
-+ const char *glVersion = (const char *) glGetString(GL_VERSION);
-+ char *glExtensions = NULL;
-+ int glxVersionMajor = 0;
-+ int glxVersionMinor = 0;
-+ char *displayName = NULL;
-+ char *colon = NULL, *period = NULL;
-+ struct ext_functions extfuncs;
-+
-+ CheckError(__LINE__);
-+
-+ /* Get some ext functions */
-+ extfuncs.GetProgramivARB = (GETPROGRAMIVARBPROC)
-+ glXGetProcAddressARB((GLubyte *) "glGetProgramivARB");
-+ extfuncs.GetStringi = (GETSTRINGIPROC)
-+ glXGetProcAddressARB((GLubyte *) "glGetStringi");
-+ extfuncs.GetConvolutionParameteriv = (GETCONVOLUTIONPARAMETERIVPROC)
-+ glXGetProcAddressARB((GLubyte *) "glGetConvolutionParameteriv");
-+
-+ if (!glXQueryVersion(dpy, & glxVersionMajor, & glxVersionMinor)) {
-+ fprintf(stderr, "Error: glXQueryVersion failed\n");
-+ exit(1);
-+ }
-+
-+ /* Get list of GL extensions */
-+ if (coreProfile && extfuncs.GetStringi)
-+ glExtensions = build_core_profile_extension_list(&extfuncs);
-+ if (!glExtensions) {
-+ coreProfile = False;
-+ glExtensions = (char *) glGetString(GL_EXTENSIONS);
-+ }
-+
-+ CheckError(__LINE__);
-+
-+ if (!coreWorked) {
-+ /* Strip the screen number from the display name, if present. */
-+ if (!(displayName = (char *) malloc(strlen(DisplayString(dpy)) + 1))) {
-+ fprintf(stderr, "Error: malloc() failed\n");
-+ exit(1);
-+ }
-+ strcpy(displayName, DisplayString(dpy));
-+ colon = strrchr(displayName, ':');
-+ if (colon) {
-+ period = strchr(colon, '.');
-+ if (period)
-+ *period = '\0';
-+ }
-+
-+ printf("display: %s screen: %d\n", displayName, scrnum);
-+ free(displayName);
-+ printf("direct rendering: ");
-+ if (glXIsDirect(dpy, ctx)) {
-+ printf("Yes\n");
-+ }
-+ else {
-+ if (!opts->allowDirect) {
-+ printf("No (-i specified)\n");
-+ }
-+ else if (getenv("LIBGL_ALWAYS_INDIRECT")) {
-+ printf("No (LIBGL_ALWAYS_INDIRECT set)\n");
-+ }
-+ else {
-+ printf("No (If you want to find out why, try setting "
-+ "LIBGL_DEBUG=verbose)\n");
-+ }
-+ }
-+ if (opts->mode != Brief) {
-+ printf("server glx vendor string: %s\n", serverVendor);
-+ printf("server glx version string: %s\n", serverVersion);
-+ printf("server glx extensions:\n");
-+ print_extension_list(serverExtensions, opts->singleLine);
-+ printf("client glx vendor string: %s\n", clientVendor);
-+ printf("client glx version string: %s\n", clientVersion);
-+ printf("client glx extensions:\n");
-+ print_extension_list(clientExtensions, opts->singleLine);
-+ printf("GLX version: %u.%u\n", glxVersionMajor, glxVersionMinor);
-+ printf("GLX extensions:\n");
-+ print_extension_list(glxExtensions, opts->singleLine);
-+ }
-+ if (strstr(glxExtensions, "GLX_MESA_query_renderer"))
-+ query_renderer();
-+ printf("OpenGL vendor string: %s\n", glVendor);
-+ printf("OpenGL renderer string: %s\n", glRenderer);
-+ } else
-+ printf("\n");
-+
-+ printf("%s version string: %s\n", oglstring, glVersion);
-+
-+ version = (glVersion[0] - '0') * 10 + (glVersion[2] - '0');
-+
-+ CheckError(__LINE__);
-+
-+#ifdef GL_VERSION_2_0
-+ if (version >= 20) {
-+ char *v = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
-+ printf("%s shading language version string: %s\n", oglstring, v);
-+ }
-+#endif
-+ CheckError(__LINE__);
-+#ifdef GL_VERSION_3_0
-+ if (version >= 30 && !es2Profile) {
-+ GLint flags;
-+ glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
-+ printf("%s context flags: %s\n", oglstring, context_flags_string(flags));
-+ }
-+#endif
-+ CheckError(__LINE__);
-+#ifdef GL_VERSION_3_2
-+ if (version >= 32 && !es2Profile) {
-+ GLint mask;
-+ glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);
-+ printf("%s profile mask: %s\n", oglstring, profile_mask_string(mask));
-+ }
-+#endif
-+
-+ CheckError(__LINE__);
-+
-+ if (opts->mode != Brief) {
-+ printf("%s extensions:\n", oglstring);
-+ print_extension_list(glExtensions, opts->singleLine);
-+ }
-+
-+ if (limits) {
-+ print_limits(glExtensions, oglstring, version, &extfuncs);
-+ }
-+
-+ if (coreProfile)
-+ free(glExtensions);
-+ }
-+ else {
-+ fprintf(stderr, "Error: glXMakeCurrent failed\n");
-+ }
-+
-+ glXDestroyContext(dpy, ctx);
-+ XFree(visinfo);
-+ XDestroyWindow(dpy, win);
-+ XSync(dpy, 1);
-+ return True;
-+}
-+
-+
-+static const char *
-+visual_class_name(int cls)
-+{
-+ switch (cls) {
-+ case StaticColor:
-+ return "StaticColor";
-+ case PseudoColor:
-+ return "PseudoColor";
-+ case StaticGray:
-+ return "StaticGray";
-+ case GrayScale:
-+ return "GrayScale";
-+ case TrueColor:
-+ return "TrueColor";
-+ case DirectColor:
-+ return "DirectColor";
-+ default:
-+ return "";
-+ }
-+}
-+
-+static const char *
-+visual_drawable_type(int type)
-+{
-+ const static struct bit_info bits[] = {
-+ { GLX_WINDOW_BIT, "window" },
-+ { GLX_PIXMAP_BIT, "pixmap" },
-+ { GLX_PBUFFER_BIT, "pbuffer" }
-+ };
-+
-+ return bitmask_to_string(bits, ELEMENTS(bits), type);
-+}
-+
-+static const char *
-+visual_class_abbrev(int cls)
-+{
-+ switch (cls) {
-+ case StaticColor:
-+ return "sc";
-+ case PseudoColor:
-+ return "pc";
-+ case StaticGray:
-+ return "sg";
-+ case GrayScale:
-+ return "gs";
-+ case TrueColor:
-+ return "tc";
-+ case DirectColor:
-+ return "dc";
-+ default:
-+ return "";
-+ }
-+}
-+
-+static const char *
-+visual_render_type_name(int type)
-+{
-+ switch (type) {
-+ case GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT:
-+ return "ufloat";
-+ case GLX_RGBA_FLOAT_BIT_ARB:
-+ return "float";
-+ case GLX_RGBA_BIT:
-+ return "rgba";
-+ case GLX_COLOR_INDEX_BIT:
-+ return "ci";
-+ case GLX_RGBA_BIT | GLX_COLOR_INDEX_BIT:
-+ return "rgba|ci";
-+ default:
-+ return "";
-+ }
-+}
-+
-+static const char *
-+caveat_string(int caveat)
-+{
-+ switch (caveat) {
-+#ifdef GLX_EXT_visual_rating
-+ case GLX_SLOW_VISUAL_EXT:
-+ return "Slow";
-+ case GLX_NON_CONFORMANT_VISUAL_EXT:
-+ return "Ncon";
-+ case GLX_NONE_EXT:
-+ /* fall-through */
-+#endif
-+ case 0:
-+ /* fall-through */
-+ default:
-+ return "None";
-+ }
-+}
-+
-+
-+static Bool
-+get_visual_attribs(Display *dpy, XVisualInfo *vInfo,
-+ struct visual_attribs *attribs)
-+{
-+ const char *ext = glXQueryExtensionsString(dpy, vInfo->screen);
-+ int rgba;
-+
-+ memset(attribs, 0, sizeof(struct visual_attribs));
-+
-+ attribs->id = vInfo->visualid;
-+#if defined(__cplusplus) || defined(c_plusplus)
-+ attribs->klass = vInfo->c_class;
-+#else
-+ attribs->klass = vInfo->class;
-+#endif
-+ attribs->depth = vInfo->depth;
-+ attribs->redMask = vInfo->red_mask;
-+ attribs->greenMask = vInfo->green_mask;
-+ attribs->blueMask = vInfo->blue_mask;
-+ attribs->colormapSize = vInfo->colormap_size;
-+ attribs->bitsPerRGB = vInfo->bits_per_rgb;
-+
-+ if (glXGetConfig(dpy, vInfo, GLX_USE_GL, &attribs->supportsGL) != 0 ||
-+ !attribs->supportsGL)
-+ return False;
-+ glXGetConfig(dpy, vInfo, GLX_BUFFER_SIZE, &attribs->bufferSize);
-+ glXGetConfig(dpy, vInfo, GLX_LEVEL, &attribs->level);
-+ glXGetConfig(dpy, vInfo, GLX_RGBA, &rgba);
-+ if (rgba)
-+ attribs->render_type = GLX_RGBA_BIT;
-+ else
-+ attribs->render_type = GLX_COLOR_INDEX_BIT;
-+
-+ glXGetConfig(dpy, vInfo, GLX_DRAWABLE_TYPE, &attribs->drawableType);
-+ glXGetConfig(dpy, vInfo, GLX_DOUBLEBUFFER, &attribs->doubleBuffer);
-+ glXGetConfig(dpy, vInfo, GLX_STEREO, &attribs->stereo);
-+ glXGetConfig(dpy, vInfo, GLX_AUX_BUFFERS, &attribs->auxBuffers);
-+ glXGetConfig(dpy, vInfo, GLX_RED_SIZE, &attribs->redSize);
-+ glXGetConfig(dpy, vInfo, GLX_GREEN_SIZE, &attribs->greenSize);
-+ glXGetConfig(dpy, vInfo, GLX_BLUE_SIZE, &attribs->blueSize);
-+ glXGetConfig(dpy, vInfo, GLX_ALPHA_SIZE, &attribs->alphaSize);
-+ glXGetConfig(dpy, vInfo, GLX_DEPTH_SIZE, &attribs->depthSize);
-+ glXGetConfig(dpy, vInfo, GLX_STENCIL_SIZE, &attribs->stencilSize);
-+ glXGetConfig(dpy, vInfo, GLX_ACCUM_RED_SIZE, &attribs->accumRedSize);
-+ glXGetConfig(dpy, vInfo, GLX_ACCUM_GREEN_SIZE, &attribs->accumGreenSize);
-+ glXGetConfig(dpy, vInfo, GLX_ACCUM_BLUE_SIZE, &attribs->accumBlueSize);
-+ glXGetConfig(dpy, vInfo, GLX_ACCUM_ALPHA_SIZE, &attribs->accumAlphaSize);
-+
-+ /* get transparent pixel stuff */
-+ glXGetConfig(dpy, vInfo,GLX_TRANSPARENT_TYPE, &attribs->transparentType);
-+ if (attribs->transparentType == GLX_TRANSPARENT_RGB) {
-+ glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_RED_VALUE, &attribs->transparentRedValue);
-+ glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_GREEN_VALUE, &attribs->transparentGreenValue);
-+ glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_BLUE_VALUE, &attribs->transparentBlueValue);
-+ glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_ALPHA_VALUE, &attribs->transparentAlphaValue);
-+ }
-+ else if (attribs->transparentType == GLX_TRANSPARENT_INDEX) {
-+ glXGetConfig(dpy, vInfo, GLX_TRANSPARENT_INDEX_VALUE, &attribs->transparentIndexValue);
-+ }
-+
-+ /* multisample attribs */
-+#ifdef GLX_ARB_multisample
-+ if (ext && strstr(ext, "GLX_ARB_multisample")) {
-+ glXGetConfig(dpy, vInfo, GLX_SAMPLE_BUFFERS_ARB, &attribs->numMultisample);
-+ glXGetConfig(dpy, vInfo, GLX_SAMPLES_ARB, &attribs->numSamples);
-+ }
-+#endif
-+ else {
-+ attribs->numSamples = 0;
-+ attribs->numMultisample = 0;
-+ }
-+
-+#if defined(GLX_EXT_visual_rating)
-+ if (ext && strstr(ext, "GLX_EXT_visual_rating")) {
-+ glXGetConfig(dpy, vInfo, GLX_VISUAL_CAVEAT_EXT, &attribs->visualCaveat);
-+ }
-+ else {
-+ attribs->visualCaveat = GLX_NONE_EXT;
-+ }
-+#else
-+ attribs->visualCaveat = 0;
-+#endif
-+
-+#if defined(GLX_EXT_framebuffer_sRGB)
-+ if (ext && strstr(ext, "GLX_EXT_framebuffer_sRGB")) {
-+ glXGetConfig(dpy, vInfo, GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, &attribs->srgb);
-+ }
-+#endif
-+
-+ return True;
-+}
-+
-+#ifdef GLX_VERSION_1_3
-+
-+static int
-+glx_token_to_visual_class(int visual_type)
-+{
-+ switch (visual_type) {
-+ case GLX_TRUE_COLOR:
-+ return TrueColor;
-+ case GLX_DIRECT_COLOR:
-+ return DirectColor;
-+ case GLX_PSEUDO_COLOR:
-+ return PseudoColor;
-+ case GLX_STATIC_COLOR:
-+ return StaticColor;
-+ case GLX_GRAY_SCALE:
-+ return GrayScale;
-+ case GLX_STATIC_GRAY:
-+ return StaticGray;
-+ case GLX_NONE:
-+ default:
-+ return None;
-+ }
-+}
-+
-+static Bool
-+get_fbconfig_attribs(Display *dpy, GLXFBConfig fbconfig,
-+ struct visual_attribs *attribs)
-+{
-+ const char *ext = glXQueryExtensionsString(dpy, 0);
-+ int visual_type;
-+ XVisualInfo *vInfo;
-+
-+ memset(attribs, 0, sizeof(struct visual_attribs));
-+
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_FBCONFIG_ID, &attribs->id);
-+
-+ vInfo = glXGetVisualFromFBConfig(dpy, fbconfig);
-+
-+ if (vInfo != NULL) {
-+ attribs->vis_id = vInfo->visualid;
-+ attribs->depth = vInfo->depth;
-+ attribs->redMask = vInfo->red_mask;
-+ attribs->greenMask = vInfo->green_mask;
-+ attribs->blueMask = vInfo->blue_mask;
-+ attribs->colormapSize = vInfo->colormap_size;
-+ attribs->bitsPerRGB = vInfo->bits_per_rgb;
-+ }
-+
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_X_VISUAL_TYPE, &visual_type);
-+ attribs->klass = glx_token_to_visual_class(visual_type);
-+
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_DRAWABLE_TYPE, &attribs->drawableType);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_BUFFER_SIZE, &attribs->bufferSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_LEVEL, &attribs->level);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &attribs->render_type);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &attribs->doubleBuffer);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_STEREO, &attribs->stereo);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_AUX_BUFFERS, &attribs->auxBuffers);
-+
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_RED_SIZE, &attribs->redSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_GREEN_SIZE, &attribs->greenSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_BLUE_SIZE, &attribs->blueSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_ALPHA_SIZE, &attribs->alphaSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_DEPTH_SIZE, &attribs->depthSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_STENCIL_SIZE, &attribs->stencilSize);
-+
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_ACCUM_RED_SIZE, &attribs->accumRedSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_ACCUM_GREEN_SIZE, &attribs->accumGreenSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_ACCUM_BLUE_SIZE, &attribs->accumBlueSize);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_ACCUM_ALPHA_SIZE, &attribs->accumAlphaSize);
-+
-+ /* get transparent pixel stuff */
-+ glXGetFBConfigAttrib(dpy, fbconfig,GLX_TRANSPARENT_TYPE, &attribs->transparentType);
-+ if (attribs->transparentType == GLX_TRANSPARENT_RGB) {
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_RED_VALUE, &attribs->transparentRedValue);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_GREEN_VALUE, &attribs->transparentGreenValue);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_BLUE_VALUE, &attribs->transparentBlueValue);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_ALPHA_VALUE, &attribs->transparentAlphaValue);
-+ }
-+ else if (attribs->transparentType == GLX_TRANSPARENT_INDEX) {
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_INDEX_VALUE, &attribs->transparentIndexValue);
-+ }
-+
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_SAMPLE_BUFFERS, &attribs->numMultisample);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_SAMPLES, &attribs->numSamples);
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_CONFIG_CAVEAT, &attribs->visualCaveat);
-+
-+#if defined(GLX_NV_float_buffer)
-+ if (ext && strstr(ext, "GLX_NV_float_buffer")) {
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_FLOAT_COMPONENTS_NV, &attribs->floatComponents);
-+ }
-+#endif
-+#if defined(GLX_ARB_fbconfig_float)
-+ if (ext && strstr(ext, "GLX_ARB_fbconfig_float")) {
-+ if (attribs->render_type & GLX_RGBA_FLOAT_BIT_ARB) {
-+ attribs->floatComponents = True;
-+ }
-+ }
-+#endif
-+#if defined(GLX_EXT_fbconfig_packed_float)
-+ if (ext && strstr(ext, "GLX_EXT_fbconfig_packed_float")) {
-+ if (attribs->render_type & GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT) {
-+ attribs->packedfloatComponents = True;
-+ }
-+ }
-+#endif
-+
-+#if defined(GLX_EXT_framebuffer_sRGB)
-+ if (ext && strstr(ext, "GLX_EXT_framebuffer_sRGB")) {
-+ glXGetFBConfigAttrib(dpy, fbconfig, GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, &attribs->srgb);
-+ }
-+#endif
-+ return True;
-+}
-+
-+#endif
-+
-+
-+
-+static void
-+print_visual_attribs_verbose(const struct visual_attribs *attribs,
-+ int fbconfigs)
-+{
-+ if (fbconfigs) {
-+ printf("FBConfig ID: %x Visual ID=%x depth=%d class=%s, type=%s\n",
-+ attribs->id, attribs->vis_id, attribs->depth,
-+ visual_class_name(attribs->klass),
-+ visual_drawable_type(attribs->drawableType));
-+ }
-+ else {
-+ printf("Visual ID: %x depth=%d class=%s, type=%s\n",
-+ attribs->id, attribs->depth, visual_class_name(attribs->klass),
-+ visual_drawable_type(attribs->drawableType));
-+ }
-+ printf(" bufferSize=%d level=%d renderType=%s doubleBuffer=%d stereo=%d\n",
-+ attribs->bufferSize, attribs->level,
-+ visual_render_type_name(attribs->render_type),
-+ attribs->doubleBuffer, attribs->stereo);
-+ printf(" rgba: redSize=%d greenSize=%d blueSize=%d alphaSize=%d float=%c sRGB=%c\n",
-+ attribs->redSize, attribs->greenSize,
-+ attribs->blueSize, attribs->alphaSize,
-+ attribs->packedfloatComponents ? 'P' : attribs->floatComponents ? 'Y' : 'N',
-+ attribs->srgb ? 'Y' : 'N');
-+ printf(" auxBuffers=%d depthSize=%d stencilSize=%d\n",
-+ attribs->auxBuffers, attribs->depthSize, attribs->stencilSize);
-+ printf(" accum: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n",
-+ attribs->accumRedSize, attribs->accumGreenSize,
-+ attribs->accumBlueSize, attribs->accumAlphaSize);
-+ printf(" multiSample=%d multiSampleBuffers=%d\n",
-+ attribs->numSamples, attribs->numMultisample);
-+#ifdef GLX_EXT_visual_rating
-+ if (attribs->visualCaveat == GLX_NONE_EXT || attribs->visualCaveat == 0)
-+ printf(" visualCaveat=None\n");
-+ else if (attribs->visualCaveat == GLX_SLOW_VISUAL_EXT)
-+ printf(" visualCaveat=Slow\n");
-+ else if (attribs->visualCaveat == GLX_NON_CONFORMANT_VISUAL_EXT)
-+ printf(" visualCaveat=Nonconformant\n");
-+#endif
-+ if (attribs->transparentType == GLX_NONE) {
-+ printf(" Opaque.\n");
-+ }
-+ else if (attribs->transparentType == GLX_TRANSPARENT_RGB) {
-+ printf(" Transparent RGB: Red=%d Green=%d Blue=%d Alpha=%d\n",attribs->transparentRedValue,attribs->transparentGreenValue,attribs->transparentBlueValue,attribs->transparentAlphaValue);
-+ }
-+ else if (attribs->transparentType == GLX_TRANSPARENT_INDEX) {
-+ printf(" Transparent index=%d\n",attribs->transparentIndexValue);
-+ }
-+}
-+
-+
-+static void
-+print_visual_attribs_short_header(void)
-+{
-+ printf(" visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav\n");
-+ printf(" id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat\n");
-+ printf("----------------------------------------------------------------------------\n");
-+}
-+
-+
-+static void
-+print_visual_attribs_short(const struct visual_attribs *attribs)
-+{
-+ const char *caveat = caveat_string(attribs->visualCaveat);
-+
-+ printf("0x%03x %2d %2s %2d %3d %2d %c%c %c %c %2d %2d %2d %2d %c %c %2d %2d %2d",
-+ attribs->id,
-+ attribs->depth,
-+ visual_class_abbrev(attribs->klass),
-+ attribs->transparentType != GLX_NONE,
-+ attribs->bufferSize,
-+ attribs->level,
-+ (attribs->render_type & GLX_RGBA_BIT) ? 'r' : ' ',
-+ (attribs->render_type & GLX_COLOR_INDEX_BIT) ? 'c' : ' ',
-+ attribs->doubleBuffer ? 'y' : '.',
-+ attribs->stereo ? 'y' : '.',
-+ attribs->redSize, attribs->greenSize,
-+ attribs->blueSize, attribs->alphaSize,
-+ attribs->packedfloatComponents ? 'u' : attribs->floatComponents ? 'f' : '.',
-+ attribs->srgb ? 's' : '.',
-+ attribs->auxBuffers,
-+ attribs->depthSize,
-+ attribs->stencilSize
-+ );
-+
-+ printf(" %2d %2d %2d %2d %2d %1d %s\n",
-+ attribs->accumRedSize, attribs->accumGreenSize,
-+ attribs->accumBlueSize, attribs->accumAlphaSize,
-+ attribs->numSamples, attribs->numMultisample,
-+ caveat
-+ );
-+}
-+
-+
-+static void
-+print_visual_attribs_long_header(void)
-+{
-+ printf("Vis Vis Visual Trans buff lev render DB ste r g b a s aux dep ste accum buffer MS MS \n");
-+ printf(" ID Depth Type parent size el type reo sz sz sz sz flt rgb buf th ncl r g b a num bufs caveats\n");
-+ printf("--------------------------------------------------------------------------------------------------------------------\n");
-+}
-+
-+
-+static void
-+print_visual_attribs_long(const struct visual_attribs *attribs)
-+{
-+ const char *caveat = caveat_string(attribs->visualCaveat);
-+
-+ printf("0x%3x %2d %-11s %2d %3d %2d %4s %3d %3d %3d %3d %3d %3d",
-+ attribs->id,
-+ attribs->depth,
-+ visual_class_name(attribs->klass),
-+ attribs->transparentType != GLX_NONE,
-+ attribs->bufferSize,
-+ attribs->level,
-+ visual_render_type_name(attribs->render_type),
-+ attribs->doubleBuffer,
-+ attribs->stereo,
-+ attribs->redSize, attribs->greenSize,
-+ attribs->blueSize, attribs->alphaSize
-+ );
-+
-+ printf(" %c %c %3d %4d %2d %3d %3d %3d %3d %2d %2d %6s\n",
-+ attribs->floatComponents ? 'f' : '.',
-+ attribs->srgb ? 's' : '.',
-+ attribs->auxBuffers,
-+ attribs->depthSize,
-+ attribs->stencilSize,
-+ attribs->accumRedSize, attribs->accumGreenSize,
-+ attribs->accumBlueSize, attribs->accumAlphaSize,
-+ attribs->numSamples, attribs->numMultisample,
-+ caveat
-+ );
-+}
-+
-+
-+static void
-+print_visual_info(Display *dpy, int scrnum, InfoMode mode)
-+{
-+ XVisualInfo theTemplate;
-+ XVisualInfo *visuals;
-+ int numVisuals, numGlxVisuals;
-+ long mask;
-+ int i;
-+ struct visual_attribs attribs;
-+
-+ /* get list of all visuals on this screen */
-+ theTemplate.screen = scrnum;
-+ mask = VisualScreenMask;
-+ visuals = XGetVisualInfo(dpy, mask, &theTemplate, &numVisuals);
-+
-+ numGlxVisuals = 0;
-+ for (i = 0; i < numVisuals; i++) {
-+ if (get_visual_attribs(dpy, &visuals[i], &attribs))
-+ numGlxVisuals++;
-+ }
-+
-+ if (numGlxVisuals == 0)
-+ return;
-+
-+ printf("%d GLX Visuals\n", numGlxVisuals);
-+
-+ if (mode == Normal)
-+ print_visual_attribs_short_header();
-+ else if (mode == Wide)
-+ print_visual_attribs_long_header();
-+
-+ for (i = 0; i < numVisuals; i++) {
-+ if (!get_visual_attribs(dpy, &visuals[i], &attribs))
-+ continue;
-+
-+ if (mode == Verbose)
-+ print_visual_attribs_verbose(&attribs, False);
-+ else if (mode == Normal)
-+ print_visual_attribs_short(&attribs);
-+ else if (mode == Wide)
-+ print_visual_attribs_long(&attribs);
-+ }
-+ printf("\n");
-+
-+ XFree(visuals);
-+}
-+
-+#ifdef GLX_VERSION_1_3
-+
-+static void
-+print_fbconfig_info(Display *dpy, int scrnum, InfoMode mode)
-+{
-+ int numFBConfigs = 0;
-+ struct visual_attribs attribs;
-+ GLXFBConfig *fbconfigs;
-+ int i;
-+
-+ /* get list of all fbconfigs on this screen */
-+ fbconfigs = glXGetFBConfigs(dpy, scrnum, &numFBConfigs);
-+
-+ if (numFBConfigs == 0) {
-+ XFree(fbconfigs);
-+ return;
-+ }
-+
-+ printf("%d GLXFBConfigs:\n", numFBConfigs);
-+ if (mode == Normal)
-+ print_visual_attribs_short_header();
-+ else if (mode == Wide)
-+ print_visual_attribs_long_header();
-+
-+ for (i = 0; i < numFBConfigs; i++) {
-+ get_fbconfig_attribs(dpy, fbconfigs[i], &attribs);
-+
-+ if (mode == Verbose)
-+ print_visual_attribs_verbose(&attribs, True);
-+ else if (mode == Normal)
-+ print_visual_attribs_short(&attribs);
-+ else if (mode == Wide)
-+ print_visual_attribs_long(&attribs);
-+ }
-+ printf("\n");
-+
-+ XFree(fbconfigs);
-+}
-+
-+#endif
-+
-+/*
-+ * Stand-alone Mesa doesn't really implement the GLX protocol so it
-+ * doesn't really know the GLX attributes associated with an X visual.
-+ * The first time a visual is presented to Mesa's pseudo-GLX it
-+ * attaches ancilliary buffers to it (like depth and stencil).
-+ * But that usually only works if glXChooseVisual is used.
-+ * This function calls glXChooseVisual() to sort of "prime the pump"
-+ * for Mesa's GLX so that the visuals that get reported actually
-+ * reflect what applications will see.
-+ * This has no effect when using true GLX.
-+ */
-+static void
-+mesa_hack(Display *dpy, int scrnum)
-+{
-+ static int attribs[] = {
-+ GLX_RGBA,
-+ GLX_RED_SIZE, 1,
-+ GLX_GREEN_SIZE, 1,
-+ GLX_BLUE_SIZE, 1,
-+ GLX_DEPTH_SIZE, 1,
-+ GLX_STENCIL_SIZE, 1,
-+ GLX_ACCUM_RED_SIZE, 1,
-+ GLX_ACCUM_GREEN_SIZE, 1,
-+ GLX_ACCUM_BLUE_SIZE, 1,
-+ GLX_ACCUM_ALPHA_SIZE, 1,
-+ GLX_DOUBLEBUFFER,
-+ None
-+ };
-+ XVisualInfo *visinfo;
-+
-+ visinfo = glXChooseVisual(dpy, scrnum, attribs);
-+ if (visinfo)
-+ XFree(visinfo);
-+}
-+
-+
-+/*
-+ * Examine all visuals to find the so-called best one.
-+ * We prefer deepest RGBA buffer with depth, stencil and accum
-+ * that has no caveats.
-+ */
-+static int
-+find_best_visual(Display *dpy, int scrnum)
-+{
-+ XVisualInfo theTemplate;
-+ XVisualInfo *visuals;
-+ int numVisuals;
-+ long mask;
-+ int i;
-+ struct visual_attribs bestVis;
-+
-+ /* get list of all visuals on this screen */
-+ theTemplate.screen = scrnum;
-+ mask = VisualScreenMask;
-+ visuals = XGetVisualInfo(dpy, mask, &theTemplate, &numVisuals);
-+
-+ /* init bestVis with first visual info */
-+ get_visual_attribs(dpy, &visuals[0], &bestVis);
-+
-+ /* try to find a "better" visual */
-+ for (i = 1; i < numVisuals; i++) {
-+ struct visual_attribs vis;
-+
-+ get_visual_attribs(dpy, &visuals[i], &vis);
-+
-+ /* always skip visuals with caveats */
-+ if (vis.visualCaveat != GLX_NONE_EXT)
-+ continue;
-+
-+ /* see if this vis is better than bestVis */
-+ if ((!bestVis.supportsGL && vis.supportsGL) ||
-+ (bestVis.visualCaveat != GLX_NONE_EXT) ||
-+ (!(bestVis.render_type & GLX_RGBA_BIT) && (vis.render_type & GLX_RGBA_BIT)) ||
-+ (!bestVis.doubleBuffer && vis.doubleBuffer) ||
-+ (bestVis.redSize < vis.redSize) ||
-+ (bestVis.greenSize < vis.greenSize) ||
-+ (bestVis.blueSize < vis.blueSize) ||
-+ (bestVis.alphaSize < vis.alphaSize) ||
-+ (bestVis.depthSize < vis.depthSize) ||
-+ (bestVis.stencilSize < vis.stencilSize) ||
-+ (bestVis.accumRedSize < vis.accumRedSize)) {
-+ /* found a better visual */
-+ bestVis = vis;
-+ }
-+ }
-+
-+ XFree(visuals);
-+
-+ return bestVis.id;
-+}
-+
-+
-+int
-+main(int argc, char *argv[])
-+{
-+ Display *dpy;
-+ int numScreens, scrnum;
-+ struct options opts;
-+ Bool coreWorked;
-+
-+ parse_args(argc, argv, &opts);
-+
-+ dpy = XOpenDisplay(opts.displayName);
-+ if (!dpy) {
-+ fprintf(stderr, "Error: unable to open display %s\n",
-+ XDisplayName(opts.displayName));
-+ return -1;
-+ }
-+
-+ if (opts.findBest) {
-+ int b;
-+ mesa_hack(dpy, 0);
-+ b = find_best_visual(dpy, 0);
-+ printf("%d\n", b);
-+ }
-+ else {
-+ numScreens = ScreenCount(dpy);
-+ print_display_info(dpy);
-+ for (scrnum = 0; scrnum < numScreens; scrnum++) {
-+ mesa_hack(dpy, scrnum);
-+ coreWorked = print_screen_info(dpy, scrnum, &opts,
-+ True, False, opts.limits, False);
-+ print_screen_info(dpy, scrnum, &opts, False, False,
-+ opts.limits, coreWorked);
-+ print_screen_info(dpy, scrnum, &opts, False, True, False, True);
-+
-+ printf("\n");
-+
-+ if (opts.mode != Brief) {
-+ print_visual_info(dpy, scrnum, opts.mode);
-+#ifdef GLX_VERSION_1_3
-+ print_fbconfig_info(dpy, scrnum, opts.mode);
-+#endif
-+ }
-+
-+ if (scrnum + 1 < numScreens)
-+ printf("\n\n");
-+ }
-+ }
-+
-+ XCloseDisplay(dpy);
-+
-+ return 0;
-+}
-diff -Naurp mesa-20.2.1-orig/src/glx/xdemos/meson.build mesa-20.2.1/src/glx/xdemos/meson.build
---- mesa-20.2.1-orig/src/glx/xdemos/meson.build 1969-12-31 18:00:00.000000000 -0600
-+++ mesa-20.2.1/src/glx/xdemos/meson.build 2020-10-15 23:07:14.486696790 -0500
-@@ -0,0 +1,32 @@
-+inc_xdemos = include_directories('.')
-+
-+glxinfo_files = files(
-+ 'glxinfo.c',
-+ 'glinfo_common.c',
-+)
-+
-+x11_dep = dependency('x11', required: true)
-+
-+executable('glxinfo', glxinfo_files,
-+ install : true,
-+ #c_args : gl_lib_cargs,
-+ link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl, '-lm'],
-+ link_with : libgl,
-+ include_directories : [ inc_src, inc_include, inc_mesa, inc_glx],
-+ dependencies : [x11_dep]
-+)
-+
-+executable('glxgears', 'glxgears.c',
-+ install : true,
-+ #c_args : gl_lib_cargs,
-+ link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl, '-lm'],
-+ link_with : libgl,
-+ include_directories : [inc_src, inc_include, inc_mesa, inc_glx],
-+ dependencies : [x11_dep]
-+)
-+
-+man_dir = get_option('prefix') + '/share/man/man1'
-+install_data(['glxinfo.1', 'glxgears.1'],
-+ install_dir : man_dir
-+)
-+
diff --git a/repo/mesa/mesa-21.3.7-nouveau_fixes-1.patch b/repo/mesa/mesa-21.3.7-nouveau_fixes-1.patch
deleted file mode 100644
index ecf6008..0000000
--- a/repo/mesa/mesa-21.3.7-nouveau_fixes-1.patch
+++ /dev/null
@@ -1,2878 +0,0 @@
-Submitted By: Douglas R. Reno <renodr at linuxfromscratch dot org>
-Date: 2022-02-11
-Initial Package Version: 21.3.6
-Upstream Status: Merge Request (Partial), Self
-Origin: Upstream MR (#10752) with modifications
-Description: Fixes several multi-threading related issues in the
- Nouveau driver in Mesa. These issues can lead to
- kernel panics and application crashes, and also cause
- KDE Plasma in Wayland mode to instantly crash the system
- once launched on a NVC0 or later card (NV50 is
- unaffected). My changes include additional PUSH commands
- to fix timing issues, which will be picked up upstream
- shortly. Tested with KDE Plasma/Wayland, GNOME, VLC,
- MPlayer, Minecraft, Discord, Zoom, XINE, and Kdenlive.
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_buffer.c mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_buffer.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_buffer.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_buffer.c 2022-02-11 16:51:08.220134863 -0600
-@@ -91,12 +91,8 @@ nouveau_buffer_release_gpu_storage(struc
- {
- assert(!(buf->status & NOUVEAU_BUFFER_STATUS_USER_PTR));
-
-- if (buf->fence && buf->fence->state < NOUVEAU_FENCE_STATE_FLUSHED) {
-- nouveau_fence_work(buf->fence, nouveau_fence_unref_bo, buf->bo);
-- buf->bo = NULL;
-- } else {
-- nouveau_bo_ref(NULL, &buf->bo);
-- }
-+ nouveau_fence_work(buf->fence, nouveau_fence_unref_bo, buf->bo);
-+ buf->bo = NULL;
-
- if (buf->mm)
- release_allocation(&buf->mm, buf->fence);
-@@ -172,7 +168,7 @@ nouveau_transfer_staging(struct nouveau_
- nouveau_mm_allocate(nv->screen->mm_GART, size, &tx->bo, &tx->offset);
- if (tx->bo) {
- tx->offset += adj;
-- if (!nouveau_bo_map(tx->bo, 0, NULL))
-+ if (!BO_MAP(nv->screen, tx->bo, 0, NULL))
- tx->map = (uint8_t *)tx->bo->map + tx->offset;
- }
- }
-@@ -195,7 +191,7 @@ nouveau_transfer_read(struct nouveau_con
- nv->copy_data(nv, tx->bo, tx->offset, NOUVEAU_BO_GART,
- buf->bo, buf->offset + base, buf->domain, size);
-
-- if (nouveau_bo_wait(tx->bo, NOUVEAU_BO_RD, nv->client))
-+ if (BO_WAIT(nv->screen, tx->bo, NOUVEAU_BO_RD, nv->client))
- return false;
-
- if (buf->data)
-@@ -233,8 +229,8 @@ nouveau_transfer_write(struct nouveau_co
- else
- nv->push_data(nv, buf->bo, buf->offset + base, buf->domain, size, data);
-
-- nouveau_fence_ref(nv->screen->fence.current, &buf->fence);
-- nouveau_fence_ref(nv->screen->fence.current, &buf->fence_wr);
-+ nouveau_fence_ref(nv->fence, &buf->fence);
-+ nouveau_fence_ref(nv->fence, &buf->fence_wr);
- }
-
- /* Does a CPU wait for the buffer's backing data to become reliably accessible
-@@ -303,10 +299,9 @@ nouveau_buffer_transfer_del(struct nouve
- {
- if (tx->map) {
- if (likely(tx->bo)) {
-- nouveau_fence_work(nv->screen->fence.current,
-- nouveau_fence_unref_bo, tx->bo);
-+ nouveau_fence_work(nv->fence, nouveau_fence_unref_bo, tx->bo);
- if (tx->mm)
-- release_allocation(&tx->mm, nv->screen->fence.current);
-+ release_allocation(&tx->mm, nv->fence);
- } else {
- align_free(tx->map -
- (tx->base.box.x & NOUVEAU_MIN_BUFFER_MAP_ALIGN_MASK));
-@@ -475,9 +470,9 @@ nouveau_buffer_transfer_map(struct pipe_
- * wait on the whole slab and instead use the logic below to return a
- * reasonable buffer for that case.
- */
-- ret = nouveau_bo_map(buf->bo,
-- buf->mm ? 0 : nouveau_screen_transfer_flags(usage),
-- nv->client);
-+ ret = BO_MAP(nv->screen, buf->bo,
-+ buf->mm ? 0 : nouveau_screen_transfer_flags(usage),
-+ nv->client);
- if (ret) {
- FREE(tx);
- return NULL;
-@@ -601,11 +596,11 @@ nouveau_copy_buffer(struct nouveau_conte
- src->bo, src->offset + srcx, src->domain, size);
-
- dst->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
-- nouveau_fence_ref(nv->screen->fence.current, &dst->fence);
-- nouveau_fence_ref(nv->screen->fence.current, &dst->fence_wr);
-+ nouveau_fence_ref(nv->fence, &dst->fence);
-+ nouveau_fence_ref(nv->fence, &dst->fence_wr);
-
- src->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
-- nouveau_fence_ref(nv->screen->fence.current, &src->fence);
-+ nouveau_fence_ref(nv->fence, &src->fence);
- } else {
- struct pipe_box src_box;
- src_box.x = srcx;
-@@ -643,10 +638,10 @@ nouveau_resource_map_offset(struct nouve
- unsigned rw;
- rw = (flags & NOUVEAU_BO_WR) ? PIPE_MAP_WRITE : PIPE_MAP_READ;
- nouveau_buffer_sync(nv, res, rw);
-- if (nouveau_bo_map(res->bo, 0, NULL))
-+ if (BO_MAP(nv->screen, res->bo, 0, NULL))
- return NULL;
- } else {
-- if (nouveau_bo_map(res->bo, flags, nv->client))
-+ if (BO_MAP(nv->screen, res->bo, flags, nv->client))
- return NULL;
- }
- return (uint8_t *)res->bo->map + res->offset + offset;
-@@ -802,7 +797,7 @@ nouveau_buffer_data_fetch(struct nouveau
- {
- if (!nouveau_buffer_malloc(buf))
- return false;
-- if (nouveau_bo_map(bo, NOUVEAU_BO_RD, nv->client))
-+ if (BO_MAP(nv->screen, bo, NOUVEAU_BO_RD, nv->client))
- return false;
- memcpy(buf->data, (uint8_t *)bo->map + offset, size);
- return true;
-@@ -827,7 +822,7 @@ nouveau_buffer_migrate(struct nouveau_co
- if (new_domain == NOUVEAU_BO_GART && old_domain == 0) {
- if (!nouveau_buffer_allocate(screen, buf, new_domain))
- return false;
-- ret = nouveau_bo_map(buf->bo, 0, nv->client);
-+ ret = BO_MAP(nv->screen, buf->bo, 0, nv->client);
- if (ret)
- return ret;
- memcpy((uint8_t *)buf->bo->map + buf->offset, buf->data, size);
-@@ -853,9 +848,9 @@ nouveau_buffer_migrate(struct nouveau_co
- nv->copy_data(nv, buf->bo, buf->offset, new_domain,
- bo, offset, old_domain, buf->base.width0);
-
-- nouveau_fence_work(screen->fence.current, nouveau_fence_unref_bo, bo);
-+ nouveau_fence_work(nv->fence, nouveau_fence_unref_bo, bo);
- if (mm)
-- release_allocation(&mm, screen->fence.current);
-+ release_allocation(&mm, nv->fence);
- } else
- if (new_domain == NOUVEAU_BO_VRAM && old_domain == 0) {
- struct nouveau_transfer tx;
-@@ -897,7 +892,7 @@ nouveau_user_buffer_upload(struct nouvea
- if (!nouveau_buffer_reallocate(screen, buf, NOUVEAU_BO_GART))
- return false;
-
-- ret = nouveau_bo_map(buf->bo, 0, nv->client);
-+ ret = BO_MAP(nv->screen, buf->bo, 0, nv->client);
- if (ret)
- return false;
- memcpy((uint8_t *)buf->bo->map + buf->offset + base, buf->data + base, size);
-@@ -964,7 +959,7 @@ nouveau_scratch_runout_release(struct no
- if (!nv->scratch.runout)
- return;
-
-- if (!nouveau_fence_work(nv->screen->fence.current, nouveau_scratch_unref_bos,
-+ if (!nouveau_fence_work(nv->fence, nouveau_scratch_unref_bos,
- nv->scratch.runout))
- return;
-
-@@ -993,7 +988,7 @@ nouveau_scratch_runout(struct nouveau_co
-
- ret = nouveau_scratch_bo_alloc(nv, &nv->scratch.runout->bo[n], size);
- if (!ret) {
-- ret = nouveau_bo_map(nv->scratch.runout->bo[n], 0, NULL);
-+ ret = BO_MAP(nv->screen, nv->scratch.runout->bo[n], 0, NULL);
- if (ret)
- nouveau_bo_ref(NULL, &nv->scratch.runout->bo[--nv->scratch.runout->nr]);
- }
-@@ -1031,7 +1026,7 @@ nouveau_scratch_next(struct nouveau_cont
- nv->scratch.offset = 0;
- nv->scratch.end = nv->scratch.bo_size;
-
-- ret = nouveau_bo_map(bo, NOUVEAU_BO_WR, nv->client);
-+ ret = BO_MAP(nv->screen, bo, NOUVEAU_BO_WR, nv->client);
- if (!ret)
- nv->scratch.map = bo->map;
- return !ret;
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_context.h mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_context.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_context.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_context.h 2022-02-11 16:51:52.682577582 -0600
-@@ -15,6 +15,7 @@ struct nouveau_context {
-
- struct nouveau_client *client;
- struct nouveau_pushbuf *pushbuf;
-+ struct nouveau_fence *fence;
- struct pipe_debug_callback debug;
-
- bool vbo_dirty;
-@@ -66,7 +67,7 @@ void
- nouveau_context_init_vdec(struct nouveau_context *);
-
- void
--nouveau_context_init(struct nouveau_context *);
-+nouveau_context_init(struct nouveau_context *, struct nouveau_screen *);
-
- void
- nouveau_scratch_runout_release(struct nouveau_context *);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_fence.c mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_fence.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_fence.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_fence.c 2022-02-11 17:03:39.714131948 -0600
-@@ -21,6 +21,7 @@
- */
-
- #include "nouveau_screen.h"
-+#include "nouveau_context.h"
- #include "nouveau_winsys.h"
- #include "nouveau_fence.h"
- #include "util/os_time.h"
-@@ -30,13 +31,14 @@
- #endif
-
- bool
--nouveau_fence_new(struct nouveau_screen *screen, struct nouveau_fence **fence)
-+nouveau_fence_new(struct nouveau_context *nv, struct nouveau_fence **fence)
- {
- *fence = CALLOC_STRUCT(nouveau_fence);
- if (!*fence)
- return false;
-
-- (*fence)->screen = screen;
-+ (*fence)->screen = nv->screen;
-+ (*fence)->context = nv;
- (*fence)->ref = 1;
- list_inithead(&(*fence)->work);
-
-@@ -59,22 +61,25 @@ void
- nouveau_fence_emit(struct nouveau_fence *fence)
- {
- struct nouveau_screen *screen = fence->screen;
-+ struct nouveau_fence_list *fence_list = &screen->fence;
-
-- assert(fence->state == NOUVEAU_FENCE_STATE_AVAILABLE);
-+ assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
-+ if (fence->state >= NOUVEAU_FENCE_STATE_EMITTED)
-+ return;
-
- /* set this now, so that if fence.emit triggers a flush we don't recurse */
- fence->state = NOUVEAU_FENCE_STATE_EMITTING;
-
- ++fence->ref;
-
-- if (screen->fence.tail)
-- screen->fence.tail->next = fence;
-+ if (fence_list->tail)
-+ fence_list->tail->next = fence;
- else
-- screen->fence.head = fence;
-+ fence_list->head = fence;
-
-- screen->fence.tail = fence;
-+ fence_list->tail = fence;
-
-- screen->fence.emit(&screen->base, &fence->sequence);
-+ fence_list->emit(&screen->base, &fence->sequence);
-
- assert(fence->state == NOUVEAU_FENCE_STATE_EMITTING);
- fence->state = NOUVEAU_FENCE_STATE_EMITTED;
-@@ -84,19 +89,19 @@ void
- nouveau_fence_del(struct nouveau_fence *fence)
- {
- struct nouveau_fence *it;
-- struct nouveau_screen *screen = fence->screen;
-+ struct nouveau_fence_list *fence_list = &fence->screen->fence;
-
- if (fence->state == NOUVEAU_FENCE_STATE_EMITTED ||
- fence->state == NOUVEAU_FENCE_STATE_FLUSHED) {
-- if (fence == screen->fence.head) {
-- screen->fence.head = fence->next;
-- if (!screen->fence.head)
-- screen->fence.tail = NULL;
-+ if (fence == fence_list->head) {
-+ fence_list->head = fence->next;
-+ if (!fence_list->head)
-+ fence_list->tail = NULL;
- } else {
-- for (it = screen->fence.head; it && it->next != fence; it = it->next);
-+ for (it = fence_list->head; it && it->next != fence; it = it->next);
- it->next = fence->next;
-- if (screen->fence.tail == fence)
-- screen->fence.tail = it;
-+ if (fence_list->tail == fence)
-+ fence_list->tail = it;
- }
- }
-
-@@ -109,18 +114,19 @@ nouveau_fence_del(struct nouveau_fence *
- }
-
- void
--nouveau_fence_cleanup(struct nouveau_screen *screen)
-+nouveau_fence_cleanup(struct nouveau_context *nv)
- {
-- if (screen->fence.current) {
-+ struct nouveau_fence_list *fence_list = &nv->screen->fence;
-+ if (nv->fence) {
- struct nouveau_fence *current = NULL;
-
- /* nouveau_fence_wait will create a new current fence, so wait on the
- * _current_ one, and remove both.
- */
-- nouveau_fence_ref(screen->fence.current, &current);
-+ nouveau_fence_ref(nv->fence, &current);
- nouveau_fence_wait(current, NULL);
- nouveau_fence_ref(NULL, &current);
-- nouveau_fence_ref(NULL, &screen->fence.current);
-+ nouveau_fence_ref(NULL, &nv->fence);
- }
- }
-
-@@ -129,13 +135,14 @@ nouveau_fence_update(struct nouveau_scre
- {
- struct nouveau_fence *fence;
- struct nouveau_fence *next = NULL;
-- u32 sequence = screen->fence.update(&screen->base);
-+ struct nouveau_fence_list *fence_list = &screen->fence;
-+ u32 sequence = fence_list->update(&screen->base);
-
-- if (screen->fence.sequence_ack == sequence)
-+ if (fence_list->sequence_ack == sequence)
- return;
-- screen->fence.sequence_ack = sequence;
-+ fence_list->sequence_ack = sequence;
-
-- for (fence = screen->fence.head; fence; fence = next) {
-+ for (fence = fence_list->head; fence; fence = next) {
- next = fence->next;
- sequence = fence->sequence;
-
-@@ -144,12 +151,12 @@ nouveau_fence_update(struct nouveau_scre
- nouveau_fence_trigger_work(fence);
- nouveau_fence_ref(NULL, &fence);
-
-- if (sequence == screen->fence.sequence_ack)
-+ if (sequence == fence_list->sequence_ack)
- break;
- }
-- screen->fence.head = next;
-+ fence_list->head = next;
- if (!next)
-- screen->fence.tail = NULL;
-+ fence_list->tail = NULL;
-
- if (flushed) {
- for (fence = next; fence; fence = fence->next)
-@@ -178,25 +185,23 @@ static bool
- nouveau_fence_kick(struct nouveau_fence *fence)
- {
- struct nouveau_screen *screen = fence->screen;
-+ struct nouveau_fence_list *fence_list = &screen->fence;
-+ bool current = !fence->sequence;
-
- /* wtf, someone is waiting on a fence in flush_notify handler? */
- assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
-
- if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
- PUSH_SPACE(screen->pushbuf, 8);
-- /* The space allocation might trigger a flush, which could emit the
-- * current fence. So check again.
-- */
-- if (fence->state < NOUVEAU_FENCE_STATE_EMITTED)
-- nouveau_fence_emit(fence);
-+ nouveau_fence_emit(fence);
- }
-
- if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
- if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel))
- return false;
-
-- if (fence == screen->fence.current)
-- nouveau_fence_next(screen);
-+ if (current)
-+ nouveau_fence_next(fence->context);
-
- nouveau_fence_update(screen, false);
-
-@@ -207,6 +212,7 @@ bool
- nouveau_fence_wait(struct nouveau_fence *fence, struct pipe_debug_callback *debug)
- {
- struct nouveau_screen *screen = fence->screen;
-+ struct nouveau_fence_list *fence_list = &screen->fence;
- uint32_t spins = 0;
- int64_t start = 0;
-
-@@ -237,24 +243,26 @@ nouveau_fence_wait(struct nouveau_fence
-
- debug_printf("Wait on fence %u (ack = %u, next = %u) timed out !\n",
- fence->sequence,
-- screen->fence.sequence_ack, screen->fence.sequence);
-+ fence_list->sequence_ack, fence_list->sequence);
-
- return false;
- }
-
- void
--nouveau_fence_next(struct nouveau_screen *screen)
-+nouveau_fence_next(struct nouveau_context *nv)
- {
-- if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTING) {
-- if (screen->fence.current->ref > 1)
-- nouveau_fence_emit(screen->fence.current);
-+ struct nouveau_fence_list *fence_list = &nv->screen->fence;
-+
-+ if (nv->fence->state < NOUVEAU_FENCE_STATE_EMITTING) {
-+ if (nv->fence->ref > 1)
-+ nouveau_fence_emit(nv->fence);
- else
- return;
- }
-
-- nouveau_fence_ref(NULL, &screen->fence.current);
-+ nouveau_fence_ref(NULL, &nv->fence);
-
-- nouveau_fence_new(screen, &screen->fence.current);
-+ nouveau_fence_new(nv, &nv->fence);
- }
-
- void
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_fence.h mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_fence.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_fence.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_fence.h 2022-02-11 17:06:52.375811111 -0600
-@@ -22,6 +22,7 @@ struct nouveau_fence_work {
- struct nouveau_fence {
- struct nouveau_fence *next;
- struct nouveau_screen *screen;
-+ struct nouveau_context *context;
- int state;
- int ref;
- uint32_t sequence;
-@@ -29,14 +30,23 @@ struct nouveau_fence {
- struct list_head work;
- };
-
-+struct nouveau_fence_list {
-+ struct nouveau_fence *head;
-+ struct nouveau_fence *tail;
-+ uint32_t sequence;
-+ uint32_t sequence_ack;
-+ void (*emit)(struct pipe_screen *, uint32_t *sequence);
-+ uint32_t (*update)(struct pipe_screen *);
-+};
-+
- void nouveau_fence_emit(struct nouveau_fence *);
- void nouveau_fence_del(struct nouveau_fence *);
-
--bool nouveau_fence_new(struct nouveau_screen *, struct nouveau_fence **);
--void nouveau_fence_cleanup(struct nouveau_screen *);
-+bool nouveau_fence_new(struct nouveau_context *, struct nouveau_fence **);
-+void nouveau_fence_cleanup(struct nouveau_context *);
- bool nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *);
- void nouveau_fence_update(struct nouveau_screen *, bool flushed);
--void nouveau_fence_next(struct nouveau_screen *);
-+void nouveau_fence_next(struct nouveau_context *);
- bool nouveau_fence_wait(struct nouveau_fence *, struct pipe_debug_callback *);
- bool nouveau_fence_signalled(struct nouveau_fence *);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_mm.c mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_mm.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_mm.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_mm.c 2022-02-11 17:09:55.188637737 -0600
-@@ -1,6 +1,7 @@
-
- #include <inttypes.h>
-
-+#include "util/simple_mtx.h"
- #include "util/u_inlines.h"
- #include "util/u_memory.h"
- #include "util/list.h"
-@@ -29,6 +30,7 @@ struct mm_bucket {
- struct list_head used;
- struct list_head full;
- int num_free;
-+ simple_mtx_t lock;
- };
-
- struct nouveau_mman {
-@@ -124,6 +126,8 @@ mm_slab_new(struct nouveau_mman *cache,
- int words, ret;
- const uint32_t size = mm_default_slab_size(chunk_order);
-
-+ simple_mtx_assert_locked(&bucket->lock);
-+
- words = ((size >> chunk_order) + 31) / 32;
- assert(words);
-
-@@ -151,7 +155,7 @@ mm_slab_new(struct nouveau_mman *cache,
- assert(bucket == mm_bucket_by_order(cache, chunk_order));
- list_add(&slab->head, &bucket->free);
-
-- cache->allocated += size;
-+ p_atomic_add(&cache->allocated, size);
-
- if (nouveau_mesa_debug)
- debug_printf("MM: new slab, total memory = %"PRIu64" KiB\n",
-@@ -182,6 +186,11 @@ nouveau_mm_allocate(struct nouveau_mman
- return NULL;
- }
-
-+ alloc = MALLOC_STRUCT(nouveau_mm_allocation);
-+ if (!alloc)
-+ return NULL;
-+
-+ simple_mtx_lock(&bucket->lock);
- if (!list_is_empty(&bucket->used)) {
- slab = LIST_ENTRY(struct mm_slab, bucket->used.next, head);
- } else {
-@@ -196,16 +205,13 @@ nouveau_mm_allocate(struct nouveau_mman
-
- *offset = mm_slab_alloc(slab) << slab->order;
-
-- alloc = MALLOC_STRUCT(nouveau_mm_allocation);
-- if (!alloc)
-- return NULL;
--
- nouveau_bo_ref(slab->bo, bo);
-
- if (slab->free == 0) {
- list_del(&slab->head);
- list_add(&slab->head, &bucket->full);
- }
-+ simple_mtx_unlock(&bucket->lock);
-
- alloc->offset = *offset;
- alloc->priv = (void *)slab;
-@@ -229,6 +235,7 @@ nouveau_mm_free(struct nouveau_mm_alloca
- list_del(&slab->head);
- list_addtail(&slab->head, &bucket->used);
- }
-+ simple_mtx_unlock(&bucket->lock);
-
- FREE(alloc);
- }
-@@ -258,6 +265,7 @@ nouveau_mm_create(struct nouveau_device
- list_inithead(&cache->bucket[i].free);
- list_inithead(&cache->bucket[i].used);
- list_inithead(&cache->bucket[i].full);
-+ simple_mtx_init(&cache->bucket[i].lock, mtx_plain);
- }
-
- return cache;
-@@ -292,6 +300,7 @@ nouveau_mm_destroy(struct nouveau_mman *
- nouveau_mm_free_slabs(&cache->bucket[i].free);
- nouveau_mm_free_slabs(&cache->bucket[i].used);
- nouveau_mm_free_slabs(&cache->bucket[i].full);
-+ simple_mtx_destroy(&cache->bucket[i].lock);
- }
-
- FREE(cache);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_screen.c mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_screen.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_screen.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_screen.c 2022-02-11 17:11:30.951045828 -0600
-@@ -394,7 +394,11 @@ nouveau_set_debug_callback(struct pipe_c
- }
-
- void
--nouveau_context_init(struct nouveau_context *context)
-+nouveau_context_init(struct nouveau_context *context, struct nouveau_screen *screen)
- {
- context->pipe.set_debug_callback = nouveau_set_debug_callback;
-+
-+ context->screen = screen;
-+ context->client = screen->client;
-+ context->pushbuf = screen->pushbuf;
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_screen.h mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_screen.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_screen.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_screen.h 2022-02-11 17:12:22.999729379 -0600
-@@ -6,6 +6,8 @@
- #include "util/u_atomic.h"
- #include "util/u_memory.h"
-
-+#include "nouveau_fence.h"
-+
- #ifndef NDEBUG
- # define NOUVEAU_ENABLE_DRIVER_STATISTICS
- #endif
-@@ -44,15 +46,7 @@ struct nouveau_screen {
-
- uint16_t class_3d;
-
-- struct {
-- struct nouveau_fence *head;
-- struct nouveau_fence *tail;
-- struct nouveau_fence *current;
-- u32 sequence;
-- u32 sequence_ack;
-- void (*emit)(struct pipe_screen *, u32 *sequence);
-- u32 (*update)(struct pipe_screen *);
-- } fence;
-+ struct nouveau_fence_list fence;
-
- struct nouveau_mman *mm_VRAM;
- struct nouveau_mman *mm_GART;
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_video.c mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_video.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_video.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_video.c 2022-02-11 17:13:47.703221196 -0600
-@@ -37,12 +37,12 @@ nouveau_vpe_init(struct nouveau_decoder
- int ret;
- if (dec->cmds)
- return 0;
-- ret = nouveau_bo_map(dec->cmd_bo, NOUVEAU_BO_RDWR, dec->client);
-+ ret = BO_MAP(dec->screen, dec->cmd_bo, NOUVEAU_BO_RDWR, dec->client);
- if (ret) {
- debug_printf("Mapping cmd bo: %s\n", strerror(-ret));
- return ret;
- }
-- ret = nouveau_bo_map(dec->data_bo, NOUVEAU_BO_RDWR, dec->client);
-+ ret = BO_MAP(dec->screen, dec->data_bo, NOUVEAU_BO_RDWR, dec->client);
- if (ret) {
- debug_printf("Mapping data bo: %s\n", strerror(-ret));
- return ret;
-@@ -73,7 +73,7 @@ nouveau_vpe_fini(struct nouveau_decoder
- if (!dec->cmds)
- return;
-
-- nouveau_pushbuf_space(push, 16, 2, 0);
-+ PUSH_SPACE_EX(push, 16, 2, 0);
- nouveau_bufctx_reset(dec->bufctx, NV31_VIDEO_BIND_CMD);
-
- #define BCTX_ARGS dec->bufctx, NV31_VIDEO_BIND_CMD, NOUVEAU_BO_RD
-@@ -88,7 +88,7 @@ nouveau_vpe_fini(struct nouveau_decoder
-
- #undef BCTX_ARGS
-
-- if (unlikely(nouveau_pushbuf_validate(dec->push)))
-+ if (unlikely(PUSH_VAL(dec->push)))
- return;
-
- BEGIN_NV04(push, NV31_MPEG(EXEC), 1);
-@@ -582,13 +582,13 @@ nouveau_create_decoder(struct pipe_conte
- 0, 4096, NULL, &dec->fence_bo);
- if (ret)
- goto fail;
-- nouveau_bo_map(dec->fence_bo, NOUVEAU_BO_RDWR, NULL);
-+ BO_MAP(dec->fence_bo, NOUVEAU_BO_RDWR, NULL);
- dec->fence_map = dec->fence_bo->map;
- dec->fence_map[0] = 0;
- #endif
-
- nouveau_pushbuf_bufctx(dec->push, dec->bufctx);
-- nouveau_pushbuf_space(push, 32, 4, 0);
-+ PUSH_SPACE_EX(push, 32, 4, 0);
-
- BEGIN_NV04(push, SUBC_MPEG(NV01_SUBCHAN_OBJECT), 1);
- PUSH_DATA (push, dec->mpeg->handle);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_vp3_video.c mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_vp3_video.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_vp3_video.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_vp3_video.c 2022-02-11 17:14:38.549919717 -0600
-@@ -27,6 +27,7 @@
-
- #include <nvif/class.h>
-
-+#include "nouveau_winsys.h"
- #include "nouveau_screen.h"
- #include "nouveau_context.h"
- #include "nouveau_vp3_video.h"
-@@ -284,13 +285,14 @@ nouveau_vp3_load_firmware(struct nouveau
- char path[PATH_MAX];
- ssize_t r;
- uint32_t *end, endval;
-+ struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
-
- if (chipset >= 0xa3 && chipset != 0xaa && chipset != 0xac)
- vp4_getpath(profile, path);
- else
- vp3_getpath(profile, path);
-
-- if (nouveau_bo_map(dec->fw_bo, NOUVEAU_BO_WR, dec->client))
-+ if (BO_MAP(screen, dec->fw_bo, NOUVEAU_BO_WR, dec->client))
- return 1;
-
- fd = open(path, O_RDONLY | O_CLOEXEC);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_winsys.h mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_winsys.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nouveau_winsys.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nouveau_winsys.h 2022-02-11 17:17:15.566002822 -0600
-@@ -9,6 +9,8 @@
- #include "drm-uapi/drm.h"
- #include <nouveau.h>
-
-+#include "nouveau_screen.h"
-+
- #ifndef NV04_PFIFO_MAX_PACKET_LEN
- #define NV04_PFIFO_MAX_PACKET_LEN 2047
- #endif
-@@ -23,12 +25,18 @@ PUSH_AVAIL(struct nouveau_pushbuf *push)
- }
-
- static inline bool
-+PUSH_SPACE_EX(struct nouveau_pushbuf *push, uint32_t size, uint32_t relocs, uint32_t pushes)
-+{
-+ return nouveau_pushbuf_space(push, size, relocs, pushes) == 0;
-+}
-+
-+static inline bool
- PUSH_SPACE(struct nouveau_pushbuf *push, uint32_t size)
- {
- /* Provide a buffer so that fences always have room to be emitted */
- size += 8;
- if (PUSH_AVAIL(push) < size)
-- return nouveau_pushbuf_space(push, size, 0, 0) == 0;
-+ return PUSH_SPACE_EX(push, size, 0, 0);
- return true;
- }
-
-@@ -66,6 +74,23 @@ PUSH_KICK(struct nouveau_pushbuf *push)
- nouveau_pushbuf_kick(push, push->channel);
- }
-
-+static inline int
-+PUSH_VAL(struct nouveau_pushbuf *push)
-+{
-+ return nouveau_pushbuf_validate(push);
-+}
-+
-+static inline int
-+BO_MAP(struct nouveau_screen *screen, struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client)
-+{
-+ return nouveau_bo_map(bo, access, client);
-+}
-+
-+static inline int
-+BO_WAIT(struct nouveau_screen *screen, struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client)
-+{
-+ return nouveau_bo_wait(bo, access, client);
-+}
-
- #define NOUVEAU_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
- #define NOUVEAU_RESOURCE_FLAG_DRV_PRIV (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_clear.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_clear.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_clear.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_clear.c 2022-02-11 14:24:23.189190438 -0600
-@@ -128,7 +128,7 @@ nv30_clear_render_target(struct pipe_con
-
- refn.bo = mt->base.bo;
- refn.flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_WR;
-- if (nouveau_pushbuf_space(push, 32, 1, 0) ||
-+ if (!PUSH_SPACE_EX(push, 32, 1, 0) ||
- nouveau_pushbuf_refn (push, &refn, 1))
- return;
-
-@@ -193,7 +193,7 @@ nv30_clear_depth_stencil(struct pipe_con
-
- refn.bo = mt->base.bo;
- refn.flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_WR;
-- if (nouveau_pushbuf_space(push, 32, 1, 0) ||
-+ if (!PUSH_SPACE_EX(push, 32, 1, 0) ||
- nouveau_pushbuf_refn (push, &refn, 1))
- return;
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_context.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_context.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_context.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_context.c 2022-02-11 14:28:00.534301647 -0600
-@@ -45,7 +45,7 @@ nv30_context_kick_notify(struct nouveau_
- nv30 = container_of(push->user_priv, struct nv30_context, bufctx);
- screen = &nv30->screen->base;
-
-- nouveau_fence_next(screen);
-+ nouveau_fence_next(&nv30->base);
- nouveau_fence_update(screen, true);
-
- if (push->bufctx) {
-@@ -53,13 +53,13 @@ nv30_context_kick_notify(struct nouveau_
- LIST_FOR_EACH_ENTRY(bref, &push->bufctx->current, thead) {
- struct nv04_resource *res = bref->priv;
- if (res && res->mm) {
-- nouveau_fence_ref(screen->fence.current, &res->fence);
-+ nouveau_fence_ref(nv30->base.fence, &res->fence);
-
- if (bref->flags & NOUVEAU_BO_RD)
- res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
-
- if (bref->flags & NOUVEAU_BO_WR) {
-- nouveau_fence_ref(screen->fence.current, &res->fence_wr);
-+ nouveau_fence_ref(nv30->base.fence, &res->fence_wr);
- res->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING |
- NOUVEAU_BUFFER_STATUS_DIRTY;
- }
-@@ -76,7 +76,7 @@ nv30_context_flush(struct pipe_context *
- struct nouveau_pushbuf *push = nv30->base.pushbuf;
-
- if (fence)
-- nouveau_fence_ref(nv30->screen->base.fence.current,
-+ nouveau_fence_ref(nv30->base.fence,
- (struct nouveau_fence **)fence);
-
- PUSH_KICK(push);
-@@ -176,6 +176,7 @@ nv30_context_destroy(struct pipe_context
- if (nv30->screen->cur_ctx == nv30)
- nv30->screen->cur_ctx = NULL;
-
-+ nouveau_fence_cleanup(&nv30->base);
- nouveau_context_destroy(&nv30->base);
- }
-
-@@ -191,7 +192,6 @@ nv30_context_create(struct pipe_screen *
- {
- struct nv30_screen *screen = nv30_screen(pscreen);
- struct nv30_context *nv30 = CALLOC_STRUCT(nv30_context);
-- struct nouveau_pushbuf *push;
- struct pipe_context *pipe;
- int ret;
-
-@@ -199,7 +199,6 @@ nv30_context_create(struct pipe_screen *
- return NULL;
-
- nv30->screen = screen;
-- nv30->base.screen = &screen->base;
- nv30->base.copy_data = nv30_transfer_copy_data;
-
- pipe = &nv30->base.pipe;
-@@ -208,6 +207,9 @@ nv30_context_create(struct pipe_screen *
- pipe->destroy = nv30_context_destroy;
- pipe->flush = nv30_context_flush;
-
-+ nouveau_context_init(&nv30->base, &screen->base);
-+ nv30->base.pushbuf->kick_notify = nv30_context_kick_notify;
-+
- nv30->base.pipe.stream_uploader = u_upload_create_default(&nv30->base.pipe);
- if (!nv30->base.pipe.stream_uploader) {
- nv30_context_destroy(pipe);
-@@ -215,14 +217,6 @@ nv30_context_create(struct pipe_screen *
- }
- nv30->base.pipe.const_uploader = nv30->base.pipe.stream_uploader;
-
-- /*XXX: *cough* per-context client */
-- nv30->base.client = screen->base.client;
--
-- /*XXX: *cough* per-context pushbufs */
-- push = screen->base.pushbuf;
-- nv30->base.pushbuf = push;
-- push->kick_notify = nv30_context_kick_notify;
--
- nv30->base.invalidate_resource_storage = nv30_invalidate_resource_storage;
-
- ret = nouveau_bufctx_new(nv30->base.client, 64, &nv30->bufctx);
-@@ -244,7 +238,6 @@ nv30_context_create(struct pipe_screen *
- if (debug_get_bool_option("NV30_SWTNL", false))
- nv30->draw_flags |= NV30_NEW_SWTNL;
-
-- nouveau_context_init(&nv30->base);
- nv30->sample_mask = 0xffff;
- nv30_vbo_init(pipe);
- nv30_query_init(pipe);
-@@ -265,6 +258,7 @@ nv30_context_create(struct pipe_screen *
- }
-
- nouveau_context_init_vdec(&nv30->base);
-+ nouveau_fence_new(&nv30->base, &nv30->base.fence);
-
- return pipe;
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_draw.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_draw.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_draw.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_draw.c 2022-02-11 14:28:44.868118544 -0600
-@@ -124,7 +124,7 @@ nv30_render_draw_elements(struct vbuf_re
- {
- struct nv30_render *r = nv30_render(render);
- struct nv30_context *nv30 = r->nv30;
-- struct nouveau_pushbuf *push = nv30->screen->base.pushbuf;
-+ struct nouveau_pushbuf *push = nv30->base.pushbuf;
- unsigned i;
-
- BEGIN_NV04(push, NV30_3D(VTXBUF(0)), r->vertex_info.num_attribs);
-@@ -280,7 +280,7 @@ nv30_render_validate(struct nv30_context
- struct nv30_render *r = nv30_render(nv30->draw->render);
- struct nv30_rasterizer_stateobj *rast = nv30->rast;
- struct pipe_screen *pscreen = &nv30->screen->base.base;
-- struct nouveau_pushbuf *push = nv30->screen->base.pushbuf;
-+ struct nouveau_pushbuf *push = nv30->base.pushbuf;
- struct nouveau_object *eng3d = nv30->screen->eng3d;
- struct nv30_vertprog *vp = nv30->vertprog.program;
- struct vertex_info *vinfo = &r->vertex_info;
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_miptree.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_miptree.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_miptree.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_miptree.c 2022-02-11 14:29:22.740961717 -0600
-@@ -359,7 +359,7 @@ nv30_miptree_transfer_map(struct pipe_co
- if (usage & PIPE_MAP_WRITE)
- access |= NOUVEAU_BO_WR;
-
-- ret = nouveau_bo_map(tx->tmp.bo, access, nv30->base.client);
-+ ret = BO_MAP(nv30->base.screen, tx->tmp.bo, access, nv30->base.client);
- if (ret) {
- pipe_resource_reference(&tx->base.resource, NULL);
- FREE(tx);
-@@ -393,7 +393,7 @@ nv30_miptree_transfer_unmap(struct pipe_
- }
-
- /* Allow the copies above to finish executing before freeing the source */
-- nouveau_fence_work(nv30->screen->base.fence.current,
-+ nouveau_fence_work(nv30->base.fence,
- nouveau_fence_unref_bo, tx->tmp.bo);
- } else {
- nouveau_bo_ref(NULL, &tx->tmp.bo);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_screen.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_screen.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_screen.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_screen.c 2022-02-11 14:30:44.381622525 -0600
-@@ -508,8 +508,6 @@ nv30_screen_destroy(struct pipe_screen *
- if (!nouveau_drm_screen_unref(&screen->base))
- return;
-
-- nouveau_fence_cleanup(&screen->base);
--
- nouveau_bo_ref(NULL, &screen->notify);
-
- nouveau_heap_destroy(&screen->query_heap);
-@@ -684,7 +682,7 @@ nv30_screen_create(struct nouveau_device
-
- ret = nouveau_bo_wrap(screen->base.device, fifo->notify, &screen->notify);
- if (ret == 0)
-- ret = nouveau_bo_map(screen->notify, 0, screen->base.client);
-+ ret = BO_MAP(&screen->base, screen->notify, 0, screen->base.client);
- if (ret)
- FAIL_SCREEN_INIT("error mapping notifier memory: %d\n", ret);
-
-@@ -811,9 +809,7 @@ nv30_screen_create(struct nouveau_device
- PUSH_DATA (push, screen->ntfy->handle);
- BEGIN_NV04(push, NV05_SIFM(COLOR_CONVERSION), 1);
- PUSH_DATA (push, NV05_SIFM_COLOR_CONVERSION_TRUNCATE);
-+ PUSH_KICK (push);
-
-- nouveau_pushbuf_kick(push, push->channel);
--
-- nouveau_fence_new(&screen->base, &screen->base.fence.current);
- return &screen->base;
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c 2022-02-11 14:32:00.766303956 -0600
-@@ -463,7 +463,6 @@ nv30_state_context_switch(struct nv30_co
- bool
- nv30_state_validate(struct nv30_context *nv30, uint32_t mask, bool hwtnl)
- {
-- struct nouveau_screen *screen = &nv30->screen->base;
- struct nouveau_pushbuf *push = nv30->base.pushbuf;
- struct nouveau_bufctx *bctx = nv30->bufctx;
- struct nouveau_bufref *bref;
-@@ -499,7 +498,7 @@ nv30_state_validate(struct nv30_context
- }
-
- nouveau_pushbuf_bufctx(push, bctx);
-- if (nouveau_pushbuf_validate(push)) {
-+ if (PUSH_VAL(push)) {
- nouveau_pushbuf_bufctx(push, NULL);
- return false;
- }
-@@ -523,13 +522,13 @@ nv30_state_validate(struct nv30_context
- LIST_FOR_EACH_ENTRY(bref, &bctx->current, thead) {
- struct nv04_resource *res = bref->priv;
- if (res && res->mm) {
-- nouveau_fence_ref(screen->fence.current, &res->fence);
-+ nouveau_fence_ref(nv30->base.fence, &res->fence);
-
- if (bref->flags & NOUVEAU_BO_RD)
- res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
-
- if (bref->flags & NOUVEAU_BO_WR) {
-- nouveau_fence_ref(screen->fence.current, &res->fence_wr);
-+ nouveau_fence_ref(nv30->base.fence, &res->fence_wr);
- res->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
- }
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_transfer.c mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv30/nv30_transfer.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv30/nv30_transfer.c 2022-02-11 14:35:05.786902168 -0600
-@@ -155,7 +155,7 @@ nv30_transfer_rect_blit(XFER_ARGS)
- u32 texfmt, texswz;
- u32 format, stride;
-
-- if (nouveau_pushbuf_space(push, 512, 8, 0) ||
-+ if (!PUSH_SPACE_EX(push, 512, 8, 0) ||
- nouveau_pushbuf_refn (push, refs, ARRAY_SIZE(refs)))
- return;
-
-@@ -431,7 +431,7 @@ nv30_transfer_rect_sifm(XFER_ARGS)
- si_arg |= NV03_SIFM_FORMAT_FILTER_BILINEAR;
- }
-
-- if (nouveau_pushbuf_space(push, 64, 6, 0) ||
-+ if (!PUSH_SPACE_EX(push, 64, 6, 0) ||
- nouveau_pushbuf_refn (push, refs, 2))
- return;
-
-@@ -516,7 +516,7 @@ nv30_transfer_rect_m2mf(XFER_ARGS)
- while (h) {
- unsigned lines = (h > 2047) ? 2047 : h;
-
-- if (nouveau_pushbuf_space(push, 32, 2, 0) ||
-+ if (!PUSH_SPACE_EX(push, 32, 2, 0) ||
- nouveau_pushbuf_refn (push, refs, 2))
- return;
-
-@@ -635,8 +635,8 @@ nv30_transfer_rect_cpu(XFER_ARGS)
- char *srcmap, *dstmap;
- int x, y;
-
-- nouveau_bo_map(src->bo, NOUVEAU_BO_RD, nv30->base.client);
-- nouveau_bo_map(dst->bo, NOUVEAU_BO_WR, nv30->base.client);
-+ BO_MAP(nv30->base.screen, src->bo, NOUVEAU_BO_RD, nv30->base.client);
-+ BO_MAP(nv30->base.screen, dst->bo, NOUVEAU_BO_WR, nv30->base.client);
- srcmap = src->bo->map + src->offset;
- dstmap = dst->bo->map + dst->offset;
-
-@@ -708,7 +708,7 @@ nv30_transfer_copy_data(struct nouveau_c
- lines = (pages > 2047) ? 2047 : pages;
- pages -= lines;
-
-- if (nouveau_pushbuf_space(push, 32, 2, 0) ||
-+ if (!PUSH_SPACE_EX(push, 32, 2, 0) ||
- nouveau_pushbuf_refn (push, refs, 2))
- return;
-
-@@ -732,7 +732,7 @@ nv30_transfer_copy_data(struct nouveau_c
- }
-
- if (size) {
-- if (nouveau_pushbuf_space(push, 32, 2, 0) ||
-+ if (!PUSH_SPACE_EX(push, 32, 2, 0) ||
- nouveau_pushbuf_refn (push, refs, 2))
- return;
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_compute.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_compute.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_compute.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_compute.c 2022-02-11 14:39:27.849132704 -0600
-@@ -518,7 +518,7 @@ nv50_state_validate_cp(struct nv50_conte
- nv50->bufctx_cp);
-
- if (unlikely(nv50->state.flushed))
-- nv50_bufctx_fence(nv50->bufctx_cp, true);
-+ nv50_bufctx_fence(nv50, nv50->bufctx_cp, true);
- return ret;
- }
-
-@@ -526,7 +526,7 @@ static void
- nv50_compute_upload_input(struct nv50_context *nv50, const uint32_t *input)
- {
- struct nv50_screen *screen = nv50->screen;
-- struct nouveau_pushbuf *push = screen->base.pushbuf;
-+ struct nouveau_pushbuf *push = nv50->base.pushbuf;
- unsigned size = align(nv50->compprog->parm_size, 0x4);
-
- BEGIN_NV04(push, NV50_CP(USER_PARAM_COUNT), 1);
-@@ -540,19 +540,19 @@ nv50_compute_upload_input(struct nv50_co
- mm = nouveau_mm_allocate(screen->base.mm_GART, size, &bo, &offset);
- assert(mm);
-
-- nouveau_bo_map(bo, 0, screen->base.client);
-+ BO_MAP(&screen->base, bo, 0, nv50->base.client);
- memcpy(bo->map + offset, input, size);
-
- nouveau_bufctx_refn(nv50->bufctx, 0, bo, NOUVEAU_BO_GART | NOUVEAU_BO_RD);
- nouveau_pushbuf_bufctx(push, nv50->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
-- nouveau_pushbuf_space(push, 0, 0, 1);
-+ PUSH_SPACE_EX(push, 0, 0, 1);
-
- BEGIN_NV04(push, NV50_CP(USER_PARAM(1)), size / 4);
- nouveau_pushbuf_data(push, bo, offset, size);
-
-- nouveau_fence_work(screen->base.fence.current, nouveau_mm_free_work, mm);
-+ nouveau_fence_work(nv50->base.fence, nouveau_mm_free_work, mm);
- nouveau_bo_ref(NULL, &bo);
- nouveau_bufctx_reset(nv50->bufctx, 0);
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_context.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_context.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_context.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_context.c 2022-02-11 17:44:52.706228555 -0600
-@@ -34,9 +34,10 @@ nv50_flush(struct pipe_context *pipe,
- unsigned flags)
- {
- struct nouveau_screen *screen = nouveau_screen(pipe->screen);
-+ struct nouveau_context *context = nouveau_context(pipe);
-
- if (fence)
-- nouveau_fence_ref(screen->fence.current, (struct nouveau_fence **)fence);
-+ nouveau_fence_ref(context->fence, (struct nouveau_fence **)fence);
-
- PUSH_KICK(screen->pushbuf);
-
-@@ -135,12 +136,12 @@ void
- nv50_default_kick_notify(struct nouveau_pushbuf *push)
- {
- struct nv50_screen *screen = push->user_priv;
-+ struct nv50_context *context = screen->cur_ctx;
-
-- if (screen) {
-- nouveau_fence_next(&screen->base);
-+ if (context) {
-+ nouveau_fence_next(&context->base);
- nouveau_fence_update(&screen->base, true);
-- if (screen->cur_ctx)
-- screen->cur_ctx->state.flushed = true;
-+ context->state.flushed = true;
- }
- }
-
-@@ -193,12 +194,13 @@ nv50_destroy(struct pipe_context *pipe)
- u_upload_destroy(nv50->base.pipe.stream_uploader);
-
- nouveau_pushbuf_bufctx(nv50->base.pushbuf, NULL);
-- nouveau_pushbuf_kick(nv50->base.pushbuf, nv50->base.pushbuf->channel);
-+ PUSH_KICK(nv50->base.pushbuf);
-
- nv50_context_unreference_resources(nv50);
-
- FREE(nv50->blit);
-
-+ nouveau_fence_cleanup(&nv50->base);
- nouveau_context_destroy(&nv50->base);
- }
-
-@@ -312,20 +314,18 @@ nv50_create(struct pipe_screen *pscreen,
- if (!nv50_blitctx_create(nv50))
- goto out_err;
-
-- nv50->base.pushbuf = screen->base.pushbuf;
-- nv50->base.client = screen->base.client;
-+ nouveau_context_init(&nv50->base, &screen->base);
-
-- ret = nouveau_bufctx_new(screen->base.client, 2, &nv50->bufctx);
-+ ret = nouveau_bufctx_new(nv50->base.client, 2, &nv50->bufctx);
- if (!ret)
-- ret = nouveau_bufctx_new(screen->base.client, NV50_BIND_3D_COUNT,
-+ ret = nouveau_bufctx_new(nv50->base.client, NV50_BIND_3D_COUNT,
- &nv50->bufctx_3d);
- if (!ret)
-- ret = nouveau_bufctx_new(screen->base.client, NV50_BIND_CP_COUNT,
-+ ret = nouveau_bufctx_new(nv50->base.client, NV50_BIND_CP_COUNT,
- &nv50->bufctx_cp);
- if (ret)
- goto out_err;
-
-- nv50->base.screen = &screen->base;
- nv50->base.copy_data = nv50_m2mf_copy_linear;
- nv50->base.push_data = nv50_sifc_linear_u8;
- nv50->base.push_cb = nv50_cb_push;
-@@ -360,7 +360,6 @@ nv50_create(struct pipe_screen *pscreen,
- }
- nv50->base.pushbuf->kick_notify = nv50_default_kick_notify;
-
-- nouveau_context_init(&nv50->base);
- nv50_init_query_functions(nv50);
- nv50_init_surface_functions(nv50);
- nv50_init_state_functions(nv50);
-@@ -416,6 +415,8 @@ nv50_create(struct pipe_screen *pscreen,
- // zero entry if it's not otherwise set.
- nv50->dirty_3d |= NV50_NEW_3D_SAMPLERS;
-
-+ nouveau_fence_new(&nv50->base, &nv50->base.fence);
-+
- return pipe;
-
- out_err:
-@@ -433,7 +434,7 @@ out_err:
- }
-
- void
--nv50_bufctx_fence(struct nouveau_bufctx *bufctx, bool on_flush)
-+nv50_bufctx_fence(struct nv50_context *nv50, struct nouveau_bufctx *bufctx, bool on_flush)
- {
- struct nouveau_list *list = on_flush ? &bufctx->current : &bufctx->pending;
- struct nouveau_list *it;
-@@ -442,7 +443,7 @@ nv50_bufctx_fence(struct nouveau_bufctx
- struct nouveau_bufref *ref = (struct nouveau_bufref *)it;
- struct nv04_resource *res = ref->priv;
- if (res)
-- nv50_resource_validate(res, (unsigned)ref->priv_data);
-+ nv50_resource_validate(nv50, res, (unsigned)ref->priv_data);
- }
- }
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_context.h mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_context.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_context.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_context.h 2022-02-11 14:48:38.488869249 -0600
-@@ -254,10 +254,28 @@ nv50_context_shader_stage(unsigned pipe)
- }
- }
-
-+static inline void
-+nv50_resource_validate(struct nv50_context *context, struct nv04_resource *res, uint32_t flags)
-+{
-+ if (likely(res->bo)) {
-+ if (flags & NOUVEAU_BO_WR)
-+ res->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING |
-+ NOUVEAU_BUFFER_STATUS_DIRTY;
-+ if (flags & NOUVEAU_BO_RD)
-+ res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
-+
-+ if (res->mm) {
-+ nouveau_fence_ref(context->base.fence, &res->fence);
-+ if (flags & NOUVEAU_BO_WR)
-+ nouveau_fence_ref(context->base.fence, &res->fence_wr);
-+ }
-+ }
-+}
-+
- /* nv50_context.c */
- struct pipe_context *nv50_create(struct pipe_screen *, void *, unsigned flags);
-
--void nv50_bufctx_fence(struct nouveau_bufctx *, bool on_flush);
-+void nv50_bufctx_fence(struct nv50_context *, struct nouveau_bufctx *, bool on_flush);
-
- void nv50_default_kick_notify(struct nouveau_pushbuf *);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_miptree.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_miptree.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_miptree.c 2022-02-11 14:49:23.116575689 -0600
-@@ -163,11 +163,7 @@ nv50_miptree_destroy(struct pipe_screen
- {
- struct nv50_miptree *mt = nv50_miptree(pt);
-
-- if (mt->base.fence && mt->base.fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
-- nouveau_fence_work(mt->base.fence, nouveau_fence_unref_bo, mt->base.bo);
-- else
-- nouveau_bo_ref(NULL, &mt->base.bo);
--
-+ nouveau_fence_work(mt->base.fence, nouveau_fence_unref_bo, mt->base.bo);
- nouveau_fence_ref(NULL, &mt->base.fence);
- nouveau_fence_ref(NULL, &mt->base.fence_wr);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_query_hw.c 2022-02-11 14:53:02.848195107 -0600
-@@ -52,7 +52,7 @@ nv50_hw_query_allocate(struct nv50_conte
- if (hq->state == NV50_HW_QUERY_STATE_READY)
- nouveau_mm_free(hq->mm);
- else
-- nouveau_fence_work(screen->base.fence.current,
-+ nouveau_fence_work(nv50->base.fence,
- nouveau_mm_free_work, hq->mm);
- }
- }
-@@ -63,7 +63,7 @@ nv50_hw_query_allocate(struct nv50_conte
- return false;
- hq->offset = hq->base_offset;
-
-- ret = nouveau_bo_map(hq->bo, 0, screen->base.client);
-+ ret = BO_MAP(&screen->base, hq->bo, 0, nv50->base.client);
- if (ret) {
- nv50_hw_query_allocate(nv50, q, 0);
- return false;
-@@ -265,7 +265,7 @@ nv50_hw_end_query(struct nv50_context *n
- break;
- }
- if (hq->is64bit)
-- nouveau_fence_ref(nv50->screen->base.fence.current, &hq->fence);
-+ nouveau_fence_ref(nv50->base.fence, &hq->fence);
- }
-
- static bool
-@@ -294,7 +294,7 @@ nv50_hw_get_query_result(struct nv50_con
- }
- return false;
- }
-- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nv50->screen->base.client))
-+ if (BO_WAIT(&nv50->screen->base, hq->bo, NOUVEAU_BO_RD, nv50->base.client))
- return false;
- }
- hq->state = NV50_HW_QUERY_STATE_READY;
-@@ -447,14 +447,15 @@ nv50_hw_get_driver_query_info(struct nv5
- }
-
- void
--nv50_hw_query_pushbuf_submit(struct nouveau_pushbuf *push, uint16_t method,
-+nv50_hw_query_pushbuf_submit(struct nv50_context *nv50, uint16_t method,
- struct nv50_query *q, unsigned result_offset)
- {
-+ struct nouveau_pushbuf *push = nv50->base.pushbuf;
- struct nv50_hw_query *hq = nv50_hw_query(q);
-
- nv50_hw_query_update(q);
- if (hq->state != NV50_HW_QUERY_STATE_READY)
-- nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, push->client);
-+ BO_WAIT(&nv50->screen->base, hq->bo, NOUVEAU_BO_RD, push->client);
- hq->state = NV50_HW_QUERY_STATE_READY;
-
- BEGIN_NV04(push, SUBC_3D(method), 1);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_query_hw.h mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_query_hw.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_query_hw.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_query_hw.h 2022-02-11 14:53:21.749080536 -0600
-@@ -52,7 +52,7 @@ nv50_hw_get_driver_query_info(struct nv5
- bool
- nv50_hw_query_allocate(struct nv50_context *, struct nv50_query *, int);
- void
--nv50_hw_query_pushbuf_submit(struct nouveau_pushbuf *, uint16_t,
-+nv50_hw_query_pushbuf_submit(struct nv50_context *, uint16_t,
- struct nv50_query *, unsigned);
- void
- nv84_hw_query_fifo_wait(struct nouveau_pushbuf *, struct nv50_query *);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_query_hw_sm.c 2022-02-11 14:54:28.454680509 -0600
-@@ -321,7 +321,7 @@ nv50_hw_sm_query_read_data(uint32_t coun
- if (hq->data[b + 4] != hq->sequence) {
- if (!wait)
- return false;
-- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nv50->base.client))
-+ if (BO_WAIT(&nv50->screen->base, hq->bo, NOUVEAU_BO_RD, nv50->base.client))
- return false;
- }
- count[p][c] = hq->data[b + hsq->ctr[c]];
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_screen.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_screen.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_screen.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_screen.c 2022-02-11 14:55:45.692224889 -0600
-@@ -595,8 +595,6 @@ nv50_screen_destroy(struct pipe_screen *
- if (!nouveau_drm_screen_unref(&screen->base))
- return;
-
-- nouveau_fence_cleanup(&screen->base);
--
- if (screen->base.pushbuf)
- screen->base.pushbuf->user_priv = NULL;
-
-@@ -1074,7 +1072,7 @@ nv50_screen_create(struct nouveau_device
- goto fail;
- }
-
-- nouveau_bo_map(screen->fence.bo, 0, NULL);
-+ BO_MAP(&screen->base, screen->fence.bo, 0, NULL);
- screen->fence.map = screen->fence.bo->map;
- screen->base.fence.emit = nv50_screen_fence_emit;
- screen->base.fence.update = nv50_screen_fence_update;
-@@ -1217,8 +1215,6 @@ nv50_screen_create(struct nouveau_device
- goto fail;
- }
-
-- nouveau_fence_new(&screen->base, &screen->base.fence.current);
--
- return &screen->base;
-
- fail:
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_screen.h mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_screen.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_screen.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_screen.h 2022-02-11 14:56:32.391952891 -0600
-@@ -133,32 +133,6 @@ int nv50_screen_tsc_alloc(struct nv50_sc
-
- int nv50_screen_compute_setup(struct nv50_screen *, struct nouveau_pushbuf *);
-
--static inline void
--nv50_resource_fence(struct nv04_resource *res, uint32_t flags)
--{
-- struct nv50_screen *screen = nv50_screen(res->base.screen);
--
-- if (res->mm) {
-- nouveau_fence_ref(screen->base.fence.current, &res->fence);
-- if (flags & NOUVEAU_BO_WR)
-- nouveau_fence_ref(screen->base.fence.current, &res->fence_wr);
-- }
--}
--
--static inline void
--nv50_resource_validate(struct nv04_resource *res, uint32_t flags)
--{
-- if (likely(res->bo)) {
-- if (flags & NOUVEAU_BO_WR)
-- res->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING |
-- NOUVEAU_BUFFER_STATUS_DIRTY;
-- if (flags & NOUVEAU_BO_RD)
-- res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
--
-- nv50_resource_fence(res, flags);
-- }
--}
--
- struct nv50_format {
- uint32_t rt;
- struct {
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c 2022-02-11 14:56:59.654795192 -0600
-@@ -717,7 +717,7 @@ nv50_stream_output_validate(struct nv50_
- PUSH_DATA(push, targ->pipe.buffer_size);
- if (!targ->clean) {
- assert(targ->pq);
-- nv50_hw_query_pushbuf_submit(push, NVA0_3D_STRMOUT_OFFSET(i),
-+ nv50_hw_query_pushbuf_submit(nv50, NVA0_3D_STRMOUT_OFFSET(i),
- nv50_query(targ->pq), 0x4);
- } else {
- BEGIN_NV04(push, NVA0_3D(STRMOUT_OFFSET(i)), 1);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c 2022-02-11 14:58:09.012397327 -0600
-@@ -556,10 +556,10 @@ nv50_state_validate(struct nv50_context
- PUSH_DATA (nv50->base.pushbuf, 0);
- }
-
-- nv50_bufctx_fence(bufctx, false);
-+ nv50_bufctx_fence(nv50, bufctx, false);
- }
- nouveau_pushbuf_bufctx(nv50->base.pushbuf, bufctx);
-- ret = nouveau_pushbuf_validate(nv50->base.pushbuf);
-+ ret = PUSH_VAL(nv50->base.pushbuf);
-
- return !ret;
- }
-@@ -575,7 +575,7 @@ nv50_state_validate_3d(struct nv50_conte
-
- if (unlikely(nv50->state.flushed)) {
- nv50->state.flushed = false;
-- nv50_bufctx_fence(nv50->bufctx_3d, true);
-+ nv50_bufctx_fence(nv50, nv50->bufctx_3d, true);
- }
- return ret;
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_surface.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_surface.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_surface.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_surface.c 2022-02-11 18:05:39.993075211 -0600
-@@ -257,7 +257,7 @@ nv50_resource_copy_region(struct pipe_co
- BCTX_REFN(nv50->bufctx, 2D, nv04_resource(src), RD);
- BCTX_REFN(nv50->bufctx, 2D, nv04_resource(dst), WR);
- nouveau_pushbuf_bufctx(nv50->base.pushbuf, nv50->bufctx);
-- nouveau_pushbuf_validate(nv50->base.pushbuf);
-+ PUSH_VAL(nv50->base.pushbuf);
-
- for (; dst_layer < dstz + src_box->depth; ++dst_layer, ++src_layer) {
- ret = nv50_2d_texture_do_copy(nv50->base.pushbuf,
-@@ -295,7 +295,7 @@ nv50_clear_render_target(struct pipe_con
- PUSH_DATAf(push, color->f[2]);
- PUSH_DATAf(push, color->f[3]);
-
-- if (nouveau_pushbuf_space(push, 64 + sf->depth, 1, 0))
-+ if (!PUSH_SPACE_EX(push, 64 + sf->depth, 1, 0))
- return;
-
- PUSH_REFN(push, bo, mt->base.domain | NOUVEAU_BO_WR);
-@@ -394,7 +394,7 @@ nv50_clear_depth_stencil(struct pipe_con
- mode |= NV50_3D_CLEAR_BUFFERS_S;
- }
-
-- if (nouveau_pushbuf_space(push, 64 + sf->depth, 1, 0))
-+ if (!PUSH_SPACE_EX(push, 64 + sf->depth, 1, 0))
- return;
-
- PUSH_REFN(push, bo, mt->base.domain | NOUVEAU_BO_WR);
-@@ -653,7 +653,7 @@ nv50_clear_buffer_push(struct pipe_conte
-
- nouveau_bufctx_refn(nv50->bufctx, 0, buf->bo, buf->domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, nv50->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- offset &= ~0xff;
-
-@@ -692,7 +692,7 @@ nv50_clear_buffer_push(struct pipe_conte
- count -= nr;
- }
-
-- nv50_resource_validate(buf, NOUVEAU_BO_WR);
-+ nv50_resource_validate(nv50, buf, NOUVEAU_BO_WR);
-
- nouveau_bufctx_reset(nv50->bufctx, 0);
- }
-@@ -771,7 +771,7 @@ nv50_clear_buffer(struct pipe_context *p
- PUSH_DATA (push, color.ui[2]);
- PUSH_DATA (push, color.ui[3]);
-
-- if (nouveau_pushbuf_space(push, 64, 1, 0))
-+ if (!PUSH_SPACE_EX(push, 64, 1, 0))
- return;
-
- PUSH_REFN(push, buf->bo, buf->domain | NOUVEAU_BO_WR);
-@@ -815,7 +815,7 @@ nv50_clear_buffer(struct pipe_context *p
- BEGIN_NV04(push, NV50_3D(COND_MODE), 1);
- PUSH_DATA (push, nv50->cond_condmode);
-
-- nv50_resource_validate(buf, NOUVEAU_BO_WR);
-+ nv50_resource_validate(nv50, buf, NOUVEAU_BO_WR);
-
- if (width * height != elements) {
- offset += width * height * data_size;
-@@ -1639,7 +1639,7 @@ nv50_blit_eng2d(struct nv50_context *nv5
- BCTX_REFN(nv50->bufctx, 2D, &dst->base, WR);
- BCTX_REFN(nv50->bufctx, 2D, &src->base, RD);
- nouveau_pushbuf_bufctx(nv50->base.pushbuf, nv50->bufctx);
-- if (nouveau_pushbuf_validate(nv50->base.pushbuf))
-+ if (PUSH_VAL(nv50->base.pushbuf))
- return;
-
- for (i = 0; i < info->dst.box.depth; ++i) {
-@@ -1679,7 +1679,7 @@ nv50_blit_eng2d(struct nv50_context *nv5
- PUSH_DATA (push, srcy >> 32);
- }
- }
-- nv50_bufctx_fence(nv50->bufctx, false);
-+ nv50_bufctx_fence(nv50, nv50->bufctx, false);
-
- nouveau_bufctx_reset(nv50->bufctx, NV50_BIND_2D);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_transfer.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_transfer.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_transfer.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_transfer.c 2022-02-11 15:02:10.331043100 -0600
-@@ -67,7 +67,7 @@ nv50_2d_transfer_rect(struct nv50_contex
- nouveau_bufctx_refn(bctx, 0, src->bo, src->domain | NOUVEAU_BO_RD);
- nouveau_bufctx_refn(bctx, 0, dst->bo, dst->domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- uint32_t format;
- switch (cpp) {
-@@ -197,7 +197,7 @@ nv50_m2mf_transfer_rect(struct nv50_cont
- nouveau_bufctx_refn(bctx, 0, src->bo, src->domain | NOUVEAU_BO_RD);
- nouveau_bufctx_refn(bctx, 0, dst->bo, dst->domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- if (nouveau_bo_memtype(src->bo)) {
- BEGIN_NV04(push, NV50_M2MF(LINEAR_IN), 6);
-@@ -284,7 +284,7 @@ nv50_sifc_linear_u8(struct nouveau_conte
-
- nouveau_bufctx_refn(nv50->bufctx, 0, dst, domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, nv50->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- offset &= ~0xff;
-
-@@ -337,7 +337,7 @@ nv50_m2mf_copy_linear(struct nouveau_con
- nouveau_bufctx_refn(bctx, 0, src, srcdom | NOUVEAU_BO_RD);
- nouveau_bufctx_refn(bctx, 0, dst, dstdom | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- BEGIN_NV04(push, NV50_M2MF(LINEAR_IN), 1);
- PUSH_DATA (push, 1);
-@@ -375,7 +375,6 @@ nv50_miptree_transfer_map(struct pipe_co
- const struct pipe_box *box,
- struct pipe_transfer **ptransfer)
- {
-- struct nv50_screen *screen = nv50_screen(pctx->screen);
- struct nv50_context *nv50 = nv50_context(pctx);
- struct nouveau_device *dev = nv50->screen->base.device;
- const struct nv50_miptree *mt = nv50_miptree(res);
-@@ -454,7 +453,7 @@ nv50_miptree_transfer_map(struct pipe_co
- if (usage & PIPE_MAP_WRITE)
- flags |= NOUVEAU_BO_WR;
-
-- ret = nouveau_bo_map(tx->rect[1].bo, flags, screen->base.client);
-+ ret = BO_MAP(nv50->base.screen, tx->rect[1].bo, flags, nv50->base.client);
- if (ret) {
- nouveau_bo_ref(NULL, &tx->rect[1].bo);
- FREE(tx);
-@@ -486,7 +485,7 @@ nv50_miptree_transfer_unmap(struct pipe_
- }
-
- /* Allow the copies above to finish executing before freeing the source */
-- nouveau_fence_work(nv50->screen->base.fence.current,
-+ nouveau_fence_work(nv50->base.fence,
- nouveau_fence_unref_bo, tx->rect[1].bo);
- } else {
- nouveau_bo_ref(NULL, &tx->rect[1].bo);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_vbo.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv50_vbo.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv50_vbo.c 2022-02-11 15:03:36.446568575 -0600
-@@ -624,14 +624,14 @@ nv50_draw_elements(struct nv50_context *
- * the not-yet-written data. Ideally this wait would only happen on
- * pushbuf submit, but it's probably not a big performance difference.
- */
-- if (buf->fence_wr && !nouveau_fence_signalled(buf->fence_wr))
-+ if (buf->fence_wr)
- nouveau_fence_wait(buf->fence_wr, &nv50->base.debug);
-
- while (instance_count--) {
- BEGIN_NV04(push, NV50_3D(VERTEX_BEGIN_GL), 1);
- PUSH_DATA (push, prim);
-
-- nouveau_pushbuf_space(push, 16, 0, 1);
-+ PUSH_SPACE_EX(push, 16, 0, 1);
- PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
-
- switch (index_size) {
-@@ -737,7 +737,7 @@ nva0_draw_stream_output(struct nv50_cont
- PUSH_DATA (push, 0);
- BEGIN_NV04(push, NVA0_3D(DRAW_TFB_STRIDE), 1);
- PUSH_DATA (push, so->stride);
-- nv50_hw_query_pushbuf_submit(push, NVA0_3D_DRAW_TFB_BYTES,
-+ nv50_hw_query_pushbuf_submit(nv50, NVA0_3D_DRAW_TFB_BYTES,
- nv50_query(so->pq), 0x4);
- BEGIN_NV04(push, NV50_3D(VERTEX_END_GL), 1);
- PUSH_DATA (push, 0);
-@@ -752,8 +752,6 @@ nv50_draw_vbo_kick_notify(struct nouveau
- struct nv50_screen *screen = chan->user_priv;
-
- nouveau_fence_update(&screen->base, true);
--
-- nv50_bufctx_fence(screen->cur_ctx->bufctx_3d, true);
- }
-
- void
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c 2022-02-11 15:09:14.426111024 -0600
-@@ -89,6 +89,7 @@ nv84_decoder_bsp(struct nv84_decoder *de
- const unsigned *num_bytes,
- struct nv84_video_buffer *dest)
- {
-+ struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
- struct iparm params;
- uint32_t more_params[0x44 / 4] = {0};
- unsigned total_bytes = 0;
-@@ -103,7 +104,7 @@ nv84_decoder_bsp(struct nv84_decoder *de
- { dec->fence, NOUVEAU_BO_RDWR | NOUVEAU_BO_VRAM },
- };
-
-- nouveau_bo_wait(dec->fence, NOUVEAU_BO_RDWR, dec->client);
-+ BO_WAIT(screen, dec->fence, NOUVEAU_BO_RDWR, dec->client);
-
- STATIC_ASSERT(sizeof(struct iparm) == 0x530);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv84_video.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv84_video.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv84_video.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv84_video.c 2022-02-11 15:08:27.115135546 -0600
-@@ -69,6 +69,7 @@ nv84_load_firmwares(struct nouveau_devic
- {
- int ret, size1, size2 = 0;
- struct nouveau_bo *fw;
-+ struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
-
- size1 = filesize(fw1);
- if (fw2)
-@@ -81,7 +82,7 @@ nv84_load_firmwares(struct nouveau_devic
- ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, dec->vp_fw2_offset + size2, NULL, &fw);
- if (ret)
- return NULL;
-- ret = nouveau_bo_map(fw, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, fw, NOUVEAU_BO_WR, dec->client);
- if (ret)
- goto error;
-
-@@ -183,11 +184,12 @@ nv84_decoder_begin_frame_mpeg12(struct p
- struct pipe_video_buffer *target,
- struct pipe_picture_desc *picture)
- {
-+ struct nouveau_screen *screen = nouveau_screen(decoder->context->screen);
- struct nv84_decoder *dec = (struct nv84_decoder *)decoder;
- struct pipe_mpeg12_picture_desc *desc = (struct pipe_mpeg12_picture_desc *)picture;
- int i;
-
-- nouveau_bo_wait(dec->mpeg12_bo, NOUVEAU_BO_RDWR, dec->client);
-+ BO_WAIT(screen, dec->mpeg12_bo, NOUVEAU_BO_RDWR, dec->client);
- dec->mpeg12_mb_info = dec->mpeg12_bo->map + 0x100;
- dec->mpeg12_data = dec->mpeg12_bo->map + 0x100 +
- align(0x20 * mb(dec->base.width) * mb(dec->base.height), 0x100);
-@@ -406,14 +408,14 @@ nv84_create_decoder(struct pipe_context
- NULL, &dec->bitstream);
- if (ret)
- goto fail;
-- ret = nouveau_bo_map(dec->bitstream, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, dec->bitstream, NOUVEAU_BO_WR, dec->client);
- if (ret)
- goto fail;
- ret = nouveau_bo_new(screen->device, NOUVEAU_BO_GART,
- 0, 0x2000, NULL, &dec->vp_params);
- if (ret)
- goto fail;
-- ret = nouveau_bo_map(dec->vp_params, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, dec->vp_params, NOUVEAU_BO_WR, dec->client);
- if (ret)
- goto fail;
- }
-@@ -425,7 +427,7 @@ nv84_create_decoder(struct pipe_context
- NULL, &dec->mpeg12_bo);
- if (ret)
- goto fail;
-- ret = nouveau_bo_map(dec->mpeg12_bo, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen,dec->mpeg12_bo, NOUVEAU_BO_WR, dec->client);
- if (ret)
- goto fail;
- }
-@@ -434,7 +436,7 @@ nv84_create_decoder(struct pipe_context
- 0, 0x1000, NULL, &dec->fence);
- if (ret)
- goto fail;
-- ret = nouveau_bo_map(dec->fence, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, dec->fence, NOUVEAU_BO_WR, dec->client);
- if (ret)
- goto fail;
- *(uint32_t *)dec->fence->map = 0;
-@@ -493,17 +495,17 @@ nv84_create_decoder(struct pipe_context
- surf.offset = dec->vpring->size - 0x1000;
- context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1, false);
-
-- PUSH_SPACE(screen->pushbuf, 5);
-- PUSH_REFN(screen->pushbuf, dec->fence, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
-+ PUSH_SPACE(nv50->base.pushbuf, 5);
-+ PUSH_REFN(nv50->base.pushbuf, dec->fence, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
- /* The clear_render_target is done via 3D engine, so use it to write to a
- * sempahore to indicate that it's done.
- */
-- BEGIN_NV04(screen->pushbuf, NV50_3D(QUERY_ADDRESS_HIGH), 4);
-- PUSH_DATAh(screen->pushbuf, dec->fence->offset);
-- PUSH_DATA (screen->pushbuf, dec->fence->offset);
-- PUSH_DATA (screen->pushbuf, 1);
-- PUSH_DATA (screen->pushbuf, 0xf010);
-- PUSH_KICK (screen->pushbuf);
-+ BEGIN_NV04(nv50->base.pushbuf, NV50_3D(QUERY_ADDRESS_HIGH), 4);
-+ PUSH_DATAh(nv50->base.pushbuf, dec->fence->offset);
-+ PUSH_DATA (nv50->base.pushbuf, dec->fence->offset);
-+ PUSH_DATA (nv50->base.pushbuf, 1);
-+ PUSH_DATA (nv50->base.pushbuf, 0xf010);
-+ PUSH_KICK (nv50->base.pushbuf);
-
- PUSH_SPACE(bsp_push, 2 + 12 + 2 + 4 + 3);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c 2022-02-11 15:12:36.619828402 -0600
-@@ -39,6 +39,7 @@ nv98_decoder_bsp(struct nouveau_vp3_deco
- unsigned *vp_caps, unsigned *is_ref,
- struct nouveau_vp3_video_buffer *refs[16])
- {
-+ struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
- struct nouveau_pushbuf *push = dec->pushbuf[0];
- enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
- uint32_t bsp_addr, comm_addr, inter_addr;
-@@ -95,7 +96,7 @@ nv98_decoder_bsp(struct nouveau_vp3_deco
- bo_refs[1].bo = dec->inter_bo[comm_seq & 1] = inter_bo = tmp_bo;
- }
-
-- ret = nouveau_bo_map(bsp_bo, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, bsp_bo, NOUVEAU_BO_WR, dec->client);
- if (ret) {
- debug_printf("map failed: %i %s\n", ret, strerror(-ret));
- return -1;
-@@ -107,7 +108,7 @@ nv98_decoder_bsp(struct nouveau_vp3_deco
-
- nouveau_vp3_vp_caps(dec, desc, target, comm_seq, vp_caps, is_ref, refs);
-
-- nouveau_pushbuf_space(push, 32, num_refs, 0);
-+ PUSH_SPACE_EX(push, 32, num_refs, 0);
- nouveau_pushbuf_refn(push, bo_refs, num_refs);
-
- bsp_addr = bsp_bo->offset >> 8;
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video.c 2022-02-11 15:11:41.428930690 -0600
-@@ -85,7 +85,8 @@ struct pipe_video_codec *
- nv98_create_decoder(struct pipe_context *context,
- const struct pipe_video_codec *templ)
- {
-- struct nouveau_screen *screen = &((struct nv50_context *)context)->screen->base;
-+ struct nv50_context *nv50 = nv50_context(context);
-+ struct nouveau_screen *screen = &nv50->screen->base;
- struct nouveau_vp3_decoder *dec;
- struct nouveau_pushbuf **push;
- struct nv04_fifo nv04_data = {.vram = 0xbeef0201, .gart = 0xbeef0202};
-@@ -106,7 +107,7 @@ nv98_create_decoder(struct pipe_context
- dec = CALLOC_STRUCT(nouveau_vp3_decoder);
- if (!dec)
- return NULL;
-- dec->client = screen->client;
-+ dec->client = nv50->base.client;
- dec->base = *templ;
- nouveau_vp3_decoder_init_common(&dec->base);
-
-@@ -119,7 +120,7 @@ nv98_create_decoder(struct pipe_context
- &nv04_data, sizeof(nv04_data), &dec->channel[0]);
-
- if (!ret)
-- ret = nouveau_pushbuf_new(screen->client, dec->channel[0], 4,
-+ ret = nouveau_pushbuf_new(nv50->base.client, dec->channel[0], 4,
- 32 * 1024, true, &dec->pushbuf[0]);
-
- for (i = 1; i < 3; ++i) {
-@@ -268,13 +269,13 @@ nv98_create_decoder(struct pipe_context
- if (ret)
- goto fail;
-
-- nouveau_bo_map(dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
-+ BO_MAP(dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
- dec->fence_map = dec->fence_bo->map;
- dec->fence_map[0] = dec->fence_map[4] = dec->fence_map[8] = 0;
- dec->comm = (struct comm *)(dec->fence_map + (COMM_OFFSET/sizeof(*dec->fence_map)));
-
- /* So lets test if the fence is working? */
-- nouveau_pushbuf_space(push[0], 16, 1, 0);
-+ PUSH_SPACE_EX(push[0], 16, 1, 0);
- PUSH_REFN (push[0], dec->fence_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR);
- BEGIN_NV04(push[0], SUBC_BSP(0x240), 3);
- PUSH_DATAh(push[0], dec->fence_bo->offset);
-@@ -285,7 +286,7 @@ nv98_create_decoder(struct pipe_context
- PUSH_DATA (push[0], 0);
- PUSH_KICK (push[0]);
-
-- nouveau_pushbuf_space(push[1], 16, 1, 0);
-+ PUSH_SPACE_EX(push[1], 16, 1, 0);
- PUSH_REFN (push[1], dec->fence_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR);
- BEGIN_NV04(push[1], SUBC_VP(0x240), 3);
- PUSH_DATAh(push[1], (dec->fence_bo->offset + 0x10));
-@@ -296,7 +297,7 @@ nv98_create_decoder(struct pipe_context
- PUSH_DATA (push[1], 0);
- PUSH_KICK (push[1]);
-
-- nouveau_pushbuf_space(push[2], 16, 1, 0);
-+ PUSH_SPACE_EX(push[2], 16, 1, 0);
- PUSH_REFN (push[2], dec->fence_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR);
- BEGIN_NV04(push[2], SUBC_PPP(0x240), 3);
- PUSH_DATAh(push[2], (dec->fence_bo->offset + 0x20));
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video_ppp.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video_ppp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video_ppp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video_ppp.c 2022-02-11 15:12:49.083803035 -0600
-@@ -94,7 +94,7 @@ nv98_decoder_ppp(struct nouveau_vp3_deco
- struct nouveau_pushbuf *push = dec->pushbuf[2];
- unsigned ppp_caps = 0x10;
-
-- nouveau_pushbuf_space(push, 32, 4, 0);
-+ PUSH_SPACE_EX(push, 32, 4, 0);
-
- switch (codec) {
- case PIPE_VIDEO_FORMAT_MPEG12: {
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c 2022-02-11 15:13:28.216718331 -0600
-@@ -44,7 +44,7 @@ static void dump_comm_vp(struct nouveau_
-
- if ((comm->pvp_stage & 0xff) != 0xff) {
- unsigned *map;
-- int ret = nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
-+ int ret = BO_MAP(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
- assert(ret >= 0);
- map = inter_bo->map;
- for (i = 0; i < comm->byte_ofs + slice_size; i += 0x10) {
-@@ -111,7 +111,7 @@ nv98_decoder_vp(struct nouveau_vp3_decod
- if (!is_ref && (dec->refs[target->valid_ref].decoded_top && dec->refs[target->valid_ref].decoded_bottom))
- nv98_decoder_kick_ref(dec, target);
-
-- nouveau_pushbuf_space(push, 32 + codec_extra, num_refs, 0);
-+ PUSH_SPACE_EX(push, 32 + codec_extra, num_refs, 0);
-
- nouveau_pushbuf_refn(push, bo_refs, num_refs);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c 2022-02-11 15:16:25.426251672 -0600
-@@ -428,10 +428,11 @@ nvc0_launch_grid(struct pipe_context *pi
- struct nvc0_program *cp = nvc0->compprog;
- int ret;
-
-+ simple_mtx_lock(&screen->state_lock);
- ret = !nvc0_state_validate_cp(nvc0, ~0);
- if (ret) {
- NOUVEAU_ERR("Failed to launch grid !\n");
-- return;
-+ goto out;
- }
-
- nvc0_compute_upload_input(nvc0, info);
-@@ -464,7 +465,7 @@ nvc0_launch_grid(struct pipe_context *pi
- PUSH_DATA (push, (info->block[1] << 16) | info->block[0]);
- PUSH_DATA (push, info->block[2]);
-
-- nouveau_pushbuf_space(push, 32, 2, 1);
-+ PUSH_SPACE_EX(push, 32, 2, 1);
- PUSH_REFN(push, screen->text, NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_RD);
-
- if (unlikely(info->indirect)) {
-@@ -502,6 +503,9 @@ nvc0_launch_grid(struct pipe_context *pi
- nvc0->images_dirty[5] |= nvc0->images_valid[5];
-
- nvc0_update_compute_invocations_counter(nvc0, info);
-+
-+out:
-+ simple_mtx_unlock(&screen->state_lock);
- }
-
- static void
-@@ -511,7 +515,7 @@ nvc0_compute_update_indirect_invocations
- struct nv04_resource *res = nv04_resource(info->indirect);
- uint32_t offset = res->offset + info->indirect_offset;
-
-- nouveau_pushbuf_space(push, 16, 0, 8);
-+ PUSH_SPACE_EX(push, 16, 0, 8);
- PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);
- BEGIN_1IC0(push, NVC0_3D(MACRO_COMPUTE_COUNTER), 7);
- PUSH_DATA(push, 6);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_context.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_context.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_context.c 2022-02-11 18:08:12.440206042 -0600
-@@ -81,10 +81,9 @@ nvc0_flush(struct pipe_context *pipe,
- unsigned flags)
- {
- struct nvc0_context *nvc0 = nvc0_context(pipe);
-- struct nouveau_screen *screen = &nvc0->screen->base;
-
- if (fence)
-- nouveau_fence_ref(screen->fence.current, (struct nouveau_fence **)fence);
-+ nouveau_fence_ref(nvc0->base.fence, (struct nouveau_fence **)fence);
-
- PUSH_KICK(nvc0->base.pushbuf); /* fencing handled in kick_notify */
-
-@@ -257,7 +256,7 @@ nvc0_destroy(struct pipe_context *pipe)
- * Other contexts will always set their bufctx again on action calls.
- */
- nouveau_pushbuf_bufctx(nvc0->base.pushbuf, NULL);
-- nouveau_pushbuf_kick(nvc0->base.pushbuf, nvc0->base.pushbuf->channel);
-+ PUSH_KICK(nvc0->base.pushbuf);
-
- nvc0_context_unreference_resources(nvc0);
- nvc0_blitctx_destroy(nvc0);
-@@ -272,6 +271,7 @@ nvc0_destroy(struct pipe_context *pipe)
- free(pos);
- }
-
-+ nouveau_fence_cleanup(&nvc0->base);
- nouveau_context_destroy(&nvc0->base);
- }
-
-@@ -279,12 +279,12 @@ void
- nvc0_default_kick_notify(struct nouveau_pushbuf *push)
- {
- struct nvc0_screen *screen = push->user_priv;
-+ struct nvc0_context *nvc0 = screen->cur_ctx;
-
-- if (screen) {
-- nouveau_fence_next(&screen->base);
-+ if (nvc0) {
-+ nouveau_fence_next(&nvc0->base);
- nouveau_fence_update(&screen->base, true);
-- if (screen->cur_ctx)
-- screen->cur_ctx->state.flushed = true;
-+ nvc0->state.flushed = true;
- NOUVEAU_DRV_STAT(&screen->base, pushbuf_count, 1);
- }
- }
-@@ -425,22 +425,19 @@ nvc0_create(struct pipe_screen *pscreen,
- if (!nvc0_blitctx_create(nvc0))
- goto out_err;
-
-- nvc0->base.pushbuf = screen->base.pushbuf;
-- nvc0->base.client = screen->base.client;
-+ nouveau_context_init(&nvc0->base, &screen->base);
-
-- ret = nouveau_bufctx_new(screen->base.client, 2, &nvc0->bufctx);
-+ ret = nouveau_bufctx_new(nvc0->base.client, 2, &nvc0->bufctx);
- if (!ret)
-- ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_3D_COUNT,
-+ ret = nouveau_bufctx_new(nvc0->base.client, NVC0_BIND_3D_COUNT,
- &nvc0->bufctx_3d);
- if (!ret)
-- ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_CP_COUNT,
-+ ret = nouveau_bufctx_new(nvc0->base.client, NVC0_BIND_CP_COUNT,
- &nvc0->bufctx_cp);
- if (ret)
- goto out_err;
-
- nvc0->screen = screen;
-- nvc0->base.screen = &screen->base;
--
- pipe->screen = pscreen;
- pipe->priv = priv;
- pipe->stream_uploader = u_upload_create_default(pipe);
-@@ -464,7 +461,6 @@ nvc0_create(struct pipe_screen *pscreen,
- pipe->emit_string_marker = nvc0_emit_string_marker;
- pipe->get_device_reset_status = nvc0_get_device_reset_status;
-
-- nouveau_context_init(&nvc0->base);
- nvc0_init_query_functions(nvc0);
- nvc0_init_surface_functions(nvc0);
- nvc0_init_state_functions(nvc0);
-@@ -553,6 +549,8 @@ nvc0_create(struct pipe_screen *pscreen,
- nvc0->dirty_cp |= NVC0_NEW_CP_SAMPLERS;
- }
-
-+ nouveau_fence_new(&nvc0->base, &nvc0->base.fence);
-+
- return pipe;
-
- out_err:
-@@ -583,7 +581,7 @@ nvc0_bufctx_fence(struct nvc0_context *n
- struct nouveau_bufref *ref = (struct nouveau_bufref *)it;
- struct nv04_resource *res = ref->priv;
- if (res)
-- nvc0_resource_validate(res, (unsigned)ref->priv_data);
-+ nvc0_resource_validate(nvc0, res, (unsigned)ref->priv_data);
- NOUVEAU_DRV_STAT_IFD(count++);
- }
- NOUVEAU_DRV_STAT(&nvc0->screen->base, resource_validate_count, count);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_context.h mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_context.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_context.h 2022-02-11 15:23:13.508824215 -0600
-@@ -311,6 +311,30 @@ nvc0_shader_stage(unsigned pipe)
- }
-
-
-+static inline void
-+nvc0_resource_fence(struct nvc0_context *nvc0, struct nv04_resource *res, uint32_t flags)
-+{
-+ if (res->mm) {
-+ nouveau_fence_ref(nvc0->base.fence, &res->fence);
-+ if (flags & NOUVEAU_BO_WR)
-+ nouveau_fence_ref(nvc0->base.fence, &res->fence_wr);
-+ }
-+}
-+
-+static inline void
-+nvc0_resource_validate(struct nvc0_context *nvc0, struct nv04_resource *res, uint32_t flags)
-+{
-+ if (likely(res->bo)) {
-+ if (flags & NOUVEAU_BO_WR)
-+ res->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING |
-+ NOUVEAU_BUFFER_STATUS_DIRTY;
-+ if (flags & NOUVEAU_BO_RD)
-+ res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
-+
-+ nvc0_resource_fence(nvc0, res, flags);
-+ }
-+}
-+
- /* nvc0_context.c */
- struct pipe_context *nvc0_create(struct pipe_screen *, void *, unsigned flags);
- void nvc0_bufctx_fence(struct nvc0_context *, struct nouveau_bufctx *,
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_program.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_program.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_program.c 2022-02-11 15:25:32.848266636 -0600
-@@ -884,6 +884,7 @@ nvc0_program_upload(struct nvc0_context
- size += TU102_SHADER_HEADER_SIZE;
- }
-
-+ simple_mtx_assert_locked(&nvc0->screen->state_lock);
- ret = nvc0_program_alloc_code(nvc0, prog);
- if (ret) {
- struct nouveau_heap *heap = screen->text_heap;
-@@ -990,8 +991,11 @@ nvc0_program_destroy(struct nvc0_context
- const struct pipe_shader_state pipe = prog->pipe;
- const ubyte type = prog->type;
-
-- if (prog->mem)
-+ if (prog->mem) {
-+ if (nvc0)
-+ simple_mtx_assert_locked(&nvc0->screen->state_lock);
- nouveau_heap_free(&prog->mem);
-+ }
- FREE(prog->code); /* may be 0 for hardcoded shaders */
- FREE(prog->relocs);
- FREE(prog->fixups);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c 2022-02-11 15:30:18.641058844 -0600
-@@ -44,7 +44,7 @@ nvc0_hw_query_allocate(struct nvc0_conte
- if (hq->state == NVC0_HW_QUERY_STATE_READY)
- nouveau_mm_free(hq->mm);
- else
-- nouveau_fence_work(screen->base.fence.current,
-+ nouveau_fence_work(nvc0->base.fence,
- nouveau_mm_free_work, hq->mm);
- }
- }
-@@ -55,7 +55,7 @@ nvc0_hw_query_allocate(struct nvc0_conte
- return false;
- hq->offset = hq->base_offset;
-
-- ret = nouveau_bo_map(hq->bo, 0, screen->base.client);
-+ ret = BO_MAP(&screen->base, hq->bo, 0, nvc0->base.client);
- if (ret) {
- nvc0_hw_query_allocate(nvc0, q, 0);
- return false;
-@@ -129,7 +129,7 @@ nvc0_hw_query_write_compute_invocations(
- {
- struct nouveau_pushbuf *push = nvc0->base.pushbuf;
-
-- nouveau_pushbuf_space(push, 16, 0, 8);
-+ PUSH_SPACE_EX(push, 16, 0, 8);
- PUSH_REFN(push, hq->bo, NOUVEAU_BO_GART | NOUVEAU_BO_WR);
- BEGIN_1IC0(push, NVC0_3D(MACRO_COMPUTE_COUNTER_TO_QUERY), 4);
- PUSH_DATA (push, nvc0->compute_invocations);
-@@ -301,7 +301,7 @@ nvc0_hw_end_query(struct nvc0_context *n
- break;
- }
- if (hq->is64bit)
-- nouveau_fence_ref(nvc0->screen->base.fence.current, &hq->fence);
-+ nouveau_fence_ref(nvc0->base.fence, &hq->fence);
- }
-
- static bool
-@@ -319,7 +319,7 @@ nvc0_hw_get_query_result(struct nvc0_con
- return hq->funcs->get_query_result(nvc0, hq, wait, result);
-
- if (hq->state != NVC0_HW_QUERY_STATE_READY)
-- nvc0_hw_query_update(nvc0->screen->base.client, q);
-+ nvc0_hw_query_update(nvc0->base.client, q);
-
- if (hq->state != NVC0_HW_QUERY_STATE_READY) {
- if (!wait) {
-@@ -330,7 +330,7 @@ nvc0_hw_get_query_result(struct nvc0_con
- }
- return false;
- }
-- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nvc0->screen->base.client))
-+ if (BO_WAIT(&nvc0->screen->base, hq->bo, NOUVEAU_BO_RD, nvc0->base.client))
- return false;
- NOUVEAU_DRV_STAT(&nvc0->screen->base, query_sync_count, 1);
- }
-@@ -403,7 +403,7 @@ nvc0_hw_get_query_result_resource(struct
- if (index == -1) {
- /* TODO: Use a macro to write the availability of the query */
- if (hq->state != NVC0_HW_QUERY_STATE_READY)
-- nvc0_hw_query_update(nvc0->screen->base.client, q);
-+ nvc0_hw_query_update(nvc0->base.client, q);
- uint32_t ready[2] = {hq->state == NVC0_HW_QUERY_STATE_READY};
- nvc0->base.push_cb(&nvc0->base, buf, offset,
- result_type >= PIPE_QUERY_TYPE_I64 ? 2 : 1,
-@@ -412,7 +412,7 @@ nvc0_hw_get_query_result_resource(struct
- util_range_add(&buf->base, &buf->valid_buffer_range, offset,
- offset + (result_type >= PIPE_QUERY_TYPE_I64 ? 8 : 4));
-
-- nvc0_resource_validate(buf, NOUVEAU_BO_WR);
-+ nvc0_resource_validate(nvc0, buf, NOUVEAU_BO_WR);
-
- return;
- }
-@@ -420,7 +420,7 @@ nvc0_hw_get_query_result_resource(struct
- /* If the fence guarding this query has not been emitted, that makes a lot
- * of the following logic more complicated.
- */
-- if (hq->is64bit && hq->fence->state < NOUVEAU_FENCE_STATE_EMITTED)
-+ if (hq->is64bit)
- nouveau_fence_emit(hq->fence);
-
- /* We either need to compute a 32- or 64-bit difference between 2 values,
-@@ -430,12 +430,12 @@ nvc0_hw_get_query_result_resource(struct
- * outputs the difference (no need to worry about 64-bit clamping).
- */
- if (hq->state != NVC0_HW_QUERY_STATE_READY)
-- nvc0_hw_query_update(nvc0->screen->base.client, q);
-+ nvc0_hw_query_update(nvc0->base.client, q);
-
- if (wait && hq->state != NVC0_HW_QUERY_STATE_READY)
- nvc0_hw_query_fifo_wait(nvc0, q);
-
-- nouveau_pushbuf_space(push, 32, 2, 3);
-+ PUSH_SPACE_EX(push, 32, 2, 3);
- PUSH_REFN (push, hq->bo, NOUVEAU_BO_GART | NOUVEAU_BO_RD);
- PUSH_REFN (push, buf->bo, buf->domain | NOUVEAU_BO_WR);
- BEGIN_1IC0(push, NVC0_3D(MACRO_QUERY_BUFFER_WRITE), 9);
-@@ -511,7 +511,7 @@ nvc0_hw_get_query_result_resource(struct
- util_range_add(&buf->base, &buf->valid_buffer_range, offset,
- offset + (result_type >= PIPE_QUERY_TYPE_I64 ? 8 : 4));
-
-- nvc0_resource_validate(buf, NOUVEAU_BO_WR);
-+ nvc0_resource_validate(nvc0, buf, NOUVEAU_BO_WR);
- }
-
- static const struct nvc0_query_funcs hw_query_funcs = {
-@@ -642,7 +642,7 @@ nvc0_hw_query_fifo_wait(struct nvc0_cont
- unsigned offset = hq->offset;
-
- /* ensure the query's fence has been emitted */
-- if (hq->is64bit && hq->fence->state < NOUVEAU_FENCE_STATE_EMITTED)
-+ if (hq->is64bit)
- nouveau_fence_emit(hq->fence);
-
- PUSH_SPACE(push, 5);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_sm.c 2022-02-11 15:31:39.237707036 -0600
-@@ -2636,7 +2636,7 @@ nvc0_hw_sm_query_read_data(uint32_t coun
- if (hq->data[b + 8] != hq->sequence) {
- if (!wait)
- return false;
-- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nvc0->base.client))
-+ if (BO_WAIT(&nvc0->screen->base, hq->bo, NOUVEAU_BO_RD, nvc0->base.client))
- return false;
- }
- count[p][c] = hq->data[b + hsq->ctr[c]] * (1 << c);
-@@ -2664,7 +2664,7 @@ nve4_hw_sm_query_read_data(uint32_t coun
- if (hq->data[b + 20 + d] != hq->sequence) {
- if (!wait)
- return false;
-- if (nouveau_bo_wait(hq->bo, NOUVEAU_BO_RD, nvc0->base.client))
-+ if (BO_WAIT(&nvc0->screen->base, hq->bo, NOUVEAU_BO_RD, nvc0->base.client))
- return false;
- }
- if (hsq->ctr[c] & ~0x3)
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 2022-02-11 16:20:30.965275088 -0600
-@@ -701,8 +701,6 @@ nvc0_screen_destroy(struct pipe_screen *
- if (!nouveau_drm_screen_unref(&screen->base))
- return;
-
-- nouveau_fence_cleanup(&screen->base);
--
- if (screen->base.pushbuf)
- screen->base.pushbuf->user_priv = NULL;
-
-@@ -733,6 +731,7 @@ nvc0_screen_destroy(struct pipe_screen *
- nouveau_object_del(&screen->nvsw);
-
- nouveau_screen_fini(&screen->base);
-+ simple_mtx_destroy(&screen->state_lock);
-
- FREE(screen);
- }
-@@ -1058,6 +1057,8 @@ nvc0_screen_create(struct nouveau_device
- return NULL;
- pscreen = &screen->base.base;
- pscreen->destroy = nvc0_screen_destroy;
-+
-+ simple_mtx_init(&screen->state_lock, mtx_plain);
-
- ret = nouveau_screen_init(&screen->base, dev);
- if (ret)
-@@ -1109,7 +1110,7 @@ nvc0_screen_create(struct nouveau_device
- ret = nouveau_bo_new(dev, flags, 0, 4096, NULL, &screen->fence.bo);
- if (ret)
- FAIL_SCREEN_INIT("Error allocating fence BO: %d\n", ret);
-- nouveau_bo_map(screen->fence.bo, 0, NULL);
-+ BO_MAP(&screen->base, screen->fence.bo, 0, NULL);
- screen->fence.map = screen->fence.bo->map;
- screen->base.fence.emit = nvc0_screen_fence_emit;
- screen->base.fence.update = nvc0_screen_fence_update;
-@@ -1558,8 +1559,6 @@ nvc0_screen_create(struct nouveau_device
- if (!nvc0_blitter_create(screen))
- goto fail;
-
-- nouveau_fence_new(&screen->base, &screen->base.fence.current);
--
- return &screen->base;
-
- fail:
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h 2022-02-11 16:21:46.650277251 -0600
-@@ -71,6 +71,7 @@ struct nvc0_screen {
-
- struct nvc0_context *cur_ctx;
- struct nvc0_graph_state save_state;
-+ simple_mtx_t state_lock;
-
- int num_occlusion_queries_active;
-
-@@ -157,32 +158,6 @@ int nvc0_screen_resize_text_area(struct
- // 3D Only
- void nvc0_screen_bind_cb_3d(struct nvc0_screen *, bool *, int, int, int, uint64_t);
-
--static inline void
--nvc0_resource_fence(struct nv04_resource *res, uint32_t flags)
--{
-- struct nvc0_screen *screen = nvc0_screen(res->base.screen);
--
-- if (res->mm) {
-- nouveau_fence_ref(screen->base.fence.current, &res->fence);
-- if (flags & NOUVEAU_BO_WR)
-- nouveau_fence_ref(screen->base.fence.current, &res->fence_wr);
-- }
--}
--
--static inline void
--nvc0_resource_validate(struct nv04_resource *res, uint32_t flags)
--{
-- if (likely(res->bo)) {
-- if (flags & NOUVEAU_BO_WR)
-- res->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING |
-- NOUVEAU_BUFFER_STATUS_DIRTY;
-- if (flags & NOUVEAU_BO_RD)
-- res->status |= NOUVEAU_BUFFER_STATUS_GPU_READING;
--
-- nvc0_resource_fence(res, flags);
-- }
--}
--
- struct nvc0_format {
- uint32_t rt;
- struct {
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c 2022-02-11 16:24:08.657161261 -0600
-@@ -71,6 +71,7 @@ nvc0_program_sp_start_id(struct nvc0_con
- {
- struct nouveau_pushbuf *push = nvc0->base.pushbuf;
-
-+ simple_mtx_assert_locked(&nvc0->screen->state_lock);
- if (nvc0->screen->eng3d->oclass < GV100_3D_CLASS) {
- BEGIN_NVC0(push, NVC0_3D(SP_START_ID(stage)), 1);
- PUSH_DATA (push, prog->code_base);
-@@ -338,6 +339,8 @@ nvc0_tfb_validate(struct nvc0_context *n
- }
- }
- }
-+
-+ simple_mtx_assert_locked(&nvc0->screen->state_lock);
- nvc0->state.tfb = tfb;
-
- if (!(nvc0->dirty_3d & NVC0_NEW_3D_TFB_TARGETS))
-@@ -364,7 +367,7 @@ nvc0_tfb_validate(struct nvc0_context *n
-
- if (!targ->clean)
- nvc0_hw_query_fifo_wait(nvc0, nvc0_query(targ->pq));
-- nouveau_pushbuf_space(push, 0, 0, 1);
-+ PUSH_SPACE_EX(push, 0, 0, 1);
- BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
- PUSH_DATA (push, 1);
- PUSH_DATAh(push, buf->address + targ->pipe.buffer_offset);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_state.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_state.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_state.c 2022-02-11 16:25:08.106073895 -0600
-@@ -635,9 +635,12 @@ nvc0_sp_state_create(struct pipe_context
- static void
- nvc0_sp_state_delete(struct pipe_context *pipe, void *hwcso)
- {
-+ struct nvc0_context *nvc0 = nvc0_context(pipe);
- struct nvc0_program *prog = (struct nvc0_program *)hwcso;
-
-+ simple_mtx_lock(&nvc0->screen->state_lock);
- nvc0_program_destroy(nvc0_context(pipe), prog);
-+ simple_mtx_unlock(&nvc0->screen->state_lock);
-
- if (prog->pipe.type == PIPE_SHADER_IR_TGSI)
- FREE((void *)prog->pipe.tokens);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c 2022-02-11 16:26:48.061884623 -0600
-@@ -253,7 +253,7 @@ nvc0_validate_fb(struct nvc0_context *nv
- PUSH_DATA(push, 0);
- PUSH_DATA(push, 0);
-
-- nvc0_resource_fence(res, NOUVEAU_BO_WR);
-+ nvc0_resource_fence(nvc0, res, NOUVEAU_BO_WR);
-
- assert(!fb->zsbuf);
- }
-@@ -871,6 +871,7 @@ nvc0_switch_pipe_context(struct nvc0_con
- struct nvc0_context *ctx_from = ctx_to->screen->cur_ctx;
- unsigned s;
-
-+ simple_mtx_assert_locked(&ctx_to->screen->state_lock);
- if (ctx_from)
- ctx_to->state = ctx_from->state;
- else
-@@ -967,6 +968,8 @@ nvc0_state_validate(struct nvc0_context
- int ret;
- unsigned i;
-
-+ simple_mtx_assert_locked(&nvc0->screen->state_lock);
-+
- if (nvc0->screen->cur_ctx != nvc0)
- nvc0_switch_pipe_context(nvc0);
-
-@@ -985,7 +988,7 @@ nvc0_state_validate(struct nvc0_context
- }
-
- nouveau_pushbuf_bufctx(nvc0->base.pushbuf, bufctx);
-- ret = nouveau_pushbuf_validate(nvc0->base.pushbuf);
-+ ret = PUSH_VAL(nvc0->base.pushbuf);
-
- return !ret;
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c 2022-02-11 16:33:12.692802344 -0600
-@@ -267,7 +267,7 @@ nvc0_resource_copy_region(struct pipe_co
- BCTX_REFN(nvc0->bufctx, 2D, nv04_resource(src), RD);
- BCTX_REFN(nvc0->bufctx, 2D, nv04_resource(dst), WR);
- nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx);
-- nouveau_pushbuf_validate(nvc0->base.pushbuf);
-+ PUSH_VAL(nvc0->base.pushbuf);
-
- for (; dst_layer < dstz + src_box->depth; ++dst_layer, ++src_layer) {
- ret = nvc0_2d_texture_do_copy(nvc0->base.pushbuf,
-@@ -348,7 +348,7 @@ nvc0_clear_render_target(struct pipe_con
- IMMED_NVC0(push, NVC0_3D(MULTISAMPLE_MODE), 0);
-
- /* tiled textures don't have to be fenced, they're not mapped directly */
-- nvc0_resource_fence(res, NOUVEAU_BO_WR);
-+ nvc0_resource_fence(nvc0, res, NOUVEAU_BO_WR);
- }
-
- if (!render_condition_enabled)
-@@ -379,7 +379,7 @@ nvc0_clear_buffer_push_nvc0(struct pipe_
-
- nouveau_bufctx_refn(nvc0->bufctx, 0, buf->bo, buf->domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, nvc0->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- unsigned count = (size + 3) / 4;
- unsigned data_words = data_size / 4;
-@@ -410,7 +410,7 @@ nvc0_clear_buffer_push_nvc0(struct pipe_
- size -= nr * 4;
- }
-
-- nvc0_resource_validate(buf, NOUVEAU_BO_WR);
-+ nvc0_resource_validate(nvc0, buf, NOUVEAU_BO_WR);
-
- nouveau_bufctx_reset(nvc0->bufctx, 0);
- }
-@@ -428,7 +428,7 @@ nvc0_clear_buffer_push_nve4(struct pipe_
-
- nouveau_bufctx_refn(nvc0->bufctx, 0, buf->bo, buf->domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, nvc0->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- unsigned count = (size + 3) / 4;
- unsigned data_words = data_size / 4;
-@@ -457,7 +457,7 @@ nvc0_clear_buffer_push_nve4(struct pipe_
- size -= nr * 4;
- }
-
-- nvc0_resource_validate(buf, NOUVEAU_BO_WR);
-+ nvc0_resource_validate(nvc0, buf, NOUVEAU_BO_WR);
-
- nouveau_bufctx_reset(nvc0->bufctx, 0);
- }
-@@ -604,7 +604,7 @@ nvc0_clear_buffer(struct pipe_context *p
-
- IMMED_NVC0(push, NVC0_3D(COND_MODE), nvc0->cond_condmode);
-
-- nvc0_resource_validate(buf, NOUVEAU_BO_WR);
-+ nvc0_resource_validate(nvc0, buf, NOUVEAU_BO_WR);
-
- if (width * height != elements) {
- offset += width * height * data_size;
-@@ -700,9 +700,11 @@ nvc0_clear(struct pipe_context *pipe, un
- unsigned i, j, k;
- uint32_t mode = 0;
-
-+ simple_mtx_lock(&nvc0->screen->state_lock);
-+
- /* don't need NEW_BLEND, COLOR_MASK doesn't affect CLEAR_BUFFERS */
- if (!nvc0_state_validate_3d(nvc0, NVC0_NEW_3D_FRAMEBUFFER))
-- return;
-+ goto out;
-
- if (scissor_state) {
- uint32_t minx = scissor_state->minx;
-@@ -710,7 +712,7 @@ nvc0_clear(struct pipe_context *pipe, un
- uint32_t miny = scissor_state->miny;
- uint32_t maxy = MIN2(fb->height, scissor_state->maxy);
- if (maxx <= minx || maxy <= miny)
-- return;
-+ goto out;
-
- BEGIN_NVC0(push, NVC0_3D(SCREEN_SCISSOR_HORIZ), 2);
- PUSH_DATA (push, minx | (maxx - minx) << 16);
-@@ -781,6 +783,9 @@ nvc0_clear(struct pipe_context *pipe, un
- PUSH_DATA (push, fb->width << 16);
- PUSH_DATA (push, fb->height << 16);
- }
-+
-+out:
-+ simple_mtx_unlock(&nvc0->screen->state_lock);
- }
-
- static void
-@@ -789,8 +794,10 @@ gm200_evaluate_depth_buffer(struct pipe_
- struct nvc0_context *nvc0 = nvc0_context(pipe);
- struct nouveau_pushbuf *push = nvc0->base.pushbuf;
-
-+ simple_mtx_lock(&nvc0->screen->state_lock);
- nvc0_state_validate_3d(nvc0, NVC0_NEW_3D_FRAMEBUFFER);
- IMMED_NVC0(push, SUBC_3D(0x11fc), 1);
-+ simple_mtx_unlock(&nvc0->screen->state_lock);
- }
-
-
-@@ -1327,7 +1334,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0,
- NOUVEAU_BO_GART | NOUVEAU_BO_RD, vtxbuf_bo);
- BCTX_REFN_bo(nvc0->bufctx_3d, 3D_TEXT,
- NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_RD, screen->text);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- BEGIN_NVC0(push, NVC0_3D(VERTEX_ARRAY_FETCH(0)), 4);
- PUSH_DATA (push, NVC0_3D_VERTEX_ARRAY_FETCH_ENABLE | stride <<
-@@ -1549,7 +1556,7 @@ nvc0_blit_eng2d(struct nvc0_context *nvc
- BCTX_REFN(nvc0->bufctx, 2D, &dst->base, WR);
- BCTX_REFN(nvc0->bufctx, 2D, &src->base, RD);
- nouveau_pushbuf_bufctx(nvc0->base.pushbuf, nvc0->bufctx);
-- if (nouveau_pushbuf_validate(nvc0->base.pushbuf))
-+ if (PUSH_VAL(nvc0->base.pushbuf))
- return;
-
- for (i = 0; i < info->dst.box.depth; ++i) {
-@@ -1589,8 +1596,8 @@ nvc0_blit_eng2d(struct nvc0_context *nvc
- PUSH_DATA (push, srcy >> 32);
- }
- }
-- nvc0_resource_validate(&dst->base, NOUVEAU_BO_WR);
-- nvc0_resource_validate(&src->base, NOUVEAU_BO_RD);
-+ nvc0_resource_validate(nvc0, &dst->base, NOUVEAU_BO_WR);
-+ nvc0_resource_validate(nvc0, &src->base, NOUVEAU_BO_RD);
-
- nouveau_bufctx_reset(nvc0->bufctx, NVC0_BIND_2D);
-
-@@ -1684,6 +1691,7 @@ nvc0_blit(struct pipe_context *pipe, con
- if (info->num_window_rectangles > 0 || info->window_rectangle_include)
- eng3d = true;
-
-+ simple_mtx_lock(&nvc0->screen->state_lock);
- if (nvc0->screen->num_occlusion_queries_active)
- IMMED_NVC0(push, NVC0_3D(SAMPLECNT_ENABLE), 0);
-
-@@ -1694,6 +1702,7 @@ nvc0_blit(struct pipe_context *pipe, con
-
- if (nvc0->screen->num_occlusion_queries_active)
- IMMED_NVC0(push, NVC0_3D(SAMPLECNT_ENABLE), 1);
-+ simple_mtx_unlock(&nvc0->screen->state_lock);
-
- NOUVEAU_DRV_STAT(&nvc0->screen->base, tex_blit_count, 1);
- }
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c 2022-02-11 16:36:06.082194000 -0600
-@@ -32,7 +32,7 @@ nvc0_m2mf_transfer_rect(struct nvc0_cont
- nouveau_bufctx_refn(bctx, 0, src->bo, src->domain | NOUVEAU_BO_RD);
- nouveau_bufctx_refn(bctx, 0, dst->bo, dst->domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- if (nouveau_bo_memtype(src->bo)) {
- BEGIN_NVC0(push, NVC0_M2MF(TILING_MODE_IN), 5);
-@@ -138,7 +138,7 @@ nve4_m2mf_transfer_rect(struct nvc0_cont
- nouveau_bufctx_refn(bctx, 0, dst->bo, dst->domain | NOUVEAU_BO_WR);
- nouveau_bufctx_refn(bctx, 0, src->bo, src->domain | NOUVEAU_BO_RD);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- exec = NVE4_COPY_EXEC_SWIZZLE_ENABLE | NVE4_COPY_EXEC_2D_ENABLE | NVE4_COPY_EXEC_FLUSH | NVE4_COPY_EXEC_COPY_MODE_NON_PIPELINED;
-
-@@ -207,7 +207,7 @@ nvc0_m2mf_push_linear(struct nouveau_con
-
- nouveau_bufctx_refn(nvc0->bufctx, 0, dst, domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, nvc0->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- while (count) {
- unsigned nr = MIN2(count, NV04_PFIFO_MAX_PACKET_LEN);
-@@ -249,7 +249,7 @@ nve4_p2mf_push_linear(struct nouveau_con
-
- nouveau_bufctx_refn(nvc0->bufctx, 0, dst, domain | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, nvc0->bufctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- while (count) {
- unsigned nr = MIN2(count, (NV04_PFIFO_MAX_PACKET_LEN - 1));
-@@ -289,7 +289,7 @@ nvc0_m2mf_copy_linear(struct nouveau_con
- nouveau_bufctx_refn(bctx, 0, src, srcdom | NOUVEAU_BO_RD);
- nouveau_bufctx_refn(bctx, 0, dst, dstdom | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- while (size) {
- unsigned bytes = MIN2(size, 1 << 17);
-@@ -327,7 +327,7 @@ nve4_m2mf_copy_linear(struct nouveau_con
- nouveau_bufctx_refn(bctx, 0, src, srcdom | NOUVEAU_BO_RD);
- nouveau_bufctx_refn(bctx, 0, dst, dstdom | NOUVEAU_BO_WR);
- nouveau_pushbuf_bufctx(push, bctx);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- BEGIN_NVC0(push, NVE4_COPY(SRC_ADDRESS_HIGH), 4);
- PUSH_DATAh(push, src->offset + srcoff);
-@@ -362,7 +362,7 @@ nvc0_mt_sync(struct nvc0_context *nvc0,
- if (!mt->base.mm) {
- uint32_t access = (usage & PIPE_MAP_WRITE) ?
- NOUVEAU_BO_WR : NOUVEAU_BO_RD;
-- return !nouveau_bo_wait(mt->base.bo, access, nvc0->base.client);
-+ return !BO_WAIT(&nvc0->screen->base, mt->base.bo, access, nvc0->base.client);
- }
- if (usage & PIPE_MAP_WRITE)
- return !mt->base.fence || nouveau_fence_wait(mt->base.fence, &nvc0->base.debug);
-@@ -388,7 +388,7 @@ nvc0_miptree_transfer_map(struct pipe_co
- if (nvc0_mt_transfer_can_map_directly(mt)) {
- ret = !nvc0_mt_sync(nvc0, mt, usage);
- if (!ret)
-- ret = nouveau_bo_map(mt->base.bo, 0, NULL);
-+ ret = BO_MAP(nvc0->base.screen, mt->base.bo, 0, NULL);
- if (ret &&
- (usage & PIPE_MAP_DIRECTLY))
- return NULL;
-@@ -480,7 +480,7 @@ nvc0_miptree_transfer_map(struct pipe_co
- if (usage & PIPE_MAP_WRITE)
- flags |= NOUVEAU_BO_WR;
-
-- ret = nouveau_bo_map(tx->rect[1].bo, flags, nvc0->screen->base.client);
-+ ret = BO_MAP(nvc0->base.screen, tx->rect[1].bo, flags, nvc0->screen->base.client);
- if (ret) {
- pipe_resource_reference(&tx->base.resource, NULL);
- nouveau_bo_ref(NULL, &tx->rect[1].bo);
-@@ -521,7 +521,7 @@ nvc0_miptree_transfer_unmap(struct pipe_
- NOUVEAU_DRV_STAT(&nvc0->screen->base, tex_transfers_wr, 1);
-
- /* Allow the copies above to finish executing before freeing the source */
-- nouveau_fence_work(nvc0->screen->base.fence.current,
-+ nouveau_fence_work(nvc0->base.fence,
- nouveau_fence_unref_bo, tx->rect[1].bo);
- } else {
- nouveau_bo_ref(NULL, &tx->rect[1].bo);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c 2022-02-11 16:37:55.523785563 -0600
-@@ -462,6 +462,7 @@ nvc0_vertex_arrays_validate(struct nvc0_
- if (update_vertex) {
- const unsigned n = MAX2(vertex->num_elements, nvc0->state.num_vtxelts);
-
-+ simple_mtx_assert_locked(&nvc0->screen->state_lock);
- nvc0->state.constant_vbos = const_vbos;
- nvc0->state.constant_elts = 0;
- nvc0->state.num_vtxelts = vertex->num_elements;
-@@ -788,7 +789,7 @@ nvc0_draw_stream_output(struct nvc0_cont
- }
-
- while (num_instances--) {
-- nouveau_pushbuf_space(push, 16, 0, 1);
-+ PUSH_SPACE_EX(push, 16, 0, 1);
- BEGIN_NVC0(push, NVC0_3D(VERTEX_BEGIN_GL), 1);
- PUSH_DATA (push, mode);
- BEGIN_NVC0(push, NVC0_3D(DRAW_TFB_BASE), 1);
-@@ -869,7 +870,7 @@ nvc0_draw_indirect(struct nvc0_context *
- pushes = draws;
- }
-
-- nouveau_pushbuf_space(push, 16, 0, pushes + !!buf_count);
-+ PUSH_SPACE_EX(push, 16, 0, pushes + !!buf_count);
- PUSH_REFN(push, buf->bo, NOUVEAU_BO_RD | buf->domain);
- if (buf_count)
- PUSH_REFN(push, buf_count->bo, NOUVEAU_BO_RD | buf_count->domain);
-@@ -1024,6 +1025,8 @@ nvc0_draw_vbo(struct pipe_context *pipe,
- BCTX_REFN_bo(nvc0->bufctx_3d, 3D_TEXT, vram_domain | NOUVEAU_BO_RD,
- screen->text);
-
-+ simple_mtx_lock(&nvc0->screen->state_lock);
-+
- nvc0_state_validate_3d(nvc0, ~0);
-
- if (nvc0->vertprog->vp.need_draw_parameters && (!indirect || indirect->count_from_stream_output)) {
-@@ -1131,6 +1134,8 @@ nvc0_draw_vbo(struct pipe_context *pipe,
- }
-
- cleanup:
-+ simple_mtx_unlock(&nvc0->screen->state_lock);
-+
- push->kick_notify = nvc0_default_kick_notify;
-
- nvc0_release_user_vbufs(nvc0);
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_vbo_translate.c 2022-02-11 16:38:16.159706821 -0600
-@@ -239,7 +239,7 @@ nvc0_push_setup_vertex_array(struct nvc0
-
- BCTX_REFN_bo(nvc0->bufctx_3d, 3D_VTX_TMP, NOUVEAU_BO_GART | NOUVEAU_BO_RD,
- bo);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- return dest;
- }
-@@ -731,7 +731,7 @@ nvc0_push_upload_vertex_ids(struct push_
-
- BCTX_REFN_bo(nvc0->bufctx_3d, 3D_VTX_TMP, NOUVEAU_BO_GART | NOUVEAU_BO_RD,
- bo);
-- nouveau_pushbuf_validate(push);
-+ PUSH_VAL(push);
-
- if (info->index_size) {
- if (!draw->index_bias) {
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c 2022-02-11 16:42:26.561716987 -0600
-@@ -34,10 +34,11 @@ static void dump_comm_bsp(struct comm *c
- unsigned
- nvc0_decoder_bsp_begin(struct nouveau_vp3_decoder *dec, unsigned comm_seq)
- {
-+ struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
- struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
- unsigned ret = 0;
-
-- ret = nouveau_bo_map(bsp_bo, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, bsp_bo, NOUVEAU_BO_WR, dec->client);
- if (ret) {
- debug_printf("map failed: %i %s\n", ret, strerror(-ret));
- return -1;
-@@ -53,6 +54,7 @@ nvc0_decoder_bsp_next(struct nouveau_vp3
- unsigned comm_seq, unsigned num_buffers,
- const void *const *data, const unsigned *num_bytes)
- {
-+ struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
- struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
- struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1];
- uint32_t bsp_size = 0;
-@@ -82,7 +84,7 @@ nvc0_decoder_bsp_next(struct nouveau_vp3
- return -1;
- }
-
-- ret = nouveau_bo_map(tmp_bo, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen,tmp_bo, NOUVEAU_BO_WR, dec->client);
- if (ret) {
- debug_printf("map failed: %i %s\n", ret, strerror(-ret));
- return -1;
-@@ -114,7 +116,7 @@ nvc0_decoder_bsp_next(struct nouveau_vp3
- return -1;
- }
-
-- ret = nouveau_bo_map(tmp_bo, NOUVEAU_BO_WR, dec->client);
-+ ret = BO_MAP(screen, tmp_bo, NOUVEAU_BO_WR, dec->client);
- if (ret) {
- debug_printf("map failed: %i %s\n", ret, strerror(-ret));
- return -1;
-@@ -160,7 +162,7 @@ nvc0_decoder_bsp_end(struct nouveau_vp3_
-
- nouveau_vp3_vp_caps(dec, desc, target, comm_seq, vp_caps, is_ref, refs);
-
-- nouveau_pushbuf_space(push, 32, num_refs, 0);
-+ PUSH_SPACE_EX(push, 32, num_refs, 0);
- nouveau_pushbuf_refn(push, bo_refs, num_refs);
-
- bsp_addr = bsp_bo->offset >> 8;
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video.c 2022-02-11 18:09:21.787821149 -0600
-@@ -91,7 +91,8 @@ struct pipe_video_codec *
- nvc0_create_decoder(struct pipe_context *context,
- const struct pipe_video_codec *templ)
- {
-- struct nouveau_screen *screen = &((struct nvc0_context *)context)->screen->base;
-+ struct nvc0_context *nvc0 = nvc0_context(context);
-+ struct nouveau_screen *screen = &nvc0->screen->base;
- struct nouveau_vp3_decoder *dec;
- struct nouveau_pushbuf **push;
- union nouveau_bo_config cfg;
-@@ -116,7 +117,7 @@ nvc0_create_decoder(struct pipe_context
- dec = CALLOC_STRUCT(nouveau_vp3_decoder);
- if (!dec)
- return NULL;
-- dec->client = screen->client;
-+ dec->client = nvc0->base.client;
- dec->base = *templ;
- nouveau_vp3_decoder_init_common(&dec->base);
-
-@@ -160,7 +161,7 @@ nvc0_create_decoder(struct pipe_context
- data, size, &dec->channel[i]);
-
- if (!ret)
-- ret = nouveau_pushbuf_new(screen->client, dec->channel[i], 4,
-+ ret = nouveau_pushbuf_new(nvc0->base.client, dec->channel[i], 4,
- 32 * 1024, true, &dec->pushbuf[i]);
- if (ret)
- break;
-@@ -292,13 +293,13 @@ nvc0_create_decoder(struct pipe_context
- if (ret)
- goto fail;
-
-- nouveau_bo_map(dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
-+ BO_MAP(dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
- dec->fence_map = dec->fence_bo->map;
- dec->fence_map[0] = dec->fence_map[4] = dec->fence_map[8] = 0;
- dec->comm = (struct comm *)(dec->fence_map + (COMM_OFFSET/sizeof(*dec->fence_map)));
-
- /* So lets test if the fence is working? */
-- nouveau_pushbuf_space(push[0], 16, 1, 0);
-+ PUSH_SPACE_EX(push[0], 16, 1, 0);
- PUSH_REFN (push[0], dec->fence_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR);
- BEGIN_NVC0(push[0], SUBC_BSP(0x240), 3);
- PUSH_DATAh(push[0], dec->fence_bo->offset);
-@@ -309,7 +310,7 @@ nvc0_create_decoder(struct pipe_context
- PUSH_DATA (push[0], 0);
- PUSH_KICK (push[0]);
-
-- nouveau_pushbuf_space(push[1], 16, 1, 0);
-+ PUSH_SPACE_EX(push[1], 16, 1, 0);
- PUSH_REFN (push[1], dec->fence_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR);
- BEGIN_NVC0(push[1], SUBC_VP(0x240), 3);
- PUSH_DATAh(push[1], (dec->fence_bo->offset + 0x10));
-@@ -320,7 +321,7 @@ nvc0_create_decoder(struct pipe_context
- PUSH_DATA (push[1], 0);
- PUSH_KICK (push[1]);
-
-- nouveau_pushbuf_space(push[2], 16, 1, 0);
-+ PUSH_SPACE_EX(push[2], 16, 1, 0);
- PUSH_REFN (push[2], dec->fence_bo, NOUVEAU_BO_GART|NOUVEAU_BO_RDWR);
- BEGIN_NVC0(push[2], SUBC_PPP(0x240), 3);
- PUSH_DATAh(push[2], (dec->fence_bo->offset + 0x20));
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video_ppp.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video_ppp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video_ppp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video_ppp.c 2022-02-11 16:42:38.048670313 -0600
-@@ -94,7 +94,7 @@ nvc0_decoder_ppp(struct nouveau_vp3_deco
- struct nouveau_pushbuf *push = dec->pushbuf[2];
- unsigned ppp_caps = 0x10;
-
-- nouveau_pushbuf_space(push, 32, 4, 0);
-+ PUSH_SPACE_EX(push, 32, 4, 0);
-
- switch (codec) {
- case PIPE_VIDEO_FORMAT_MPEG12: {
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c 2022-02-11 16:43:16.978511453 -0600
-@@ -44,7 +44,7 @@ static void dump_comm_vp(struct nouveau_
-
- if ((comm->pvp_stage & 0xff) != 0xff) {
- unsigned *map;
-- int ret = nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
-+ int ret = BO_MAP(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
- assert(ret >= 0);
- map = inter_bo->map;
- for (i = 0; i < comm->byte_ofs + slice_size; i += 0x10) {
-@@ -111,7 +111,7 @@ nvc0_decoder_vp(struct nouveau_vp3_decod
- if (!is_ref && (dec->refs[target->valid_ref].decoded_top && dec->refs[target->valid_ref].decoded_bottom))
- nvc0_decoder_kick_ref(dec, target);
-
-- nouveau_pushbuf_space(push, 32 + codec_extra, num_refs, 0);
-+ PUSH_SPACE_EX(push, 32 + codec_extra, num_refs, 0);
-
- nouveau_pushbuf_refn(push, bo_refs, num_refs);
-
-diff -Naurp mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nve4_compute.c mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
---- mesa-21.3.6.orig/src/gallium/drivers/nouveau/nvc0/nve4_compute.c 2022-02-09 14:10:39.000000000 -0600
-+++ mesa-21.3.6/src/gallium/drivers/nouveau/nvc0/nve4_compute.c 2022-02-11 16:44:39.346172201 -0600
-@@ -545,7 +545,7 @@ nve4_compute_upload_input(struct nvc0_co
- struct nv04_resource *res = nv04_resource(info->indirect);
- uint32_t offset = res->offset + info->indirect_offset;
-
-- nouveau_pushbuf_space(push, 32, 0, 1);
-+ PUSH_SPACE_EX(push, 32, 0, 1);
- PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);
-
- BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + 8);
-@@ -829,7 +829,7 @@ nve4_upload_indirect_desc(struct nouveau
- PUSH_DATA (push, length);
- PUSH_DATA (push, 1);
-
-- nouveau_pushbuf_space(push, 32, 0, 1);
-+ PUSH_SPACE_EX(push, 32, 0, 1);
- PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);
-
- BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + (length / 4));
-@@ -867,9 +867,10 @@ nve4_launch_grid(struct pipe_context *pi
- resident->flags);
- }
-
-+ simple_mtx_lock(&screen->state_lock);
- ret = !nve4_state_validate_cp(nvc0, ~0);
- if (ret)
-- goto out;
-+ goto out_unlock;
-
- if (nvc0->screen->compute->oclass >= GV100_COMPUTE_CLASS)
- gv100_compute_setup_launch_desc(nvc0, desc, info);
-@@ -923,7 +924,7 @@ nve4_launch_grid(struct pipe_context *pi
- }
-
- /* upload descriptor and flush */
-- nouveau_pushbuf_space(push, 32, 1, 0);
-+ PUSH_SPACE_EX(push, 32, 1, 0);
- PUSH_REFN(push, screen->text, NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_RD);
- BEGIN_NVC0(push, NVE4_CP(LAUNCH_DESC_ADDRESS), 1);
- PUSH_DATA (push, desc_gpuaddr >> 8);
-@@ -934,6 +935,9 @@ nve4_launch_grid(struct pipe_context *pi
-
- nvc0_update_compute_invocations_counter(nvc0, info);
-
-+out_unlock:
-+ simple_mtx_unlock(&screen->state_lock);
-+
- out:
- if (ret)
- NOUVEAU_ERR("Failed to launch grid !\n");
-@@ -1031,7 +1035,7 @@ nve4_compute_trap_info(struct nvc0_conte
- volatile struct nve4_mp_trap_info *info;
- uint8_t *map;
-
-- ret = nouveau_bo_map(bo, NOUVEAU_BO_RDWR, nvc0->base.client);
-+ ret = BO_MAP(bo, NOUVEAU_BO_RDWR, nvc0->base.client);
- if (ret)
- return;
- map = (uint8_t *)bo->map;
diff --git a/repo/mesa/mesa.xibuild b/repo/mesa/mesa.xibuild
index 45b1ba0..81a3549 100644
--- a/repo/mesa/mesa.xibuild
+++ b/repo/mesa/mesa.xibuild
@@ -1,17 +1,14 @@
#!/bin/sh
-MAKEDEPS="meson ninja python-mako libvdpau llvm libxxf86vm libelf lm-sensors expat wayland-protocols llvm"
+MAKEDEPS="meson ninja python-mako libvdpau llvm libxxf86vm libelf lm-sensors expat wayland-protocols llvm libxshmfence libdrm libxrandr"
DEPS="xorg-libs libdrm"
PKG_VER=22.1.7
SOURCE=https://mesa.freedesktop.org/archive/mesa-$PKG_VER.tar.xz
ADDITIONAL="
+ 0001-freedreno-Enable-A619.patch
0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch
- add-use-elf-tls.patch
disable-rgb10-by-default.patch
- mesa-21.3.7-add_xdemos-1.patch
- mesa-21.3.7-nouveau_fixes-1.patch
- musl-fix-includes.patch
"
DESC="An implementation of the OpenGL specification"
@@ -20,16 +17,15 @@ prepare () {
apply_patches
export GALLIUM_DRV="crocus,i915,iris,nouveau,r600,radeonsi,svga,swrast,virgl"
- export DRI_DRIVERS="i965,nouveau"
+ #export DRI_DRIVERS="i965,nouveau"
}
build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX \
+ meson --prefix=/usr \
--buildtype=release \
- -Ddri-drivers=$DRI_DRIVERS \
-Dgallium-drivers=$GALLIUM_DRV \
-Dplatforms=x11,wayland \
-Dgallium-nine=false \
@@ -43,6 +39,7 @@ build () {
-Dvalgrind=disabled \
-Dlibunwind=disabled \
.. &&
+ #-Ddri-drivers=$DRI_DRIVERS \
unset GALLIUM_DRV DRI_DRIVERS &&
diff --git a/repo/mesa/musl-fix-includes.patch b/repo/mesa/musl-fix-includes.patch
deleted file mode 100644
index 8553d44..0000000
--- a/repo/mesa/musl-fix-includes.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c
-index 81b64f1ea71..14e6c9d27c3 100644
---- a/src/util/rand_xor.c
-+++ b/src/util/rand_xor.c
-@@ -27,6 +27,8 @@
- #if !DETECT_OS_WINDOWS
- #if defined(HAVE_GETRANDOM)
- #include <sys/random.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
- #endif
- #include <unistd.h>
- #include <fcntl.h>
diff --git a/repo/meson/fix-ninja-output-test.patch b/repo/meson/fix-ninja-output-test.patch
new file mode 100644
index 0000000..5706d84
--- /dev/null
+++ b/repo/meson/fix-ninja-output-test.patch
@@ -0,0 +1,12 @@
+the tests parse the tool output and expect one of the strings to match-
+samurai outputs slightly different strings, and hence breaks the tests
+--- a/unittests/baseplatformtests.py
++++ b/unittests/baseplatformtests.py
+@@ -82,5 +82,5 @@
+ self.orig_env = os.environ.copy()
+ if self.backend is Backend.ninja:
+- self.no_rebuild_stdout = ['ninja: no work to do.', 'samu: nothing to do']
++ self.no_rebuild_stdout = ['ninja: no work to do.', 'samu: nothing to do', 'samu: explain all: phony and no inputs']
+ else:
+ # VS doesn't have a stable output when no changes are done
+
diff --git a/repo/meson/meson.xibuild b/repo/meson/meson.xibuild
index b3dfcf4..722b7b8 100644
--- a/repo/meson/meson.xibuild
+++ b/repo/meson/meson.xibuild
@@ -3,7 +3,7 @@
NAME="meson"
DESC="Fast and user friendly build system"
-MAKEDEPS="python-setuptools"
+MAKEDEPS="python-setuptools ninja"
PKG_VER=0.63.2
SOURCE="https://github.com/mesonbuild/meson/releases/download/$PKG_VER/meson-$PKG_VER.tar.gz"
@@ -24,19 +24,22 @@ build() {
python setup.py build
}
-check() {
- MESON_CI_JOBNAME=thirdparty \
- NINJA=samu \
- NINJA_1_9_OR_NEWER=1 \
- python3 run_tests.py
-}
+#check() {
+ #MESON_CI_JOBNAME=thirdparty \
+ #NINJA_1_9_OR_NEWER=1 \
+ #python3 run_tests.py
+#}
package() {
python setup.py install --prefix=/usr --root="$PKG_DEST"
- install -Dm644 data/shell-completions/zsh/* -t "$PKG_DEST"/usr/share/zsh/site-functions
- install -Dm644 data/shell-completions/bash/* -t "$PKG_DEST"/usr/share/bash-completion/completions
+ for f in data/shell-completions/zsh/*; do
+ install -Dm644 $f "$PKG_DEST"/usr/share/zsh/site-functions
+ done
+
+ for f in data/shell-completions/bash/*; do
+ install -Dm644 $f "$PKG_DEST"/usr/share/bash-completion/completions
+ done
- install -Dm0755 "$BUILD_ROOT"/meson --prefix=/usr \
- -t "$PKG_DEST"/usr/bin
+ install -Dm0755 "$BUILD_ROOT"/meson.py "$PKG_DEST"/usr/bin/meson
}
diff --git a/repo/meson/skip-broken-tests.patch b/repo/meson/skip-broken-tests.patch
new file mode 100644
index 0000000..09ea992
--- /dev/null
+++ b/repo/meson/skip-broken-tests.patch
@@ -0,0 +1,36 @@
+--- a/unittests/linuxliketests.py
++++ b/unittests/linuxliketests.py
+@@ -993,6 +993,8 @@
+ self.assertEqual(got_rpath, yonder_libdir, rpath_format)
+
+ @skip_if_not_base_option('b_sanitize')
++ # https://github.com/mesonbuild/meson/issues/8283
++ @unittest.skip('broken with improperly detected sanitizers')
+ def test_pch_with_address_sanitizer(self):
+ if is_cygwin():
+ raise SkipTest('asan not available on Cygwin')
+@@ -1192,6 +1192,7 @@
+ self.build()
+
+ @skipIfNoPkgconfig
++ @unittest.skip('fails because of GNU libintl mess on alpine :)')
+ def test_pkgconfig_formatting(self):
+ testdir = os.path.join(self.unit_test_dir, '38 pkgconfig format')
+ self.init(testdir)
+--- a/unittests/allplatformstests.py
++++ b/unittests/allplatformstests.py
+@@ -377,5 +377,6 @@
+ self.assertNotEqual(before, after)
+
++ @unittest.skip('samurai has a reverse order')
+ def test_static_compile_order(self):
+ '''
+ Test that the order of files in a compiler command-line while compiling
+@@ -3198,6 +3198,7 @@
+ else:
+ self.assertEqual(o, e)
+
++ @unittest.skip('broken with current version of samurai')
+ def test_meson_compile(self):
+ """Test the meson compile command."""
+
diff --git a/repo/mkfontscale/mkfontscale.xibuild b/repo/mkfontscale/mkfontscale.xibuild
index 4f32c83..c25030e 100644
--- a/repo/mkfontscale/mkfontscale.xibuild
+++ b/repo/mkfontscale/mkfontscale.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.1
SOURCE=https://www.x.org/pub/individual/app/mkfontscale-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/p7zip/p7zip.xibuild b/repo/p7zip/p7zip.xibuild
new file mode 100644
index 0000000..4e01b52
--- /dev/null
+++ b/repo/p7zip/p7zip.xibuild
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+NAME="p7zip"
+DESC="Command-line port of the 7zip compression utility"
+
+MAKEDEPS="bash nasm yasm"
+
+PKG_VER=17.04
+SOURCE="https://github.com/jinfeihan57/p7zip/archive/v$PKG_VER/p7zip-v$PKG_VER.tar.gz"
+
+prepare() {
+ local makefile="makefile.linux_any_cpu_gcc_4.X"
+ case "$CARCH" in
+ x86) makefile="makefile.linux_x86_asm_gcc_4.X" ;;
+ x86_64) makefile="makefile.linux_amd64_asm" ;;
+ esac
+
+ ln -sf $makefile makefile.machine
+
+ sed -e "s,g++,${CXX:-g++}," -i makefile.machine
+ sed -e "s,gcc,${CC:-gcc}," -i makefile.machine
+}
+
+build() {
+ make all3 OPTFLAGS="$CXXFLAGS -O2"
+}
+
+check() {
+ make test
+}
+
+package() {
+ make install DEST_DIR="$PKG_DEST" DEST_HOME="/usr" \
+ DEST_MAN="/usr/share/man" \
+ DEST_SHARE_DOC="/usr/share/doc/p7zip"
+
+ install -Dm755 contrib/gzip-like_CLI_wrapper_for_7z/p7zip \
+ "$PKG_DEST"/usr/bin/p7zip
+ install -Dm644 contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 \
+ "$PKG_DEST"/usr/share/man/man1/p7zip.1
+}
+
diff --git a/repo/pandoc/cabal.config b/repo/pandoc/cabal.config
new file mode 100644
index 0000000..19f0515
--- /dev/null
+++ b/repo/pandoc/cabal.config
@@ -0,0 +1,223 @@
+--2.19.1
+constraints: Cabal ==3.4.1.0,
+ Glob ==0.10.2,
+ HUnit ==1.6.2.0,
+ HsYAML ==0.2.1.1,
+ JuicyPixels ==3.3.8,
+ OneTuple ==0.3.1,
+ QuickCheck ==2.14.2,
+ SHA ==1.6.4.4,
+ StateVar ==1.2.2,
+ aeson ==2.1.0.0,
+ aeson-pretty ==0.8.9,
+ ansi-terminal ==0.11.3,
+ ansi-wl-pprint ==0.6.9,
+ appar ==0.1.8,
+ array ==0.5.4.0,
+ asn1-encoding ==0.9.6,
+ asn1-parse ==0.9.5,
+ asn1-types ==0.3.4,
+ assoc ==1.0.2,
+ async ==2.2.4,
+ attoparsec ==0.14.4,
+ attoparsec-iso8601 ==1.0.2.1,
+ auto-update ==0.1.6,
+ base ==4.15.1.0,
+ base-compat ==0.12.2,
+ base-compat-batteries ==0.12.2,
+ base-orphans ==0.8.7,
+ base16-bytestring ==1.0.2.0,
+ base64 ==0.4.2.4,
+ base64-bytestring ==1.2.1.0,
+ basement ==0.0.15,
+ bifunctors ==5.5.12,
+ binary ==0.8.8.0,
+ bitvec ==1.1.3.0,
+ blaze-builder ==0.4.2.2,
+ blaze-html ==0.9.1.2,
+ blaze-markup ==0.8.2.8,
+ boring ==0.2,
+ bsb-http-chunked ==0.0.0.4,
+ byteorder ==1.0.4,
+ bytestring ==0.10.12.1,
+ cabal-doctest ==1.0.9,
+ call-stack ==0.4.0,
+ case-insensitive ==1.2.1.0,
+ cereal ==0.5.8.3,
+ citeproc ==0.8.0.1,
+ cmdargs ==0.10.21,
+ colour ==2.3.6,
+ commonmark ==0.2.2,
+ commonmark-extensions ==0.2.3.2,
+ commonmark-pandoc ==0.2.1.2,
+ comonad ==5.0.8,
+ conduit ==1.3.4.2,
+ conduit-extra ==1.3.6,
+ connection ==0.3.1,
+ constraints ==0.13.4,
+ containers ==0.6.4.1,
+ contravariant ==1.5.5,
+ cookie ==0.4.5,
+ cryptonite ==0.30,
+ data-default ==0.7.1.1,
+ data-default-class ==0.1.2.0,
+ data-default-instances-containers ==0.0.1,
+ data-default-instances-dlist ==0.0.1,
+ data-default-instances-old-locale ==0.0.1,
+ data-fix ==0.3.2,
+ dec ==0.0.5,
+ deepseq ==1.4.5.0,
+ digest ==0.0.1.3,
+ directory ==1.3.6.2,
+ distributive ==0.6.2.1,
+ dlist ==1.0,
+ doclayout ==0.4,
+ doctemplates ==0.10.0.2,
+ easy-file ==0.2.2,
+ emojis ==0.1.2,
+ exceptions ==0.10.4,
+ fast-logger ==3.1.1,
+ file-embed ==0.0.15.0,
+ filepath ==1.4.2.1,
+ generically ==0.1,
+ ghc-bignum ==1.1,
+ ghc-boot-th ==9.0.2,
+ ghc-prim ==0.7.0,
+ gridtables ==0.0.3.0,
+ haddock-library ==1.11.0,
+ happy ==1.20.0,
+ hashable ==1.4.1.0,
+ haskell-lexer ==1.1,
+ hourglass ==0.2.12,
+ hsc2hs ==0.68.8,
+ hslua ==2.2.1,
+ hslua-aeson ==2.2.1,
+ hslua-classes ==2.2.0,
+ hslua-core ==2.2.1,
+ hslua-marshalling ==2.2.1,
+ hslua-module-doclayout ==1.0.4,
+ hslua-module-path ==1.0.3,
+ hslua-module-system ==1.0.2,
+ hslua-module-text ==1.0.2,
+ hslua-module-version ==1.0.2,
+ hslua-objectorientation ==2.2.1,
+ hslua-packaging ==2.2.1,
+ http-api-data ==0.4.3,
+ http-client ==0.7.13.1,
+ http-client-tls ==0.3.6.1,
+ http-date ==0.0.11,
+ http-media ==0.8.0.0,
+ http-types ==0.12.3,
+ http2 ==3.0.3,
+ indexed-traversable ==0.1.2,
+ indexed-traversable-instances ==0.1.1.1,
+ integer-gmp ==1.1,
+ integer-logarithms ==1.0.3.1,
+ iproute ==1.7.12,
+ ipynb ==0.2,
+ jira-wiki-markup ==1.4.0,
+ libyaml ==0.1.2,
+ lpeg ==1.0.3,
+ lua ==2.2.1,
+ memory ==0.17.0,
+ mime-types ==0.1.0.9,
+ mmorph ==1.2.0,
+ monad-control ==1.0.3.1,
+ mono-traversable ==1.0.15.3,
+ mtl ==2.2.2,
+ network ==3.1.2.7,
+ network-byte-order ==0.1.6,
+ network-uri ==2.6.4.1,
+ old-locale ==1.0.0.7,
+ old-time ==1.1.0.3,
+ optparse-applicative ==0.17.0.0,
+ pandoc-lua-marshal ==0.1.7,
+ pandoc-types ==1.22.2.1,
+ parsec ==3.1.14.0,
+ pem ==0.2.4,
+ pretty ==1.1.3.6,
+ pretty-show ==1.10,
+ primitive ==0.7.4.0,
+ process ==1.6.13.2,
+ psqueues ==0.2.7.3,
+ random ==1.2.1.1,
+ resourcet ==1.2.6,
+ rts ==1.0.2,
+ safe ==0.3.19,
+ scientific ==0.3.7.0,
+ semialign ==1.2.0.1,
+ semigroupoids ==5.3.7,
+ servant ==0.19,
+ servant-server ==0.19.1,
+ simple-sendfile ==0.2.30,
+ singleton-bool ==0.1.6,
+ skylighting ==0.13,
+ skylighting-core ==0.13,
+ skylighting-format-ansi ==0.1,
+ skylighting-format-blaze-html ==0.1,
+ skylighting-format-latex ==0.1,
+ socks ==0.6.1,
+ some ==1.0.4,
+ sop-core ==0.5.0.2,
+ split ==0.2.3.5,
+ splitmix ==0.1.0.4,
+ stm ==2.5.0.0,
+ streaming-commons ==0.2.2.4,
+ strict ==0.4.0.1,
+ string-conversions ==0.4.0.1,
+ syb ==0.7.2.1,
+ tagged ==0.8.6.1,
+ tagsoup ==0.14.8,
+ template-haskell ==2.17.0.0,
+ temporary ==1.3,
+ texmath ==0.12.5.2,
+ text ==1.2.5.0,
+ text-conversions ==0.3.1.1,
+ text-short ==0.1.5,
+ th-abstraction ==0.4.4.0,
+ th-compat ==0.1.4,
+ th-lift ==0.8.2,
+ th-lift-instances ==0.1.19,
+ these ==1.1.1.1,
+ time ==1.9.3,
+ time-compat ==1.9.6.1,
+ time-manager ==0.0.0,
+ tls ==1.6.0,
+ transformers ==0.5.6.2,
+ transformers-base ==0.4.6,
+ transformers-compat ==0.7.2,
+ type-equality ==1,
+ typed-process ==0.2.10.1,
+ unicode-collation ==0.1.3.2,
+ unicode-data ==0.3.0,
+ unicode-transforms ==0.4.0.1,
+ uniplate ==1.6.13,
+ unix ==2.7.2.2,
+ unix-compat ==0.6,
+ unix-time ==0.4.7,
+ unliftio ==0.2.22.0,
+ unliftio-core ==0.2.0.1,
+ unordered-containers ==0.2.19.1,
+ utf8-string ==1.0.2,
+ uuid-types ==1.0.5,
+ vault ==0.3.1.5,
+ vector ==0.13.0.0,
+ vector-algorithms ==0.9.0.1,
+ vector-stream ==0.1.0.0,
+ wai ==3.2.3,
+ wai-app-static ==3.1.7.4,
+ wai-extra ==3.1.12.1,
+ wai-logger ==2.4.0,
+ warp ==3.3.22,
+ witherable ==0.4.2,
+ word8 ==0.1.3,
+ x509 ==1.7.7,
+ x509-store ==1.6.9,
+ x509-system ==1.6.7,
+ x509-validation ==1.6.12,
+ xml ==1.3.14,
+ xml-conduit ==1.9.1.1,
+ xml-types ==0.3.8,
+ yaml ==0.11.8.0,
+ zip-archive ==0.4.2.1,
+ zlib ==0.6.3.0
diff --git a/repo/pandoc/pandoc.xibuild b/repo/pandoc/pandoc.xibuild
new file mode 100644
index 0000000..12d2406
--- /dev/null
+++ b/repo/pandoc/pandoc.xibuild
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+NAME="pandoc"
+DESC="universal markup converter"
+
+MAKEDEPS=" ghc cabal zlib libffi"
+
+PKG_VER=2.19.1
+SOURCE="https://hackage.haskell.org/package/pandoc-$PKG_VER/pandoc-$PKG_VER.tar.gz"
+
+ADDITIONAL="
+cabal.config
+"
+
+cabal_update() {
+ echo "Freezing pandoc dependencies"
+
+ # Resolve deps and generate fresh cabal.config with version constraints.
+ cabal update
+ (
+ cd "$BUILD_ROOT"
+ cabal v1-freeze --shadow-installed-packages
+
+ # Add version tag at the first line.
+ sed -i "1i--$PKG_VER" "cabal.config"
+
+ mv "cabal.config" "$startdir/"
+ )
+}
+
+prepare() {
+ apply_patches
+
+ if [ "$(head -n 1 "$BUILD_ROOT/cabal.config")" != "--$PKG_VER" ]; then
+ die "Requirements file is outdated, run 'abuild cabal_update'"
+ fi
+
+ ln -sf "$BUILD_ROOT/cabal.config" "$BUILD_ROOT/cabal.project.freeze"
+}
+
+build() {
+ cabal update
+ cabal install --only-dependencies
+ cabal configure \
+ --prefix='/usr' \
+ --enable-tests \
+ --enable-split-sections \
+ --ghc-option="-split-sections" \
+ --flags="+embed_data_files -trypandoc +static"
+ cabal build --jobs=${JOBS:-1}
+}
+
+check() {
+ cabal test --jobs=${JOBS:-1}
+}
+
+package() {
+ _bindir="$PKG_DEST/usr/bin"
+ mkdir -p "$_bindir"
+ cabal install \
+ --installdir="$_bindir" \
+ --install-method=copy
+ install -Dm644 man/pandoc.1 "$PKG_DEST"/usr/share/man/man1/pandoc.1
+}
+
diff --git a/repo/pango/disable-broken-test.patch b/repo/pango/disable-broken-test.patch
index db3d6c3..09282f9 100644
--- a/repo/pango/disable-broken-test.patch
+++ b/repo/pango/disable-broken-test.patch
@@ -1,15 +1,11 @@
---- a/tests/meson.build
-+++ b/tests/meson.build
-@@ -58,12 +58,6 @@
- [ 'testmisc', [ 'testmisc.c' ], [ libpangocairo_dep, libpangoft2_dep, glib_dep, harfbuzz_dep ] ],
- [ 'testserialize', [ 'testserialize.c' ], [ libpangocairo_dep, libpangoft2_dep ] ],
- ]
--
-- if host_system != 'darwin'
-- tests += [
-- [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep, libpangoft2_dep ] ],
-- ]
-- endif
- endif
+diff -U3 -r a/tests/meson.build b/tests/meson.build
+--- a/tests/meson.build 2022-04-25 20:59:39.989114880 +0200
++++ b/tests/meson.build 2022-04-25 21:00:00.013429487 +0200
+@@ -61,7 +61,5 @@
- if host_system != 'darwin'
+ if host_system != 'darwin'
+ tests += [
+- [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep, libpangoft2_dep ] ],
+- [ 'test-fonts', [ 'test-fonts.c', 'test-common.c' ], [ libpangocairo_dep, libpangoft2_dep ] ],
+ ]
+ endif
diff --git a/repo/pango/pango.pre-deinstall b/repo/pango/pango.pre-deinstall
new file mode 100644
index 0000000..bcffa7c
--- /dev/null
+++ b/repo/pango/pango.pre-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/rm -f /etc/pango/pango.modules /usr/lib/pango/*/modules.cache
diff --git a/repo/pango/pango.trigger b/repo/pango/pango.trigger
new file mode 100644
index 0000000..20e3660
--- /dev/null
+++ b/repo/pango/pango.trigger
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+umask 022
+/usr/bin/pango-querymodules > ${1}.cache
diff --git a/repo/pango/pango.xibuild b/repo/pango/pango.xibuild
index 9f7efab..1174100 100644
--- a/repo/pango/pango.xibuild
+++ b/repo/pango/pango.xibuild
@@ -3,28 +3,32 @@
NAME="pango"
DESC="library for layout and rendering of text"
-MAKEDEPS="meson ninja python-pygments git"
-DEPS="sbase cairo fontconfig freetype2 glib libx11 libxft libxrender musl fribidi harfbuzz"
+MAKEDEPS="cairo expat fontconfig fribidi glib gobject-introspection harfbuzz help2man libxft meson"
-PKG_VER=1.50.9
+PKG_VER=1.50.10
SOURCE="https://download.gnome.org/sources/pango/${PKG_VER%.*}/pango-$PKG_VER.tar.xz"
-ADDITIONAL="disable-broken-test.patch "
+
+ADDITIONAL="
+disable-broken-test.patch
+"
prepare () {
apply_patches
}
-build () {
- mkdir build &&
- cd build &&
- meson --prefix=/usr \
- -Dintrospection=enabled \
+build() {
+ meson --prefix=/usr \
+ -Db_lto=true \
+ -Dintrospection=enabled \
-Dgtk_doc=false \
- ..
-
- ninja
+ build
+ meson compile ${JOBS:+-j ${JOBS}} -C build
}
-package () {
- DESTDIR=$PKG_DEST ninja install
+#check() {
+ #meson test --no-rebuild --print-errorlogs -C build
+#}
+
+package() {
+ DESTDIR="$PKG_DEST" meson install --no-rebuild -C build
}
diff --git a/repo/poppler/poppler-glib.xibuild b/repo/poppler/poppler-glib.xibuild
index d6f31bf..2f1b13f 100644
--- a/repo/poppler/poppler-glib.xibuild
+++ b/repo/poppler/poppler-glib.xibuild
@@ -2,7 +2,7 @@
NAME="poppler-glib"
DESC="Glib wrapper for poppler"
-DEPS="cairo freetype2 glib musl poppler"
+MAKEDEPS="cairo freetype2 glib musl poppler"
package () {
add_from_main "usr/lib/libpoppler-glib.so*" \
diff --git a/repo/python-docutils/python-docutils.xibuild b/repo/python-docutils/python-docutils.xibuild
index 546c14d..cd1c45a 100644
--- a/repo/python-docutils/python-docutils.xibuild
+++ b/repo/python-docutils/python-docutils.xibuild
@@ -13,4 +13,9 @@ build() {
package () {
python setup.py install --root="$PKG_DEST" --optimize=1
+
+ for f in $PKG_DEST/usr/bin/*.py; do
+ echo $f -> $(basename $f )
+ ln -s $(basename $f) ${f%.*}
+ done
}
diff --git a/repo/python-setuptools/python-setuptools.xibuild b/repo/python-setuptools/python-setuptools.xibuild
new file mode 100644
index 0000000..f0e396a
--- /dev/null
+++ b/repo/python-setuptools/python-setuptools.xibuild
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+NAME="python-setuptools"
+DESC="Collection of enhancements to the Python3 distutils"
+
+MAKEDEPS="python"
+
+PKG_VER=65.3.0
+SOURCE="https://github.com/pypa/setuptools.git"
+
+#prepare() {
+
+ # Unbundle
+ # rm -rf pkg_resources/extern pkg_resources/_vendor \
+ # setuptools/extern setuptools/_vendor
+
+ # Upstream devendoring logic is badly broken, see:
+ # https://bugs.archlinux.org/task/58670
+ # https://github.com/pypa/pip/issues/5429
+ # https://github.com/pypa/setuptools/issues/1383
+ # The simplest fix is to simply rewrite import paths to use the canonical
+ # location in the first place
+ # for _module in setuptools pkg_resources '' ; do
+ # find . -name \*.py -exec sed -i \
+ # -e 's/from '$_module.extern' import/import/' \
+ # -e 's/from '$_module.extern'./from /' \
+ # -e 's/import '$_module.extern'./import /' \
+ # -e "s/__import__('$_module.extern./__import__('/" \
+ # {} +
+ # done
+
+ # Fix post-release tag
+ #sed -e '/tag_build = .post/d' \
+ #-e '/tag_date = 1/d' \
+ #-i setup.cfg
+#}
+
+build() {
+ python3 setup.py build
+}
+
+package() {
+ # Otherwise it complains that build/scripts-3.10 cannot be found
+ # no other changes noted
+ mkdir -p build/scripts-3.10
+
+ python3 setup.py install --root="$PKG_DEST" --skip-build
+}
+
diff --git a/repo/sessreg/sessreg.xibuild b/repo/sessreg/sessreg.xibuild
index 08d3e4e..91d709a 100644
--- a/repo/sessreg/sessreg.xibuild
+++ b/repo/sessreg/sessreg.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.2
SOURCE=https://www.x.org/pub/individual/app/sessreg-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/setxkbmap/setxkbmap.xibuild b/repo/setxkbmap/setxkbmap.xibuild
index 42c0200..e0c0925 100644
--- a/repo/setxkbmap/setxkbmap.xibuild
+++ b/repo/setxkbmap/setxkbmap.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.3.2
SOURCE=https://www.x.org/pub/individual/app/setxkbmap-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/smproxy/smproxy.xibuild b/repo/smproxy/smproxy.xibuild
index 8d1867e..56a69b5 100644
--- a/repo/smproxy/smproxy.xibuild
+++ b/repo/smproxy/smproxy.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.6
SOURCE=https://www.x.org/pub/individual/app/smproxy-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/ubase/ubase.xibuild b/repo/ubase/ubase.xibuild
index e95aceb..c93c56e 100644
--- a/repo/ubase/ubase.xibuild
+++ b/repo/ubase/ubase.xibuild
@@ -3,12 +3,12 @@
MAKEDEPS="make findutils sed"
DEPS="musl utmps"
-SOURCE=https://git.suckless.org/ubase
+SOURCE=git://git.suckless.org/ubase
DESC="ubase from suckless.org"
prepare () {
- /usr/bin/find -type 'f' -name '*.c' | xargs sed -i "s@#include <sys/types.h>@#include <sys/sysmacros.h>@g"
+ /usr/bin/find -type 'f' -name '*.c' -exec sed -i "s@#include <sys/types.h>@#include <sys/sysmacros.h>@g" {} \;
}
build () {
diff --git a/skip/unrar/makefile.patch b/repo/unrar/makefile.patch
index 1b0c09f..105a11c 100644
--- a/skip/unrar/makefile.patch
+++ b/repo/unrar/makefile.patch
@@ -1,7 +1,6 @@
-diff -upr unrar.orig/makefile unrar/makefile
---- unrar.orig/makefile 2018-03-11 17:33:12.697132381 +0100
-+++ unrar/makefile 2018-03-11 17:33:48.763911497 +0100
-@@ -2,13 +2,14 @@
+--- unrar2/makefile 2022-10-17 08:34:16.947982925 +0100
++++ unrar/makefile 2022-10-17 08:37:54.507963545 +0100
+@@ -2,8 +2,9 @@
# Makefile for UNIX - unrar
# Linux using GCC
@@ -9,22 +8,25 @@ diff -upr unrar.orig/makefile unrar/makefile
-CXXFLAGS=-O2 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else
+CXX?=c++
+CXXFLAGS?=-O2
-+CXXFLAGS+=-Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else
++CXXFLAGS=-Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else
LIBFLAGS=-fPIC
DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP
STRIP=strip
+@@ -10,5 +11,5 @@
AR=ar
-LDFLAGS=-pthread
+LDFLAGS+=-pthread
DESTDIR=/usr
# Linux using LCC
-@@ -140,7 +141,7 @@ uninstall: uninstall-unrar
- clean:
- @rm -f *.o *.bak *~
+@@ -142,8 +143,8 @@
+ @rm -f $(OBJECTS) $(UNRAR_OBJ) $(LIB_OBJ)
+ @rm -f unrar libunrar.*
-unrar: clean $(OBJECTS) $(UNRAR_OBJ)
-+unrar: $(OBJECTS) $(UNRAR_OBJ)
+- @rm -f unrar
++unrar: $(OBJECTS) $(UNRAR_OBJ)
++ @rm -rf unrar
$(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
$(STRIP) unrar
-
+
diff --git a/skip/unrar/unrar.xibuild b/repo/unrar/unrar.xibuild
index 2d2500a..2d2500a 100644
--- a/skip/unrar/unrar.xibuild
+++ b/repo/unrar/unrar.xibuild
diff --git a/repo/x11perf/x11perf.xibuild b/repo/x11perf/x11perf.xibuild
index ebb5ede..6a4fee0 100644
--- a/repo/x11perf/x11perf.xibuild
+++ b/repo/x11perf/x11perf.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.6.1
SOURCE=https://www.x.org/pub/individual/app/x11perf-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xauth/xauth.xibuild b/repo/xauth/xauth.xibuild
index a9c14d7..8e59012 100644
--- a/repo/xauth/xauth.xibuild
+++ b/repo/xauth/xauth.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.1
SOURCE=https://www.x.org/pub/individual/app/xauth-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xbacklight/xbacklight.xibuild b/repo/xbacklight/xbacklight.xibuild
index 7f79bc0..2236b47 100644
--- a/repo/xbacklight/xbacklight.xibuild
+++ b/repo/xbacklight/xbacklight.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.3
SOURCE=https://www.x.org/pub/individual/app/xbacklight-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xbitmaps/xbitmaps.xibuild b/repo/xbitmaps/xbitmaps.xibuild
index cb7b0f8..b229341 100644
--- a/repo/xbitmaps/xbitmaps.xibuild
+++ b/repo/xbitmaps/xbitmaps.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://www.x.org/pub/individual/data/xbitmaps-$PKG_VER.tar.bz2
DESC="Bitmaps for xorg"
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
}
package () {
diff --git a/repo/xcb-proto/xcb-proto.xibuild b/repo/xcb-proto/xcb-proto.xibuild
index 01ece2a..da5576b 100644
--- a/repo/xcb-proto/xcb-proto.xibuild
+++ b/repo/xcb-proto/xcb-proto.xibuild
@@ -8,7 +8,7 @@ SOURCE=https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-$PKG_VER.
DESC="XML-XCB protocol descriptions"
build () {
- PYTHON=python3 ./configure $XORG_CONFIG
+ PYTHON=python3 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
}
package () {
diff --git a/repo/xcb-util-cursor/xcb-util-cursor.xibuild b/repo/xcb-util-cursor/xcb-util-cursor.xibuild
index cae954b..f72a4da 100644
--- a/repo/xcb-util-cursor/xcb-util-cursor.xibuild
+++ b/repo/xcb-util-cursor/xcb-util-cursor.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://xcb.freedesktop.org/dist/xcb-util-cursor-$PKG_VER.tar.bz2
DESC="XCB cursor library"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/xcb-util-image/xcb-util-image.xibuild b/repo/xcb-util-image/xcb-util-image.xibuild
index e11280a..5b10e11 100644
--- a/repo/xcb-util-image/xcb-util-image.xibuild
+++ b/repo/xcb-util-image/xcb-util-image.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://xcb.freedesktop.org/dist/xcb-util-image-$PKG_VER.tar.bz2
DESC="Utility libraries for XC Binding, with ports of Xlib's XImage"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/xcb-util-keysyms/xcb-util-keysyms.xibuild b/repo/xcb-util-keysyms/xcb-util-keysyms.xibuild
index 31bc072..3369644 100644
--- a/repo/xcb-util-keysyms/xcb-util-keysyms.xibuild
+++ b/repo/xcb-util-keysyms/xcb-util-keysyms.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://xcb.freedesktop.org/dist/xcb-util-keysyms-$PKG_VER.tar.bz2
DESC="Utility libraries for XC Binding, with standard x key constants"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/xcb-util-renderutil/xcb-util-renderutil.xibuild b/repo/xcb-util-renderutil/xcb-util-renderutil.xibuild
index 293f41d..ef60b69 100644
--- a/repo/xcb-util-renderutil/xcb-util-renderutil.xibuild
+++ b/repo/xcb-util-renderutil/xcb-util-renderutil.xibuild
@@ -10,7 +10,7 @@ SOURCE=https://xcb.freedesktop.org/dist/xcb-util-renderutil-$PKG_VER.tar.bz2
DESC="Utility libraries for XC Binding, with functions for the render extension"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/xcb-util-wm/xcb-util-wm.xibuild b/repo/xcb-util-wm/xcb-util-wm.xibuild
index 7180dec..b9e910a 100644
--- a/repo/xcb-util-wm/xcb-util-wm.xibuild
+++ b/repo/xcb-util-wm/xcb-util-wm.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://xcb.freedesktop.org/dist/xcb-util-wm-$PKG_VER.tar.bz2
DESC="Utility libraries for XC Binding, with client and window-manager helpers"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/xcb-util/xcb-util.xibuild b/repo/xcb-util/xcb-util.xibuild
index 04321d1..f7754f5 100644
--- a/repo/xcb-util/xcb-util.xibuild
+++ b/repo/xcb-util/xcb-util.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://xcb.freedesktop.org/dist/xcb-util-$PKG_VER.tar.bz2
DESC="Utility libraries for XC Binding"
build () {
- ./configure $XORG_CONFIG &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static &&
make
}
diff --git a/repo/xclock/xclock.xibuild b/repo/xclock/xclock.xibuild
index 14e1307..e88407e 100644
--- a/repo/xclock/xclock.xibuild
+++ b/repo/xclock/xclock.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.0.9
SOURCE=https://www.x.org/pub/individual/app/xclock-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xcmsdb/xcmsdb.xibuild b/repo/xcmsdb/xcmsdb.xibuild
index ddaadef..ebba685 100644
--- a/repo/xcmsdb/xcmsdb.xibuild
+++ b/repo/xcmsdb/xcmsdb.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.5
SOURCE=https://www.x.org/pub/individual/app/xcmsdb-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xcursor-themes/xcursor-themes.xibuild b/repo/xcursor-themes/xcursor-themes.xibuild
index 66127ce..9aa6ca8 100644
--- a/repo/xcursor-themes/xcursor-themes.xibuild
+++ b/repo/xcursor-themes/xcursor-themes.xibuild
@@ -9,7 +9,7 @@ SOURCE=https://www.x.org/pub/individual/data/xcursor-themes-$PKG_VER.tar.bz2
DESC="Cursor themes for X.Org"
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xcursorgen/xcursorgen.xibuild b/repo/xcursorgen/xcursorgen.xibuild
index 13c14a0..7ed0375 100644
--- a/repo/xcursorgen/xcursorgen.xibuild
+++ b/repo/xcursorgen/xcursorgen.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.7
SOURCE=https://www.x.org/pub/individual/app/xcursorgen-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xdpyinfo/xdpyinfo.xibuild b/repo/xdpyinfo/xdpyinfo.xibuild
index 3784477..f29712d 100644
--- a/repo/xdpyinfo/xdpyinfo.xibuild
+++ b/repo/xdpyinfo/xdpyinfo.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.3.2
SOURCE=https://www.x.org/pub/individual/app/xdpyinfo-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xdriinfo/xdriinfo.xibuild b/repo/xdriinfo/xdriinfo.xibuild
index f32f3c0..3bae4ad 100644
--- a/repo/xdriinfo/xdriinfo.xibuild
+++ b/repo/xdriinfo/xdriinfo.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.6
SOURCE=https://www.x.org/pub/individual/app/xdriinfo-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xev/xev.xibuild b/repo/xev/xev.xibuild
index 5f8e8d9..a1b3cdd 100644
--- a/repo/xev/xev.xibuild
+++ b/repo/xev/xev.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.4
SOURCE=https://www.x.org/pub/individual/app/xev-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xeyes/xeyes.xibuild b/repo/xeyes/xeyes.xibuild
index 39a175e..5b819bc 100644
--- a/repo/xeyes/xeyes.xibuild
+++ b/repo/xeyes/xeyes.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.2.0
SOURCE=https://www.x.org/archive/individual/app/xeyes-$PKG_VER.tar.gz
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-input-evdev/xf86-input-evdev.xibuild b/repo/xf86-input-evdev/xf86-input-evdev.xibuild
index de4aeed..2b2dedd 100644
--- a/repo/xf86-input-evdev/xf86-input-evdev.xibuild
+++ b/repo/xf86-input-evdev/xf86-input-evdev.xibuild
@@ -9,7 +9,7 @@ PKG_VER=2.10.6
SOURCE=https://www.x.org/pub/individual/driver/xf86-input-evdev-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-input-libinput/xf86-input-libinput.xibuild b/repo/xf86-input-libinput/xf86-input-libinput.xibuild
index 9385bc0..d743954 100644
--- a/repo/xf86-input-libinput/xf86-input-libinput.xibuild
+++ b/repo/xf86-input-libinput/xf86-input-libinput.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.2.1
SOURCE=https://www.x.org/pub/individual/driver/xf86-input-libinput-$PKG_VER.tar.xz
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-input-synaptics/xf86-input-synaptics.xibuild b/repo/xf86-input-synaptics/xf86-input-synaptics.xibuild
index 27ed0ec..75cfb4c 100644
--- a/repo/xf86-input-synaptics/xf86-input-synaptics.xibuild
+++ b/repo/xf86-input-synaptics/xf86-input-synaptics.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.9.1
SOURCE=https://www.x.org/pub/individual/driver/xf86-input-synaptics-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-input-wacom/xf86-input-wacom.xibuild b/repo/xf86-input-wacom/xf86-input-wacom.xibuild
index 1469b5a..5b44930 100644
--- a/repo/xf86-input-wacom/xf86-input-wacom.xibuild
+++ b/repo/xf86-input-wacom/xf86-input-wacom.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.1.0
SOURCE=https://github.com/linuxwacom/xf86-input-wacom/releases/download/xf86-input-wacom-$PKG_VER/xf86-input-wacom-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --with-systemd-unit-dir=no
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --with-systemd-unit-dir=no
make
}
diff --git a/repo/xf86-video-amdgpu/xf86-video-amdgpu.xibuild b/repo/xf86-video-amdgpu/xf86-video-amdgpu.xibuild
index 89b8e80..9f67364 100644
--- a/repo/xf86-video-amdgpu/xf86-video-amdgpu.xibuild
+++ b/repo/xf86-video-amdgpu/xf86-video-amdgpu.xibuild
@@ -9,7 +9,7 @@ PKG_VER=21.0.0
SOURCE=https://www.x.org/pub/individual/driver/xf86-video-amdgpu-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-video-ati/xf86-video-ati.xibuild b/repo/xf86-video-ati/xf86-video-ati.xibuild
index 421bf3e..f9bc5b3 100644
--- a/repo/xf86-video-ati/xf86-video-ati.xibuild
+++ b/repo/xf86-video-ati/xf86-video-ati.xibuild
@@ -17,7 +17,7 @@ prepare () {
}
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-video-fbdev/xf86-video-fbdev.xibuild b/repo/xf86-video-fbdev/xf86-video-fbdev.xibuild
index 050aa76..9606345 100644
--- a/repo/xf86-video-fbdev/xf86-video-fbdev.xibuild
+++ b/repo/xf86-video-fbdev/xf86-video-fbdev.xibuild
@@ -9,7 +9,7 @@ PKG_VER=0.5.0
SOURCE=https://www.x.org/pub/individual/driver/xf86-video-fbdev-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-video-nouveau/xf86-video-nouveau.xibuild b/repo/xf86-video-nouveau/xf86-video-nouveau.xibuild
index e2f593c..0fbb9bb 100644
--- a/repo/xf86-video-nouveau/xf86-video-nouveau.xibuild
+++ b/repo/xf86-video-nouveau/xf86-video-nouveau.xibuild
@@ -14,7 +14,7 @@ prepare () {
}
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-video-qxl/xf86-video-qxl.xibuild b/repo/xf86-video-qxl/xf86-video-qxl.xibuild
index f7fd090..902129e 100644
--- a/repo/xf86-video-qxl/xf86-video-qxl.xibuild
+++ b/repo/xf86-video-qxl/xf86-video-qxl.xibuild
@@ -17,7 +17,7 @@ prepare () {
}
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xf86-video-vmware/xf86-video-vmware.xibuild b/repo/xf86-video-vmware/xf86-video-vmware.xibuild
index 569ab92..6a503c6 100644
--- a/repo/xf86-video-vmware/xf86-video-vmware.xibuild
+++ b/repo/xf86-video-vmware/xf86-video-vmware.xibuild
@@ -9,7 +9,7 @@ PKG_VER=13.3.0
SOURCE=https://www.x.org/pub/individual/driver/xf86-video-vmware-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xgamma/xgamma.xibuild b/repo/xgamma/xgamma.xibuild
index 0f987b1..07d1da1 100644
--- a/repo/xgamma/xgamma.xibuild
+++ b/repo/xgamma/xgamma.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.6
SOURCE=https://www.x.org/pub/individual/app/xgamma-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xhost/xhost.xibuild b/repo/xhost/xhost.xibuild
index 5d1509d..9951038 100644
--- a/repo/xhost/xhost.xibuild
+++ b/repo/xhost/xhost.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.8
SOURCE=https://www.x.org/pub/individual/app/xhost-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xinput/xinput.xibuild b/repo/xinput/xinput.xibuild
index d52f202..830c844 100644
--- a/repo/xinput/xinput.xibuild
+++ b/repo/xinput/xinput.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.6.3
SOURCE=https://www.x.org/pub/individual/app/xinput-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xkbcomp/xkbcomp.xibuild b/repo/xkbcomp/xkbcomp.xibuild
index 35debf3..ff75d1a 100644
--- a/repo/xkbcomp/xkbcomp.xibuild
+++ b/repo/xkbcomp/xkbcomp.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.4.5
SOURCE=https://www.x.org/pub/individual/app/xkbcomp-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xkbevd/xkbevd.xibuild b/repo/xkbevd/xkbevd.xibuild
index 62452f5..8ff48d5 100644
--- a/repo/xkbevd/xkbevd.xibuild
+++ b/repo/xkbevd/xkbevd.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/app/xkbevd-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xkbutils/xkbutils.xibuild b/repo/xkbutils/xkbutils.xibuild
index 637bcf8..790fa30 100644
--- a/repo/xkbutils/xkbutils.xibuild
+++ b/repo/xkbutils/xkbutils.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.4
SOURCE=https://www.x.org/pub/individual/app/xkbutils-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xkeyboardconfig/xkeyboardconfig.xibuild b/repo/xkeyboardconfig/xkeyboardconfig.xibuild
index 74f48e7..07cfa64 100644
--- a/repo/xkeyboardconfig/xkeyboardconfig.xibuild
+++ b/repo/xkeyboardconfig/xkeyboardconfig.xibuild
@@ -16,7 +16,7 @@ build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX --buildtype=release .. &&
+ meson --prefix=/usr --buildtype=release .. &&
ninja
}
diff --git a/repo/xkill/xkill.xibuild b/repo/xkill/xkill.xibuild
index 591ccb6..ee106a4 100644
--- a/repo/xkill/xkill.xibuild
+++ b/repo/xkill/xkill.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.5
SOURCE=https://www.x.org/pub/individual/app/xkill-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xlsatoms/xlsatoms.xibuild b/repo/xlsatoms/xlsatoms.xibuild
index e9e20c2..0d4081f 100644
--- a/repo/xlsatoms/xlsatoms.xibuild
+++ b/repo/xlsatoms/xlsatoms.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.3
SOURCE=https://www.x.org/pub/individual/app/xlsatoms-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xlsclients/xlsclients.xibuild b/repo/xlsclients/xlsclients.xibuild
index 9400313..d6b066d 100644
--- a/repo/xlsclients/xlsclients.xibuild
+++ b/repo/xlsclients/xlsclients.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/app/xlsclients-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xmessage/xmessage.xibuild b/repo/xmessage/xmessage.xibuild
index 4cb6ab4..cc26a3b 100644
--- a/repo/xmessage/xmessage.xibuild
+++ b/repo/xmessage/xmessage.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.5
SOURCE=https://www.x.org/pub/individual/app/xmessage-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xmodmap/xmodmap.xibuild b/repo/xmodmap/xmodmap.xibuild
index b940a85..92209aa 100644
--- a/repo/xmodmap/xmodmap.xibuild
+++ b/repo/xmodmap/xmodmap.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.10
SOURCE=https://www.x.org/pub/individual/app/xmodmap-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xorg-server/xorg-server.xibuild b/repo/xorg-server/xorg-server.xibuild
index 074572e..66b6a13 100644
--- a/repo/xorg-server/xorg-server.xibuild
+++ b/repo/xorg-server/xorg-server.xibuild
@@ -10,7 +10,7 @@ build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX \
+ meson --prefix=/usr \
-Dxorg=true \
-Dxephyr=true \
-Dglamor=true \
diff --git a/repo/xorg-xinit/xorg-xinit.xibuild b/repo/xorg-xinit/xorg-xinit.xibuild
index ccd76a8..57e1179 100644
--- a/repo/xorg-xinit/xorg-xinit.xibuild
+++ b/repo/xorg-xinit/xorg-xinit.xibuild
@@ -9,7 +9,7 @@ PKG_VER=1.4.1
SOURCE=https://www.x.org/pub/individual/app/xinit-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --with-xinitdir=/etc/X11/app-defaults &&
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --with-xinitdir=/etc/X11/app-defaults &&
make
}
diff --git a/repo/xorgproto/xorgproto.xibuild b/repo/xorgproto/xorgproto.xibuild
index f49cf52..5fd838d 100644
--- a/repo/xorgproto/xorgproto.xibuild
+++ b/repo/xorgproto/xorgproto.xibuild
@@ -1,6 +1,6 @@
#!/bin/bash
-MAKEDEPS="ninja meson asciidoc libxslt xmlto bash"
+MAKEDEPS="ninja meson asciidoc libxslt xmlto bash libxau"
DEPS="xorg-util-macros"
PKG_VER=2021.5
@@ -11,13 +11,13 @@ build () {
mkdir build &&
cd build &&
- meson --prefix=$XORG_PREFIX -Dlegacy=true .. &&
+ meson --prefix=/usr -Dlegacy=true .. &&
ninja
}
package () {
DESTDIR=$PKG_DEST ninja install &&
- install -dm 755 $PKG_DEST$XORG_PREFIX/share/doc/xorgproto-$PKG_VER &&
- install -m 644 ../[^m]*.txt ../PM_spec $PKG_DEST$XORG_PREFIX/share/doc/xorgproto-$PKG_VER
+ install -dm 755 $PKG_DEST/usr/share/doc/xorgproto-$PKG_VER &&
+ install -m 644 ../[^m]*.txt ../PM_spec $PKG_DEST/usr/share/doc/xorgproto-$PKG_VER
}
diff --git a/repo/xpr/xpr.xibuild b/repo/xpr/xpr.xibuild
index 70d557e..f5b436e 100644
--- a/repo/xpr/xpr.xibuild
+++ b/repo/xpr/xpr.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.5
SOURCE=https://www.x.org/pub/individual/app/xpr-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xprop/xprop.xibuild b/repo/xprop/xprop.xibuild
index d3133ac..5ecbb8e 100644
--- a/repo/xprop/xprop.xibuild
+++ b/repo/xprop/xprop.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.5
SOURCE=https://www.x.org/pub/individual/app/xprop-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xrandr/xrandr.xibuild b/repo/xrandr/xrandr.xibuild
index 49f8a8d..1548b6e 100644
--- a/repo/xrandr/xrandr.xibuild
+++ b/repo/xrandr/xrandr.xibuild
@@ -7,11 +7,11 @@ PKG_VER=1.5.1
SOURCE=https://www.x.org/pub/individual/app/xrandr-$PKG_VER.tar.xz
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
package () {
make DESTDIR=$PKG_DEST install
- rm -f $PKG_DEST$XORG_PREFIX/bin/xkeystone
+ rm -f $PKG_DEST/usr/bin/xkeystone
}
diff --git a/repo/xrdb/xrdb.xibuild b/repo/xrdb/xrdb.xibuild
index b8a55ef..537b8fb 100644
--- a/repo/xrdb/xrdb.xibuild
+++ b/repo/xrdb/xrdb.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.1
SOURCE=https://www.x.org/pub/individual/app/xrdb-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xrefresh/xrefresh.xibuild b/repo/xrefresh/xrefresh.xibuild
index cb6c224..d2c6f62 100644
--- a/repo/xrefresh/xrefresh.xibuild
+++ b/repo/xrefresh/xrefresh.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.6
SOURCE=https://www.x.org/pub/individual/app/xrefresh-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xset/xset.xibuild b/repo/xset/xset.xibuild
index 403fcc9..145e58d 100644
--- a/repo/xset/xset.xibuild
+++ b/repo/xset/xset.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.2.4
SOURCE=https://www.x.org/pub/individual/app/xset-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xsetroot/xsetroot.xibuild b/repo/xsetroot/xsetroot.xibuild
index 3fda50e..54378f3 100644
--- a/repo/xsetroot/xsetroot.xibuild
+++ b/repo/xsetroot/xsetroot.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.2
SOURCE=https://www.x.org/pub/individual/app/xsetroot-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xterm/xterm.xibuild b/repo/xterm/xterm.xibuild
index 15dcb6b..5d49a1c 100644
--- a/repo/xterm/xterm.xibuild
+++ b/repo/xterm/xterm.xibuild
@@ -21,7 +21,7 @@ prepare () {
build () {
./configure \
- $XORG_CONFIG \
+ --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
diff --git a/repo/xtrans/xtrans.xibuild b/repo/xtrans/xtrans.xibuild
index 52a0c9f..f12ff96 100644
--- a/repo/xtrans/xtrans.xibuild
+++ b/repo/xtrans/xtrans.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.4.0
SOURCE=https://www.x.org/pub/individual/lib/xtrans-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG --docdir=$XORG_PREFIX/share/doc/xtrans-$PKG_VER
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --docdir=/usr/share/doc/xtrans-$PKG_VER
make
}
diff --git a/repo/xvinfo/xvinfo.xibuild b/repo/xvinfo/xvinfo.xibuild
index 91269f9..63f6056 100644
--- a/repo/xvinfo/xvinfo.xibuild
+++ b/repo/xvinfo/xvinfo.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.4
SOURCE=https://www.x.org/pub/individual/app/xvinfo-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xwd/xwd.xibuild b/repo/xwd/xwd.xibuild
index 8b28ccf..0ccdbf6 100644
--- a/repo/xwd/xwd.xibuild
+++ b/repo/xwd/xwd.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.8
SOURCE=https://www.x.org/pub/individual/app/xwd-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xwininfo/xwininfo.xibuild b/repo/xwininfo/xwininfo.xibuild
index 496ea6b..d13d9be 100644
--- a/repo/xwininfo/xwininfo.xibuild
+++ b/repo/xwininfo/xwininfo.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.1.5
SOURCE=https://www.x.org/pub/individual/app/xwininfo-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/xwud/xwud.xibuild b/repo/xwud/xwud.xibuild
index f02ede7..8aa1ca7 100644
--- a/repo/xwud/xwud.xibuild
+++ b/repo/xwud/xwud.xibuild
@@ -7,7 +7,7 @@ PKG_VER=1.0.5
SOURCE=https://www.x.org/pub/individual/app/xwud-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}
diff --git a/repo/zynaddsubfx/.zynaddsubfx.xibuild.swp b/repo/zynaddsubfx/.zynaddsubfx.xibuild.swp
new file mode 100644
index 0000000..bd4f3dd
--- /dev/null
+++ b/repo/zynaddsubfx/.zynaddsubfx.xibuild.swp
Binary files differ
diff --git a/repo/zynaddsubfx/zynaddsubfx.xibuild b/repo/zynaddsubfx/zynaddsubfx.xibuild
new file mode 100644
index 0000000..c730c5c
--- /dev/null
+++ b/repo/zynaddsubfx/zynaddsubfx.xibuild
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+NAME="zynaddsubfx"
+DESC="fully featured open source software synthesizer"
+
+MAKEDEPS="cmake "
+DEPS="pkg-config zlib mxml ntk libx11 liblo fftw libxpm pulseaudio jack alsa-lib doxygen fltk "
+
+PKG_VER=3.0.5
+SOURCE="http://sourceforge.net/projects/zynaddsubfx/files/zynaddsubfx/$PKG_VER/zynaddsubfx-$PKG_VER.tar.bz2/download"
+
+build () {
+ cmake -B build \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=/usr/lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DBUILD_STATIC_LIBS=OFF
+ cmake --build build
+}
+
+package () {
+ DESTDIR="$PKG_DEST" cmake --install build
+}
diff --git a/skip/xf86-video-vga.xibuild b/skip/xf86-video-vga.xibuild
index f6cb712..aa5f374 100644
--- a/skip/xf86-video-vga.xibuild
+++ b/skip/xf86-video-vga.xibuild
@@ -9,7 +9,7 @@ PKG_VER=4.1.0
SOURCE=https://www.x.org/pub/individual/driver/xf86-video-vga-$PKG_VER.tar.bz2
build () {
- ./configure $XORG_CONFIG
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static
make
}