[arch-commits] Commit in primus/repos (6 files)

Jan Steffens heftig at archlinux.org
Mon Feb 27 20:26:17 UTC 2017


    Date: Monday, February 27, 2017 @ 20:26:16
  Author: heftig
Revision: 214099

archrelease: copy trunk to community-testing-i686, community-testing-x86_64

Added:
  primus/repos/community-testing-i686/
  primus/repos/community-testing-i686/PKGBUILD
    (from rev 214098, primus/trunk/PKGBUILD)
  primus/repos/community-testing-i686/register_cleanup.patch
    (from rev 214098, primus/trunk/register_cleanup.patch)
  primus/repos/community-testing-x86_64/
  primus/repos/community-testing-x86_64/PKGBUILD
    (from rev 214098, primus/trunk/PKGBUILD)
  primus/repos/community-testing-x86_64/register_cleanup.patch
    (from rev 214098, primus/trunk/register_cleanup.patch)

-------------------------------------------------+
 community-testing-i686/PKGBUILD                 |   43 ++++++++++++++++++++
 community-testing-i686/register_cleanup.patch   |   47 ++++++++++++++++++++++
 community-testing-x86_64/PKGBUILD               |   43 ++++++++++++++++++++
 community-testing-x86_64/register_cleanup.patch |   47 ++++++++++++++++++++++
 4 files changed, 180 insertions(+)

Copied: primus/repos/community-testing-i686/PKGBUILD (from rev 214098, primus/trunk/PKGBUILD)
===================================================================
--- community-testing-i686/PKGBUILD	                        (rev 0)
+++ community-testing-i686/PKGBUILD	2017-02-27 20:26:16 UTC (rev 214099)
@@ -0,0 +1,43 @@
+# $Id$
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Alexander Monakov <amonakov at gmail.com>
+
+pkgname=primus
+pkgver=20151110
+pkgrel=7
+pkgdesc="Faster OpenGL offloading for Bumblebee"
+arch=('i686' 'x86_64')
+url="https://github.com/amonakov/primus"
+license=('custom:ISC')
+depends=('bumblebee')
+makedepends=('git')
+_commit=d1afbf6fce2778c0751eddf19db9882e04f18bfd  # master
+source=("git+https://github.com/amonakov/primus#commit=$_commit"
+        "register_cleanup.patch")
+sha1sums=('SKIP'
+          'fd48f89c55c1ad854d7a985781faed2c52c0135f')
+
+prepare() {
+  cd primus
+  patch -Np1 -i ../register_cleanup.patch
+}
+
+build() {
+  cd primus
+  make
+}
+
+package() {
+  cd primus
+
+  sed -e '/^PRIMUS_libGL=/cPRIMUS_libGL=/usr/\\$LIB/primus' \
+      -e '/^exec/iexport __GLVND_DISALLOW_PATCHING=1' \
+    primusrun | install -D /dev/stdin "$pkgdir/usr/bin/primusrun"
+
+  install -D lib/libGL.so.1 "$pkgdir/usr/lib/primus/libGL.so.1"
+  install -D primus.bash-completion "$pkgdir/usr/share/bash-completion/completions/primusrun"
+  install -D primusrun.1 "$pkgdir/usr/share/man/man1/primusrun.1"
+  install -D -m644 LICENSE.txt "$pkgdir/usr/share/licenses/primus/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: primus/repos/community-testing-i686/register_cleanup.patch (from rev 214098, primus/trunk/register_cleanup.patch)
===================================================================
--- community-testing-i686/register_cleanup.patch	                        (rev 0)
+++ community-testing-i686/register_cleanup.patch	2017-02-27 20:26:16 UTC (rev 214099)
@@ -0,0 +1,47 @@
+diff --git a/libglfork.cpp b/libglfork.cpp
+index 03f514f..bb42f0d 100644
+--- a/libglfork.cpp
++++ b/libglfork.cpp
+@@ -259,6 +259,22 @@ static struct PrimusInfo {
+   }
+ } primus;
+
++static void cleanup()
++{
++  primus.drawables.clear();
++}
++
++static void register_cleanup_1()
++{
++  atexit(cleanup);
++}
++
++static void register_cleanup()
++{
++  static pthread_once_t once = PTHREAD_ONCE_INIT;
++  pthread_once(&once, register_cleanup_1);
++}
++
+ // Thread-specific data
+ static __thread struct {
+   Display *dpy;
+@@ -622,11 +638,6 @@ GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXConte
+ void glXDestroyContext(Display *dpy, GLXContext ctx)
+ {
+   primus.contexts.erase(ctx);
+-  // kludge: reap background tasks when deleting the last context
+-  // otherwise something will deadlock during unloading the library
+-  if (primus.contexts.empty())
+-    for (DrawablesInfo::iterator i = primus.drawables.begin(); i != primus.drawables.end(); i++)
+-      i->second.reap_workers();
+   primus.afns.glXDestroyContext(primus.adpy, ctx);
+ }
+
+@@ -720,6 +731,7 @@ void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
+     di.actx = ctx;
+     di.d.spawn_worker(drawable, display_work);
+     di.r.spawn_worker(drawable, readback_work);
++    register_cleanup();
+   }
+   // Readback thread needs a sync object to avoid reading an incomplete frame
+   di.sync = primus.afns.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);

Copied: primus/repos/community-testing-x86_64/PKGBUILD (from rev 214098, primus/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2017-02-27 20:26:16 UTC (rev 214099)
@@ -0,0 +1,43 @@
+# $Id$
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Alexander Monakov <amonakov at gmail.com>
+
+pkgname=primus
+pkgver=20151110
+pkgrel=7
+pkgdesc="Faster OpenGL offloading for Bumblebee"
+arch=('i686' 'x86_64')
+url="https://github.com/amonakov/primus"
+license=('custom:ISC')
+depends=('bumblebee')
+makedepends=('git')
+_commit=d1afbf6fce2778c0751eddf19db9882e04f18bfd  # master
+source=("git+https://github.com/amonakov/primus#commit=$_commit"
+        "register_cleanup.patch")
+sha1sums=('SKIP'
+          'fd48f89c55c1ad854d7a985781faed2c52c0135f')
+
+prepare() {
+  cd primus
+  patch -Np1 -i ../register_cleanup.patch
+}
+
+build() {
+  cd primus
+  make
+}
+
+package() {
+  cd primus
+
+  sed -e '/^PRIMUS_libGL=/cPRIMUS_libGL=/usr/\\$LIB/primus' \
+      -e '/^exec/iexport __GLVND_DISALLOW_PATCHING=1' \
+    primusrun | install -D /dev/stdin "$pkgdir/usr/bin/primusrun"
+
+  install -D lib/libGL.so.1 "$pkgdir/usr/lib/primus/libGL.so.1"
+  install -D primus.bash-completion "$pkgdir/usr/share/bash-completion/completions/primusrun"
+  install -D primusrun.1 "$pkgdir/usr/share/man/man1/primusrun.1"
+  install -D -m644 LICENSE.txt "$pkgdir/usr/share/licenses/primus/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: primus/repos/community-testing-x86_64/register_cleanup.patch (from rev 214098, primus/trunk/register_cleanup.patch)
===================================================================
--- community-testing-x86_64/register_cleanup.patch	                        (rev 0)
+++ community-testing-x86_64/register_cleanup.patch	2017-02-27 20:26:16 UTC (rev 214099)
@@ -0,0 +1,47 @@
+diff --git a/libglfork.cpp b/libglfork.cpp
+index 03f514f..bb42f0d 100644
+--- a/libglfork.cpp
++++ b/libglfork.cpp
+@@ -259,6 +259,22 @@ static struct PrimusInfo {
+   }
+ } primus;
+
++static void cleanup()
++{
++  primus.drawables.clear();
++}
++
++static void register_cleanup_1()
++{
++  atexit(cleanup);
++}
++
++static void register_cleanup()
++{
++  static pthread_once_t once = PTHREAD_ONCE_INIT;
++  pthread_once(&once, register_cleanup_1);
++}
++
+ // Thread-specific data
+ static __thread struct {
+   Display *dpy;
+@@ -622,11 +638,6 @@ GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXConte
+ void glXDestroyContext(Display *dpy, GLXContext ctx)
+ {
+   primus.contexts.erase(ctx);
+-  // kludge: reap background tasks when deleting the last context
+-  // otherwise something will deadlock during unloading the library
+-  if (primus.contexts.empty())
+-    for (DrawablesInfo::iterator i = primus.drawables.begin(); i != primus.drawables.end(); i++)
+-      i->second.reap_workers();
+   primus.afns.glXDestroyContext(primus.adpy, ctx);
+ }
+
+@@ -720,6 +731,7 @@ void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
+     di.actx = ctx;
+     di.d.spawn_worker(drawable, display_work);
+     di.r.spawn_worker(drawable, readback_work);
++    register_cleanup();
+   }
+   // Readback thread needs a sync object to avoid reading an incomplete frame
+   di.sync = primus.afns.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);



More information about the arch-commits mailing list