summaryrefslogtreecommitdiff
path: root/extra/libdrm
diff options
context:
space:
mode:
Diffstat (limited to 'extra/libdrm')
-rw-r--r--extra/libdrm/COPYING48
-rw-r--r--extra/libdrm/PKGBUILD43
-rw-r--r--extra/libdrm/intel-git-fixes.patch144
-rw-r--r--extra/libdrm/no-pthread-stubs.patch65
4 files changed, 300 insertions, 0 deletions
diff --git a/extra/libdrm/COPYING b/extra/libdrm/COPYING
new file mode 100644
index 000000000..6e74c337c
--- /dev/null
+++ b/extra/libdrm/COPYING
@@ -0,0 +1,48 @@
+ Copyright 2005 Adam Jackson.
+
+ 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 on the rights to use, copy, modify, merge,
+ publish, distribute, sub license, 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 (including the
+ next paragraph) 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
+ NON-INFRINGEMENT. IN NO EVENT SHALL ADAM JACKSON 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.
+
+------------------------------------------------------------------------
+
+ Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ 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 (including the
+ next paragraph) 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 PRECISION INSIGHT AND/OR ITS
+ SUPPLIERS 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.
diff --git a/extra/libdrm/PKGBUILD b/extra/libdrm/PKGBUILD
new file mode 100644
index 000000000..6737913e2
--- /dev/null
+++ b/extra/libdrm/PKGBUILD
@@ -0,0 +1,43 @@
+# $Id: PKGBUILD 110193 2011-02-17 14:28:04Z jgc $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=libdrm
+pkgver=2.4.23
+pkgrel=2
+pkgdesc="Userspace interface to kernel DRM services"
+arch=(i686 x86_64)
+license=('custom')
+depends=('glibc')
+options=('!libtool')
+url="http://dri.freedesktop.org/"
+source=(http://dri.freedesktop.org/${pkgname}/${pkgname}-${pkgver}.tar.bz2
+ no-pthread-stubs.patch
+ intel-git-fixes.patch
+ COPYING)
+sha1sums=('9d651d1e394654c02343e3d95c0f8a442a91ac75'
+ 'af2d9871565ea4cf524873f897691a18b2bba944'
+ '40d5a749f05dc097c91c087fe1f8b970613e9098'
+ 'ba3dcd636997ee0d30df14b03dae05c24ae5d094')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/no-pthread-stubs.patch"
+ patch -Np1 -i "${srcdir}/intel-git-fixes.patch"
+
+ libtoolize --force
+ autoreconf --force --install
+ ./configure --prefix=/usr \
+ --enable-udev \
+ --enable-intel \
+ --enable-radeon \
+ --enable-vmwgfx-experimental-api \
+ --enable-nouveau-experimental-api
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -m644 "${srcdir}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/"
+}
diff --git a/extra/libdrm/intel-git-fixes.patch b/extra/libdrm/intel-git-fixes.patch
new file mode 100644
index 000000000..d1f427c10
--- /dev/null
+++ b/extra/libdrm/intel-git-fixes.patch
@@ -0,0 +1,144 @@
+commit 6717b7579f84d05e45e7846d2b6e767760461709
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Jan 12 10:57:46 2011 +0000
+
+ intel: Fallback to old exec if no mrb_exec is available
+
+ Reported-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33016
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/intel/intel_bufmgr.c b/intel/intel_bufmgr.c
+index b7c5c09..2546222 100644
+--- a/intel/intel_bufmgr.c
++++ b/intel/intel_bufmgr.c
+@@ -143,6 +143,10 @@ drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used,
+ cliprects, num_cliprects, DR4,
+ rings);
+
++ if (ring_flag == 0)
++ return bo->bufmgr->bo_exec(bo, used,
++ cliprects, num_cliprects, DR4);
++
+ return -ENODEV;
+ }
+
+commit 53581b6210c024044e0065527d1506e6f5657ef5
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Mon Feb 14 09:27:05 2011 +0000
+
+ intel: Set the public handle after opening by name
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
+index 72c8731..092b56a 100644
+--- a/intel/intel_bufmgr_gem.c
++++ b/intel/intel_bufmgr_gem.c
+@@ -816,6 +816,7 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr,
+ atomic_set(&bo_gem->refcount, 1);
+ bo_gem->validate_index = -1;
+ bo_gem->gem_handle = open_arg.handle;
++ bo_gem->bo.handle = open_arg.handle;
+ bo_gem->global_name = handle;
+ bo_gem->reusable = 0;
+
+commit 36d4939343d8789d9066f7245fa2d4fe69119dd8
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Mon Feb 14 09:39:06 2011 +0000
+
+ intel: Remember named bo
+
+ ... and if asked to open a bo by the same global name, return a fresh
+ reference to the previously allocated buffer.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
+index 092b56a..3cdffce 100644
+--- a/intel/intel_bufmgr_gem.c
++++ b/intel/intel_bufmgr_gem.c
+@@ -95,6 +95,8 @@ typedef struct _drm_intel_bufmgr_gem {
+ int num_buckets;
+ time_t time;
+
++ drmMMListHead named;
++
+ uint64_t gtt_size;
+ int available_fences;
+ int pci_device;
+@@ -124,6 +126,7 @@ struct _drm_intel_bo_gem {
+ * Kenel-assigned global name for this object
+ */
+ unsigned int global_name;
++ drmMMListHead name_list;
+
+ /**
+ * Index of the buffer within the validation list while preparing a
+@@ -690,6 +693,8 @@ retry:
+ drm_intel_gem_bo_free(&bo_gem->bo);
+ return NULL;
+ }
++
++ DRMINITLISTHEAD(&bo_gem->name_list);
+ }
+
+ bo_gem->name = name;
+@@ -792,6 +797,23 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr,
+ int ret;
+ struct drm_gem_open open_arg;
+ struct drm_i915_gem_get_tiling get_tiling;
++ drmMMListHead *list;
++
++ /* At the moment most applications only have a few named bo.
++ * For instance, in a DRI client only the render buffers passed
++ * between X and the client are named. And since X returns the
++ * alternating names for the front/back buffer a linear search
++ * provides a sufficiently fast match.
++ */
++ for (list = bufmgr_gem->named.next;
++ list != &bufmgr_gem->named;
++ list = list->next) {
++ bo_gem = DRMLISTENTRY(drm_intel_bo_gem, list, name_list);
++ if (bo_gem->global_name == handle) {
++ drm_intel_gem_bo_reference(&bo_gem->bo);
++ return &bo_gem->bo;
++ }
++ }
+
+ bo_gem = calloc(1, sizeof(*bo_gem));
+ if (!bo_gem)
+@@ -834,6 +856,7 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr,
+ /* XXX stride is unknown */
+ drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem);
+
++ DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named);
+ DBG("bo_create_from_handle: %d (%s)\n", handle, bo_gem->name);
+
+ return &bo_gem->bo;
+@@ -925,6 +948,8 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
+ bo_gem->relocs = NULL;
+ }
+
++ DRMLISTDEL(&bo_gem->name_list);
++
+ bucket = drm_intel_gem_bo_bucket_for_size(bufmgr_gem, bo->size);
+ /* Put the buffer into our internal cache for reuse if we can. */
+ if (bufmgr_gem->bo_reuse && bo_gem->reusable && bucket != NULL &&
+@@ -1771,6 +1796,8 @@ drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name)
+ return -errno;
+ bo_gem->global_name = flink.name;
+ bo_gem->reusable = 0;
++
++ DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named);
+ }
+
+ *name = bo_gem->global_name;
+@@ -2217,6 +2244,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
+ drm_intel_gem_get_pipe_from_crtc_id;
+ bufmgr_gem->bufmgr.bo_references = drm_intel_gem_bo_references;
+
++ DRMINITLISTHEAD(&bufmgr_gem->named);
+ init_cache_buckets(bufmgr_gem);
+
+ return &bufmgr_gem->bufmgr;
diff --git a/extra/libdrm/no-pthread-stubs.patch b/extra/libdrm/no-pthread-stubs.patch
new file mode 100644
index 000000000..6602f8785
--- /dev/null
+++ b/extra/libdrm/no-pthread-stubs.patch
@@ -0,0 +1,65 @@
+diff -ru libdrm-2.4.0/configure.ac libdrm-2.4.0-nostubs/configure.ac
+--- libdrm-2.4.0/configure.ac 2008-10-09 21:57:09.000000000 +0200
++++ libdrm-2.4.0-nostubs/configure.ac 2008-10-21 10:48:24.000000000 +0200
+@@ -32,10 +32,6 @@
+ AC_HEADER_STDC
+ AC_SYS_LARGEFILE
+
+-PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
+-AC_SUBST(PTHREADSTUBS_CFLAGS)
+-AC_SUBST(PTHREADSTUBS_LIBS)
+-
+ pkgconfigdir=${libdir}/pkgconfig
+ AC_SUBST(pkgconfigdir)
+ AC_ARG_ENABLE(udev, AS_HELP_STRING([--enable-udev],
+--- libdrm-2.4.16/intel/Makefile.am 2009-11-20 23:54:36.000000000 +0000
++++ libdrm-2.4.16/intel/Makefile.am.new 2009-12-07 08:11:32.235748069 +0000
+@@ -26,13 +26,12 @@
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/intel \
+- $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+ libdrm_intel_la_LTLIBRARIES = libdrm_intel.la
+ libdrm_intel_ladir = $(libdir)
+ libdrm_intel_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+-libdrm_intel_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @CLOCK_LIB@
++libdrm_intel_la_LIBADD = ../libdrm.la @CLOCK_LIB@
+
+ libdrm_intel_la_SOURCES = \
+ intel_atomic.h \
+--- libdrm-2.4.16/radeon/Makefile.am 2009-11-20 23:54:36.000000000 +0000
++++ libdrm-2.4.16/radeon/Makefile.am.new 2009-12-07 08:12:31.889075388 +0000
+@@ -26,13 +26,12 @@
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/radeon \
+- $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+ libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la
+ libdrm_radeon_ladir = $(libdir)
+ libdrm_radeon_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+-libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
++libdrm_radeon_la_LIBADD = ../libdrm.la
+
+ libdrm_radeon_la_SOURCES = \
+ radeon_bo_gem.c \
+--- libdrm-2.4.16/nouveau/Makefile.am 2009-11-20 23:54:36.000000000 +0000
++++ libdrm-2.4.16/nouveau/Makefile.am.new 2009-12-07 08:13:01.489072320 +0000
+@@ -2,13 +2,12 @@
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/nouveau \
+- $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+ libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la
+ libdrm_nouveau_ladir = $(libdir)
+ libdrm_nouveau_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+-libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
++libdrm_nouveau_la_LIBADD = ../libdrm.la
+
+ libdrm_nouveau_la_SOURCES = \
+ nouveau_device.c \