summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Cardona <remi@gentoo.org>2008-10-19 21:36:06 +0000
committerRémi Cardona <remi@gentoo.org>2008-10-19 21:36:06 +0000
commitf9973c765ef27eace0fda24d64472654f1e6f48b (patch)
treecf246acc907333674efa67367da78357a1b1af3e /x11-libs
parentdowngrade EAPI to 0 as this seems to cause troubles to some users (bug #24250... (diff)
downloadgentoo-2-f9973c765ef27eace0fda24d64472654f1e6f48b.tar.gz
gentoo-2-f9973c765ef27eace0fda24d64472654f1e6f48b.tar.bz2
gentoo-2-f9973c765ef27eace0fda24d64472654f1e6f48b.zip
x11-libs/libdrm: bump to 2.4.0 (under p.mask, some drivers are broken, see bug #242698)
(Portage version: 2.2_rc12/cvs/Linux 2.6.26-gentoo-r1 i686)
Diffstat (limited to 'x11-libs')
-rw-r--r--x11-libs/libdrm/ChangeLog10
-rw-r--r--x11-libs/libdrm/files/2.4.0-intel-avoid-deadlock-in-intel_bufmgr_fake.patch67
-rw-r--r--x11-libs/libdrm/files/2.4.0-intel-ioctl-is-not-defined-to-return-errno.patch29
-rw-r--r--x11-libs/libdrm/libdrm-2.4.0.ebuild47
4 files changed, 152 insertions, 1 deletions
diff --git a/x11-libs/libdrm/ChangeLog b/x11-libs/libdrm/ChangeLog
index 4d06dc328cf7..9a3dfc0a6daf 100644
--- a/x11-libs/libdrm/ChangeLog
+++ b/x11-libs/libdrm/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for x11-libs/libdrm
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/ChangeLog,v 1.56 2008/07/01 08:32:48 dberkholz Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/ChangeLog,v 1.57 2008/10/19 21:36:06 remi Exp $
+
+*libdrm-2.4.0 (19 Oct 2008)
+
+ 19 Oct 2008; Rémi Cardona <remi@gentoo.org>
+ +files/2.4.0-intel-avoid-deadlock-in-intel_bufmgr_fake.patch,
+ +files/2.4.0-intel-ioctl-is-not-defined-to-return-errno.patch,
+ +libdrm-2.4.0.ebuild:
+ bump to 2.4.0 (under p.mask, some drivers are broken, see bug #242698)
*libdrm-2.3.1 (01 Jul 2008)
diff --git a/x11-libs/libdrm/files/2.4.0-intel-avoid-deadlock-in-intel_bufmgr_fake.patch b/x11-libs/libdrm/files/2.4.0-intel-avoid-deadlock-in-intel_bufmgr_fake.patch
new file mode 100644
index 000000000000..0aff822a294a
--- /dev/null
+++ b/x11-libs/libdrm/files/2.4.0-intel-avoid-deadlock-in-intel_bufmgr_fake.patch
@@ -0,0 +1,67 @@
+From 769197c8f16eaf3c0a476a4459e535afd4a939cb Mon Sep 17 00:00:00 2001
+From: Xiang, Haihao <haihao.xiang@intel.com>
+Date: Thu, 16 Oct 2008 10:37:30 +0800
+Subject: [PATCH] intel: avoid deadlock in intel_bufmgr_fake.
+
+---
+ libdrm/intel/intel_bufmgr_fake.c | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c
+index 8e476c4..c82ce5a 100644
+--- a/libdrm/intel/intel_bufmgr_fake.c
++++ b/libdrm/intel/intel_bufmgr_fake.c
+@@ -1053,12 +1053,10 @@ dri_fake_bo_unmap(dri_bo *bo)
+ }
+
+ static void
+-dri_fake_kick_all(dri_bufmgr_fake *bufmgr_fake)
++dri_fake_kick_all_locked(dri_bufmgr_fake *bufmgr_fake)
+ {
+ struct block *block, *tmp;
+
+- pthread_mutex_lock(&bufmgr_fake->lock);
+-
+ bufmgr_fake->performed_rendering = 0;
+ /* okay for ever BO that is on the HW kick it off.
+ seriously not afraid of the POLICE right now */
+@@ -1073,7 +1071,6 @@ dri_fake_kick_all(dri_bufmgr_fake *bufmgr_fake)
+ bo_fake->dirty = 1;
+ }
+
+- pthread_mutex_unlock(&bufmgr_fake->lock);
+ }
+
+ static int
+@@ -1358,7 +1355,7 @@ dri_fake_bo_exec(dri_bo *bo, int used,
+ if (bufmgr_fake->fail == 1) {
+ if (retry_count == 0) {
+ retry_count++;
+- dri_fake_kick_all(bufmgr_fake);
++ dri_fake_kick_all_locked(bufmgr_fake);
+ bufmgr_fake->fail = 0;
+ goto restart;
+ } else /* dump out the memory here */
+@@ -1369,8 +1366,10 @@ dri_fake_bo_exec(dri_bo *bo, int used,
+
+ if (bufmgr_fake->exec != NULL) {
+ int ret = bufmgr_fake->exec(bo, used, bufmgr_fake->exec_priv);
+- if (ret != 0)
++ if (ret != 0) {
++ pthread_mutex_unlock(&bufmgr_fake->lock);
+ return ret;
++ }
+ } else {
+ batch.start = bo->offset;
+ batch.used = used;
+@@ -1382,6 +1381,7 @@ dri_fake_bo_exec(dri_bo *bo, int used,
+ if (drmCommandWrite(bufmgr_fake->fd, DRM_I915_BATCHBUFFER, &batch,
+ sizeof(batch))) {
+ drmMsg("DRM_I915_BATCHBUFFER: %d\n", -errno);
++ pthread_mutex_unlock(&bufmgr_fake->lock);
+ return -errno;
+ }
+ }
+--
+1.6.0.2
+
diff --git a/x11-libs/libdrm/files/2.4.0-intel-ioctl-is-not-defined-to-return-errno.patch b/x11-libs/libdrm/files/2.4.0-intel-ioctl-is-not-defined-to-return-errno.patch
new file mode 100644
index 000000000000..3c87595f8df1
--- /dev/null
+++ b/x11-libs/libdrm/files/2.4.0-intel-ioctl-is-not-defined-to-return-errno.patch
@@ -0,0 +1,29 @@
+From a59ea02ff839fa0801763a90beb8b232b933c746 Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+Date: Thu, 16 Oct 2008 21:15:01 -0700
+Subject: [PATCH] intel: ioctl is not defined to return -errno
+
+Don't count on ioctl returning -errno; use errno directly.
+
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Signed-off-by: Eric Anholt <eric@anholt.net>
+---
+ libdrm/intel/intel_bufmgr_gem.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c
+index 33853c4..081eb2a 100644
+--- a/libdrm/intel/intel_bufmgr_gem.c
++++ b/libdrm/intel/intel_bufmgr_gem.c
+@@ -790,7 +790,7 @@ dri_gem_bo_exec(dri_bo *bo, int used,
+
+ do {
+ ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER, &execbuf);
+- } while (ret == -EAGAIN);
++ } while (ret != 0 && errno == EAGAIN);
+
+ intel_update_buffer_offsets (bufmgr_gem);
+
+--
+1.6.0.2
+
diff --git a/x11-libs/libdrm/libdrm-2.4.0.ebuild b/x11-libs/libdrm/libdrm-2.4.0.ebuild
new file mode 100644
index 000000000000..13394a18b593
--- /dev/null
+++ b/x11-libs/libdrm/libdrm-2.4.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/libdrm-2.4.0.ebuild,v 1.1 2008/10/19 21:36:06 remi Exp $
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="X.Org libdrm library"
+HOMEPAGE="http://dri.freedesktop.org/"
+SRC_URI="http://dri.freedesktop.org/libdrm/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="
+ dev-libs/libpthread-stubs"
+DEPEND="${RDEPEND}"
+
+# FIXME, we should try to see how we can fit the --enable-udev configure flag
+
+PATCHES=(
+ "${FILESDIR}/2.4.0-intel-avoid-deadlock-in-intel_bufmgr_fake.patch"
+ "${FILESDIR}/2.4.0-intel-ioctl-is-not-defined-to-return-errno.patch"
+ )
+
+pkg_preinst() {
+ x-modular_pkg_preinst
+
+ if [[ -e ${ROOT}/usr/$(get_libdir)/libdrm.so.1 ]] ; then
+ cp -pPR "${ROOT}"/usr/$(get_libdir)/libdrm.so.{1,1.0.0} "${D}"/usr/$(get_libdir)/
+ fi
+}
+
+pkg_postinst() {
+ x-modular_pkg_postinst
+
+ if [[ -e ${ROOT}/usr/$(get_libdir)/libdrm.so.1 ]] ; then
+ elog "You must re-compile all packages that are linked against"
+ elog "libdrm 1 by using revdep-rebuild from gentoolkit:"
+ elog "# revdep-rebuild --library libdrm.so.1"
+ elog "After this, you can delete /usr/$(get_libdir)/libdrm.so.1"
+ elog "and /usr/$(get_libdir)/libdrm.so.1.0.0 ."
+ epause
+ fi
+}