[arch-commits] Commit in libdrm/trunk (PKGBUILD intel-bo-cache.patch)

Jan de Groot jgc at archlinux.org
Thu May 28 19:12:23 UTC 2009


    Date: Thursday, May 28, 2009 @ 15:12:22
  Author: jgc
Revision: 40196

upgpkg: libdrm 2.4.11-2
    limit intel bo cache

Added:
  libdrm/trunk/intel-bo-cache.patch
Modified:
  libdrm/trunk/PKGBUILD

----------------------+
 PKGBUILD             |    5 ++++-
 intel-bo-cache.patch |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-05-28 19:09:51 UTC (rev 40195)
+++ PKGBUILD	2009-05-28 19:12:22 UTC (rev 40196)
@@ -3,7 +3,7 @@
 
 pkgname=libdrm
 pkgver=2.4.11
-pkgrel=1
+pkgrel=2
 pkgdesc="Userspace interface to kernel DRM services"
 arch=(i686 x86_64)
 license=('custom')
@@ -12,14 +12,17 @@
 url="http://dri.freedesktop.org/"
 source=(http://dri.freedesktop.org/${pkgname}/${pkgname}-${pkgver}.tar.bz2
 	no-pthread-stubs.patch
+	intel-bo-cache.patch
 	COPYING)
 md5sums=('e0e66fae165d0b665b61e9516bf33ade'
          'e5f8f3b9f6357c2f82950cdfb8e9c9ec'
+	 '53e7c214f6fb9fea8deb1ba3bf9b13ed'
 	 'ba65e71c481b94ef0fb6c23c7f21ffa1')
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   patch -Np1 -i "${srcdir}/no-pthread-stubs.patch" || return 1
+  patch -Np1 -i "${srcdir}/intel-bo-cache.patch" || return 1
   libtoolize --force || return 1
   aclocal || return 1
   autoconf || return 1

Added: intel-bo-cache.patch
===================================================================
--- intel-bo-cache.patch	                        (rev 0)
+++ intel-bo-cache.patch	2009-05-28 19:12:22 UTC (rev 40196)
@@ -0,0 +1,40 @@
+From 469655fab7a56eb32ff8cdefb33992813342353a Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Mon, 18 May 2009 23:07:45 +0000
+Subject: intel: Only do BO caching up to 64MB objects.
+
+This avoids making objects significantly bigger than they would be
+otherwise, which would result in some failing at binding to the GTT.
+Found from firefox hanging on:
+http://upload.wikimedia.org/wikipedia/commons/b/b7/Singapore_port_panorama.jpg
+due to a software fallback trying to do a GTT-mapped copy between two 73MB
+BOs that were instead each 128MB, and failing because both couldn't fit
+simultaneously.
+
+The cost here is that we get no opportunity to cache these objects and
+avoid the mapping.  But since the objects are a significant percentage
+of the aperture size, each mapped access is likely having to fault and rebind
+the object most of the time anyway.
+
+Bug #20152 (2/3)
+---
+diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c
+index 61943f0..ef046f4 100644
+--- a/libdrm/intel/intel_bufmgr_gem.c
++++ b/libdrm/intel/intel_bufmgr_gem.c
+@@ -80,10 +80,10 @@ struct drm_intel_gem_bo_bucket {
+    int num_entries;
+ };
+ 
+-/* Arbitrarily chosen, 16 means that the maximum size we'll cache for reuse
+- * is 1 << 16 pages, or 256MB.
++/* Only cache objects up to 64MB.  Bigger than that, and the rounding of the
++ * size makes many operations fail that wouldn't otherwise.
+  */
+-#define DRM_INTEL_GEM_BO_BUCKETS	16
++#define DRM_INTEL_GEM_BO_BUCKETS	14
+ typedef struct _drm_intel_bufmgr_gem {
+     drm_intel_bufmgr bufmgr;
+ 
+--
+cgit v0.8.2




More information about the arch-commits mailing list