[arch-commits] Commit in libdrm/repos (5 files)

Jan de Groot jgc at archlinux.org
Mon Apr 6 12:51:51 EDT 2009


    Date: Monday, April 6, 2009 @ 12:51:51
  Author: jgc
Revision: 34098

Merged revisions 32209 via svnmerge from 
svn+ssh://svn.archlinux.org/srv/svn-packages/libdrm/trunk

........
  r32209 | jgc | 2009-03-29 15:39:05 +0000 (Sun, 29 Mar 2009) | 2 lines
  
  upgpkg: libdrm 2.4.5-3
      Update to latest git snapshot
........

Added:
  libdrm/repos/testing-i686/drm-e2d7dfb6.patch
    (from rev 32209, libdrm/trunk/drm-e2d7dfb6.patch)
Modified:
  libdrm/repos/testing-i686/	(properties)
  libdrm/repos/testing-i686/PKGBUILD
Deleted:
  libdrm/repos/testing-i686/bug18922.patch
  libdrm/repos/testing-i686/git-fixes.patch

--------------------+
 PKGBUILD           |    8 -
 bug18922.patch     |   65 --------
 drm-e2d7dfb6.patch |  401 +++++++++++++++++++++++++++++++++++++++++++++++++++
 git-fixes.patch    |  118 ---------------
 4 files changed, 405 insertions(+), 187 deletions(-)


Property changes on: libdrm/repos/testing-i686
___________________________________________________________________
Modified: svnmerge-integrated
   - /libdrm/trunk:1-29275
   + /libdrm/trunk:1-34097

Modified: testing-i686/PKGBUILD
===================================================================
--- testing-i686/PKGBUILD	2009-04-06 16:43:58 UTC (rev 34097)
+++ testing-i686/PKGBUILD	2009-04-06 16:51:51 UTC (rev 34098)
@@ -3,7 +3,7 @@
 
 pkgname=libdrm
 pkgver=2.4.5
-pkgrel=2
+pkgrel=3
 pkgdesc="Userspace interface to kernel DRM services"
 arch=(i686 x86_64)
 depends=('glibc')
@@ -13,19 +13,19 @@
 	no-pthread-stubs.patch
 	nouveau_private.h
 	nouveau_dma.h
-	git-fixes.patch)
+	drm-e2d7dfb6.patch)
 md5sums=('0d09025f069ff1a986cf3339e51908b3'
          'e5f8f3b9f6357c2f82950cdfb8e9c9ec'
          '0cb6d0d40b4031604a9063f6e384b548'
 	 'a9c94dcf9625fa99862f695a744258e8'
-	 '2dee581529aa50477f7c22e59dfbdf5d')
+	 '2921adb7079226c7bc2a3b9863dabcbc')
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   cp "${srcdir}/nouveau_private.h" "${srcdir}/nouveau_dma.h" \
     libdrm/nouveau/ || return 1
   patch -Np1 -i "${srcdir}/no-pthread-stubs.patch" || return 1
-  patch -Np1 -i "${srcdir}/git-fixes.patch" || return 1
+  patch -Np1 -i "${srcdir}/drm-e2d7dfb6.patch" || return 1
   libtoolize --force || return 1
   aclocal || return 1
   autoconf || return 1

Deleted: testing-i686/bug18922.patch
===================================================================
--- testing-i686/bug18922.patch	2009-04-06 16:43:58 UTC (rev 34097)
+++ testing-i686/bug18922.patch	2009-04-06 16:51:51 UTC (rev 34098)
@@ -1,65 +0,0 @@
-diff -Naur libdrm-2.3.1.orig/libdrm/Makefile.am libdrm-2.3.1/libdrm/Makefile.am
---- libdrm-2.3.1.orig/libdrm/Makefile.am	2008-07-01 09:51:40.000000000 +0200
-+++ libdrm-2.3.1/libdrm/Makefile.am	2009-01-17 13:10:33.000000000 +0100
-@@ -21,6 +21,7 @@
- libdrm_la_LTLIBRARIES = libdrm.la
- libdrm_ladir = $(libdir)
- libdrm_la_LDFLAGS = -version-number 2:3:1 -no-undefined
-+libdrm_la_LIBADD = -lrt
- 
- AM_CFLAGS = -I$(top_srcdir)/shared-core
- libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c
-diff -Naur libdrm-2.3.1.orig/libdrm/Makefile.in libdrm-2.3.1/libdrm/Makefile.in
---- libdrm-2.3.1.orig/libdrm/Makefile.in	2008-07-01 09:55:48.000000000 +0200
-+++ libdrm-2.3.1/libdrm/Makefile.in	2009-01-17 13:11:27.000000000 +0100
-@@ -73,7 +73,7 @@
- 	"$(DESTDIR)$(libdrmincludedir)"
- libdrm_laLTLIBRARIES_INSTALL = $(INSTALL)
- LTLIBRARIES = $(libdrm_la_LTLIBRARIES)
--libdrm_la_LIBADD =
-+libdrm_la_LIBADD = -lrt
- am_libdrm_la_OBJECTS = xf86drm.lo xf86drmHash.lo xf86drmRandom.lo \
- 	xf86drmSL.lo
- libdrm_la_OBJECTS = $(am_libdrm_la_OBJECTS)
-diff -Naur libdrm-2.3.1.orig/libdrm/xf86drm.c libdrm-2.3.1/libdrm/xf86drm.c
---- libdrm-2.3.1.orig/libdrm/xf86drm.c	2008-07-01 09:51:40.000000000 +0200
-+++ libdrm-2.3.1/libdrm/xf86drm.c	2009-01-17 13:10:33.000000000 +0100
-@@ -42,6 +42,7 @@
- #include <fcntl.h>
- #include <errno.h>
- #include <signal.h>
-+#include <time.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #define stat_t struct stat
-@@ -1851,13 +1852,30 @@
-  */
- int drmWaitVBlank(int fd, drmVBlankPtr vbl)
- {
-+    struct timespec timeout, cur;
-     int ret;
- 
-+    ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
-+    if (ret < 0) {
-+	fprintf(stderr, "clock_gettime failed: %s\n", strerror(ret));
-+	goto out;
-+    }
-+    timeout.tv_sec++;
-+
-     do {
-        ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
-        vbl->request.type &= ~DRM_VBLANK_RELATIVE;
-+       clock_gettime(CLOCK_MONOTONIC, &cur);
-+       /* Timeout after 1s */
-+       if (cur.tv_sec > timeout.tv_sec + 1 ||
-+	   cur.tv_sec == timeout.tv_sec && cur.tv_nsec >= timeout.tv_nsec) {
-+	   errno = EBUSY;
-+	   ret = -1;
-+	   break;
-+       }
-     } while (ret && errno == EINTR);
- 
-+out:
-     return ret;
- }
- 

Copied: libdrm/repos/testing-i686/drm-e2d7dfb6.patch (from rev 32209, libdrm/trunk/drm-e2d7dfb6.patch)
===================================================================
--- testing-i686/drm-e2d7dfb6.patch	                        (rev 0)
+++ testing-i686/drm-e2d7dfb6.patch	2009-04-06 16:51:51 UTC (rev 34098)
@@ -0,0 +1,401 @@
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/intel/intel_bufmgr.h drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/intel/intel_bufmgr.h
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/intel/intel_bufmgr.h	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/intel/intel_bufmgr.h	2009-03-26 23:43:00.000000000 +0000
+@@ -115,6 +115,7 @@
+ 						unsigned int handle);
+ void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr);
+ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo);
++int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo);
+ void drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable);
+ 
+ /* drm_intel_bufmgr_fake.c */
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/intel/intel_bufmgr_fake.c drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/intel/intel_bufmgr_fake.c
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/intel/intel_bufmgr_fake.c	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/intel/intel_bufmgr_fake.c	2009-03-26 23:43:00.000000000 +0000
+@@ -444,7 +444,8 @@
+ 
+ /* Release the card storage associated with buf:
+  */
+-static void free_block(drm_intel_bufmgr_fake *bufmgr_fake, struct block *block)
++static void free_block(drm_intel_bufmgr_fake *bufmgr_fake, struct block *block,
++		       int skip_dirty_copy)
+ {
+    drm_intel_bo_fake *bo_fake;
+    DBG("free block %p %08x %d %d\n", block, block->mem->ofs, block->on_hardware, block->fenced);
+@@ -453,7 +454,11 @@
+       return;
+ 
+    bo_fake = (drm_intel_bo_fake *)block->bo;
+-   if (!(bo_fake->flags & (BM_PINNED | BM_NO_BACKING_STORE)) && (bo_fake->card_dirty == 1)) {
++
++   if (bo_fake->flags & (BM_PINNED | BM_NO_BACKING_STORE))
++      skip_dirty_copy = 1;
++
++   if (!skip_dirty_copy && (bo_fake->card_dirty == 1)) {
+      memcpy(bo_fake->backing_store, block->virtual, block->bo->size);
+      bo_fake->card_dirty = 0;
+      bo_fake->dirty = 1;
+@@ -534,7 +539,7 @@
+       set_dirty(&bo_fake->bo);
+       bo_fake->block = NULL;
+ 
+-      free_block(bufmgr_fake, block);
++      free_block(bufmgr_fake, block, 0);
+       return 1;
+    }
+ 
+@@ -557,7 +562,7 @@
+       set_dirty(&bo_fake->bo);
+       bo_fake->block = NULL;
+ 
+-      free_block(bufmgr_fake, block);
++      free_block(bufmgr_fake, block, 0);
+       return 1;
+    }
+ 
+@@ -872,7 +877,7 @@
+       assert(bo_fake->map_count == 0);
+       /* No remaining references, so free it */
+       if (bo_fake->block)
+-	 free_block(bufmgr_fake, bo_fake->block);
++	 free_block(bufmgr_fake, bo_fake->block, 1);
+       free_backing_store(bo);
+ 
+       for (i = 0; i < bo_fake->nr_relocs; i++)
+@@ -1064,7 +1069,7 @@
+       drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *)block->bo;
+ 
+       block->on_hardware = 0;
+-      free_block(bufmgr_fake, block);
++      free_block(bufmgr_fake, block, 0);
+       bo_fake->block = NULL;
+       bo_fake->validated = 0;
+       if (!(bo_fake->flags & BM_NO_BACKING_STORE))
+@@ -1463,7 +1468,7 @@
+ 
+    DRMLISTFOREACHSAFE(block, tmp, &bufmgr_fake->lru) {
+       /* Releases the memory, and memcpys dirty contents out if necessary. */
+-      free_block(bufmgr_fake, block);
++      free_block(bufmgr_fake, block, 0);
+    }
+ 
+    pthread_mutex_unlock(&bufmgr_fake->lock);
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/intel/intel_bufmgr_gem.c drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/intel/intel_bufmgr_gem.c
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/intel/intel_bufmgr_gem.c	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/intel/intel_bufmgr_gem.c	2009-03-26 23:43:00.000000000 +0000
+@@ -145,7 +145,9 @@
+     /** Number of entries in relocs */
+     int reloc_count;
+     /** Mapped address for the buffer, saved across map/unmap cycles */
+-    void *virtual;
++    void *mem_virtual;
++    /** GTT virtual address for the buffer, saved across map/unmap cycles */
++    void *gtt_virtual;
+ 
+     /** BO cache list */
+     drmMMListHead head;
+@@ -524,8 +526,10 @@
+     struct drm_gem_close close;
+     int ret;
+ 
+-    if (bo_gem->virtual)
+-	munmap (bo_gem->virtual, bo_gem->bo.size);
++    if (bo_gem->mem_virtual)
++	munmap (bo_gem->mem_virtual, bo_gem->bo.size);
++    if (bo_gem->gtt_virtual)
++	munmap (bo_gem->gtt_virtual, bo_gem->bo.size);
+ 
+     /* Close this object */
+     memset(&close, 0, sizeof(close));
+@@ -609,7 +613,7 @@
+     /* Allow recursive mapping. Mesa may recursively map buffers with
+      * nested display loops.
+      */
+-    if (!bo_gem->virtual) {
++    if (!bo_gem->mem_virtual) {
+ 	struct drm_i915_gem_mmap mmap_arg;
+ 
+ 	DBG("bo_map: %d (%s)\n", bo_gem->gem_handle, bo_gem->name);
+@@ -626,12 +630,12 @@
+ 	    pthread_mutex_unlock(&bufmgr_gem->lock);
+ 	    return ret;
+ 	}
+-	bo_gem->virtual = (void *)(uintptr_t)mmap_arg.addr_ptr;
++	bo_gem->mem_virtual = (void *)(uintptr_t)mmap_arg.addr_ptr;
+ 	bo_gem->swrast = 0;
+     }
+     DBG("bo_map: %d (%s) -> %p\n", bo_gem->gem_handle, bo_gem->name,
+-	bo_gem->virtual);
+-    bo->virtual = bo_gem->virtual;
++	bo_gem->mem_virtual);
++    bo->virtual = bo_gem->mem_virtual;
+ 
+     if (bo_gem->global_name != 0 || !bo_gem->swrast) {
+ 	set_domain.handle = bo_gem->gem_handle;
+@@ -669,7 +673,7 @@
+     pthread_mutex_lock(&bufmgr_gem->lock);
+ 
+     /* Get a mapping of the buffer if we haven't before. */
+-    if (bo_gem->virtual == NULL) {
++    if (bo_gem->gtt_virtual == NULL) {
+ 	struct drm_i915_gem_mmap_gtt mmap_arg;
+ 
+ 	DBG("bo_map_gtt: %d (%s)\n", bo_gem->gem_handle, bo_gem->name);
+@@ -690,10 +694,10 @@
+ 	}
+ 
+ 	/* and mmap it */
+-	bo_gem->virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE,
+-			       MAP_SHARED, bufmgr_gem->fd,
+-			       mmap_arg.offset);
+-	if (bo_gem->virtual == MAP_FAILED) {
++	bo_gem->gtt_virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE,
++				   MAP_SHARED, bufmgr_gem->fd,
++				   mmap_arg.offset);
++	if (bo_gem->gtt_virtual == MAP_FAILED) {
+ 	    fprintf(stderr,
+ 		    "%s:%d: Error mapping buffer %d (%s): %s .\n",
+ 		    __FILE__, __LINE__,
+@@ -704,10 +708,10 @@
+ 	}
+     }
+ 
+-    bo->virtual = bo_gem->virtual;
++    bo->virtual = bo_gem->gtt_virtual;
+ 
+     DBG("bo_map: %d (%s) -> %p\n", bo_gem->gem_handle, bo_gem->name,
+-	bo_gem->virtual);
++	bo_gem->gtt_virtual);
+ 
+     /* Now move it to the GTT domain so that the CPU caches are flushed */
+     set_domain.handle = bo_gem->gem_handle;
+@@ -719,7 +723,7 @@
+     } while (ret == -1 && errno == EINTR);
+ 
+     if (ret != 0) {
+-	    fprintf (stderr, "%s:%d: Error setting swrast %d: %s\n",
++	    fprintf (stderr, "%s:%d: Error setting domain %d: %s\n",
+ 		     __FILE__, __LINE__, bo_gem->gem_handle, strerror (errno));
+     }
+ 
+@@ -728,6 +732,26 @@
+     return 0;
+ }
+ 
++int
++drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo)
++{
++    drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
++    drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo;
++    struct drm_i915_gem_sw_finish sw_finish;
++    int ret = 0;
++
++    if (bo == NULL)
++	return 0;
++
++    assert(bo_gem->gtt_virtual != NULL);
++
++    pthread_mutex_lock(&bufmgr_gem->lock);
++    bo->virtual = NULL;
++    pthread_mutex_unlock(&bufmgr_gem->lock);
++
++    return ret;
++}
++
+ static int
+ drm_intel_gem_bo_unmap(drm_intel_bo *bo)
+ {
+@@ -739,7 +763,7 @@
+     if (bo == NULL)
+ 	return 0;
+ 
+-    assert(bo_gem->virtual != NULL);
++    assert(bo_gem->mem_virtual != NULL);
+ 
+     pthread_mutex_lock(&bufmgr_gem->lock);
+     if (bo_gem->swrast) {
+@@ -750,6 +774,7 @@
+ 	} while (ret == -1 && errno == EINTR);
+ 	bo_gem->swrast = 0;
+     }
++    bo->virtual = NULL;
+     pthread_mutex_unlock(&bufmgr_gem->lock);
+     return 0;
+ }
+@@ -1260,8 +1285,21 @@
+     int i;
+     unsigned int total = 0;
+ 
+-    for (i = 0; i < count; i++)
++    for (i = 0; i < count; i++) {
+ 	total += drm_intel_gem_bo_get_aperture_space(bo_array[i]);
++	/* For the first buffer object in the array, we get an accurate count
++	 * back for its reloc_tree size (since nothing had been flagged as
++	 * being counted yet).  We can save that value out as a more
++	 * conservative reloc_tree_size that avoids double-counting target
++	 * buffers.  Since the first buffer happens to usually be the batch
++	 * buffer in our callers, this can pull us back from doing the tree
++	 * walk on every new batch emit.
++	 */
++	if (i == 0) {
++	    drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo_array[i];
++	    bo_gem->reloc_tree_size = total;
++	}
++    }
+ 
+     for (i = 0; i < count; i++)
+ 	drm_intel_gem_bo_clear_aperture_space_flag(bo_array[i]);
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/Makefile.am drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/Makefile.am
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/Makefile.am	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/Makefile.am	2009-03-26 23:43:00.000000000 +0000
+@@ -19,7 +19,9 @@
+ 			    nouveau_bo.c \
+ 			    nouveau_resource.c \
+ 			    nouveau_dma.c \
+-			    nouveau_fence.c
++			    nouveau_fence.c \
++			    nouveau_dma.h \
++			    nouveau_private.h
+ 
+ libdrm_nouveaucommonincludedir = ${includedir}/nouveau
+ libdrm_nouveaucommoninclude_HEADERS = \
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_bo.c drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_bo.c
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_bo.c	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_bo.c	2009-03-26 23:43:00.000000000 +0000
+@@ -347,24 +347,25 @@
+ 	if (!bo || !handle)
+ 		return -EINVAL;
+ 
+-	if (!nvdev->mm_enabled)
+-		return -ENODEV;
+-
+ 	if (!nvbo->global_handle) {
+ 		struct drm_gem_flink req;
+  
+ 		ret = nouveau_bo_kalloc(nvbo, NULL);
+ 		if (ret)
+ 			return ret;
+- 
+-		req.handle = nvbo->handle;
+-		ret = ioctl(nvdev->fd, DRM_IOCTL_GEM_FLINK, &req);
+-		if (ret) {
+-			nouveau_bo_kfree(nvbo);
+-			return ret;
++
++		if (nvdev->mm_enabled) {
++			req.handle = nvbo->handle;
++			ret = ioctl(nvdev->fd, DRM_IOCTL_GEM_FLINK, &req);
++			if (ret) {
++				nouveau_bo_kfree(nvbo);
++				return ret;
++			}
++	 
++			nvbo->global_handle = req.name;
++		} else {
++			nvbo->global_handle = nvbo->offset;
+ 		}
+- 
+-		nvbo->global_handle = req.name;
+ 	}
+  
+ 	*handle = nvbo->global_handle;
+@@ -412,6 +413,8 @@
+ {
+ 	struct nouveau_bo_priv *nvbo = priv;
+ 
++	nouveau_fence_ref(NULL, &nvbo->fence);
++	nouveau_fence_ref(NULL, &nvbo->wr_fence);
+ 	nouveau_bo_kfree(nvbo);
+ 	free(nvbo);
+ }
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_device.c drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_device.c
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_device.c	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_device.c	2009-03-26 23:43:00.000000000 +0000
+@@ -76,6 +76,22 @@
+ 	}
+ 	nvdev->base.vm_vram_base = value;
+ 
++	ret = nouveau_device_get_param(&nvdev->base,
++				       NOUVEAU_GETPARAM_FB_SIZE, &value);
++	if (ret) {
++		nouveau_device_close((void *)&nvdev);
++		return ret;
++	}
++	nvdev->vram_aper_size = value;
++
++	ret = nouveau_device_get_param(&nvdev->base,
++				       NOUVEAU_GETPARAM_AGP_SIZE, &value);
++	if (ret) {
++		nouveau_device_close((void *)&nvdev);
++		return ret;
++	}
++	nvdev->gart_aper_size = value;
++
+ 	ret = nouveau_bo_init(&nvdev->base);
+ 	if (ret) {
+ 		nouveau_device_close((void *)&nvdev);
+@@ -128,7 +144,7 @@
+ {
+ 	struct nouveau_device_priv *nvdev;
+ 
+-	if (dev || !*dev)
++	if (!dev || !*dev)
+ 		return;
+ 	nvdev = nouveau_device(*dev);
+ 	*dev = NULL;
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_drmif.h drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_drmif.h
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_drmif.h	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_drmif.h	2009-03-26 23:43:00.000000000 +0000
+@@ -37,6 +37,9 @@
+ 	int needs_close;
+ 
+ 	int mm_enabled;
++/*XXX: move to nouveau_device when interface gets bumped */
++	uint64_t vram_aper_size;
++	uint64_t gart_aper_size;
+ };
+ #define nouveau_device(n) ((struct nouveau_device_priv *)(n))
+ 
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_fence.c drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_fence.c
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_fence.c	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_fence.c	2009-03-26 23:43:00.000000000 +0000
+@@ -96,22 +96,16 @@
+ int
+ nouveau_fence_ref(struct nouveau_fence *ref, struct nouveau_fence **fence)
+ {
+-	struct nouveau_fence_priv *nvfence;
+-
+ 	if (!fence)
+ 		return -EINVAL;
+ 
+-	if (*fence) {
+-		nouveau_fence_del(fence);
+-		*fence = NULL;
+-	}
++	if (ref)
++		nouveau_fence(ref)->refcount++;
+ 
+-	if (ref) {
+-		nvfence = nouveau_fence(ref);
+-		nvfence->refcount++;	
+-		*fence = &nvfence->base;
+-	}
++	if (*fence)
++		nouveau_fence_del(fence);
+ 
++	*fence = ref;
+ 	return 0;
+ }
+ 
+diff -ruN drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_private.h drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_private.h
+--- drm-a773ce1db8801fcbbdb55b54172c9cd48b92e2d7/libdrm/nouveau/nouveau_private.h	2009-02-23 21:30:44.000000000 +0000
++++ drm-e2d7dfb61ad7a97367f050150160c205614d152e/libdrm/nouveau/nouveau_private.h	2009-03-26 23:43:00.000000000 +0000
+@@ -173,7 +173,7 @@
+ 
+ 	/* Kernel object */
+ 	uint32_t global_handle;
+-	unsigned handle;
++	drm_handle_t handle;
+ 	void *map;
+ 
+ 	/* Last known information from kernel on buffer status */

Deleted: testing-i686/git-fixes.patch
===================================================================
--- testing-i686/git-fixes.patch	2009-04-06 16:43:58 UTC (rev 34097)
+++ testing-i686/git-fixes.patch	2009-04-06 16:51:51 UTC (rev 34098)
@@ -1,118 +0,0 @@
-From efa485b2cf2f1f46760a3d9297ba1a73a2dbcd05 Mon Sep 17 00:00:00 2001
-From: Eric Anholt <eric at anholt.net>
-Date: Wed, 25 Feb 2009 05:36:56 +0000
-Subject: intel: Don't copy dirty data out when freeing a BO in the fake bufmgr.
-
----
-diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c
-index e7cec35..e1f98d6 100644
---- a/libdrm/intel/intel_bufmgr_fake.c
-+++ b/libdrm/intel/intel_bufmgr_fake.c
-@@ -444,7 +444,8 @@ alloc_block(drm_intel_bo *bo)
- 
- /* Release the card storage associated with buf:
-  */
--static void free_block(drm_intel_bufmgr_fake *bufmgr_fake, struct block *block)
-+static void free_block(drm_intel_bufmgr_fake *bufmgr_fake, struct block *block,
-+		       int skip_dirty_copy)
- {
-    drm_intel_bo_fake *bo_fake;
-    DBG("free block %p %08x %d %d\n", block, block->mem->ofs, block->on_hardware, block->fenced);
-@@ -453,7 +454,11 @@ static void free_block(drm_intel_bufmgr_fake *bufmgr_fake, struct block *block)
-       return;
- 
-    bo_fake = (drm_intel_bo_fake *)block->bo;
--   if (!(bo_fake->flags & (BM_PINNED | BM_NO_BACKING_STORE)) && (bo_fake->card_dirty == 1)) {
-+
-+   if (bo_fake->flags & (BM_PINNED | BM_NO_BACKING_STORE))
-+      skip_dirty_copy = 1;
-+
-+   if (!skip_dirty_copy && (bo_fake->card_dirty == 1)) {
-      memcpy(bo_fake->backing_store, block->virtual, block->bo->size);
-      bo_fake->card_dirty = 0;
-      bo_fake->dirty = 1;
-@@ -534,7 +539,7 @@ evict_lru(drm_intel_bufmgr_fake *bufmgr_fake, unsigned int max_fence)
-       set_dirty(&bo_fake->bo);
-       bo_fake->block = NULL;
- 
--      free_block(bufmgr_fake, block);
-+      free_block(bufmgr_fake, block, 0);
-       return 1;
-    }
- 
-@@ -557,7 +562,7 @@ evict_mru(drm_intel_bufmgr_fake *bufmgr_fake)
-       set_dirty(&bo_fake->bo);
-       bo_fake->block = NULL;
- 
--      free_block(bufmgr_fake, block);
-+      free_block(bufmgr_fake, block, 0);
-       return 1;
-    }
- 
-@@ -872,7 +877,7 @@ drm_intel_fake_bo_unreference_locked(drm_intel_bo *bo)
-       assert(bo_fake->map_count == 0);
-       /* No remaining references, so free it */
-       if (bo_fake->block)
--	 free_block(bufmgr_fake, bo_fake->block);
-+	 free_block(bufmgr_fake, bo_fake->block, 1);
-       free_backing_store(bo);
- 
-       for (i = 0; i < bo_fake->nr_relocs; i++)
-@@ -1064,7 +1069,7 @@ drm_intel_fake_kick_all_locked(drm_intel_bufmgr_fake *bufmgr_fake)
-       drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *)block->bo;
- 
-       block->on_hardware = 0;
--      free_block(bufmgr_fake, block);
-+      free_block(bufmgr_fake, block, 0);
-       bo_fake->block = NULL;
-       bo_fake->validated = 0;
-       if (!(bo_fake->flags & BM_NO_BACKING_STORE))
-@@ -1463,7 +1468,7 @@ drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr)
- 
-    DRMLISTFOREACHSAFE(block, tmp, &bufmgr_fake->lru) {
-       /* Releases the memory, and memcpys dirty contents out if necessary. */
--      free_block(bufmgr_fake, block);
-+      free_block(bufmgr_fake, block, 0);
-    }
- 
-    pthread_mutex_unlock(&bufmgr_fake->lock);
---
-cgit v0.8.2
-From 7ce8d4c1fec618ac2578ea0ddb8915b1b41ab9cb Mon Sep 17 00:00:00 2001
-From: Eric Anholt <eric at anholt.net>
-Date: Fri, 27 Feb 2009 21:46:31 +0000
-Subject: intel: Update reloc_tree_size of the first buffer when we count the tree size.
-
-This helps avoid the n^2 performance cost of counting tree size when we
-get a lot of relocations into our batch buffer.  rgb10text on keithp's laptop
-went from 136k glyphs/sec to 234k glyphs/sec.
----
-diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c
-index 6ddecf4..9e49d7c 100644
---- a/libdrm/intel/intel_bufmgr_gem.c
-+++ b/libdrm/intel/intel_bufmgr_gem.c
-@@ -1260,8 +1260,21 @@ drm_intel_gem_compute_batch_space(drm_intel_bo **bo_array, int count)
-     int i;
-     unsigned int total = 0;
- 
--    for (i = 0; i < count; i++)
-+    for (i = 0; i < count; i++) {
- 	total += drm_intel_gem_bo_get_aperture_space(bo_array[i]);
-+	/* For the first buffer object in the array, we get an accurate count
-+	 * back for its reloc_tree size (since nothing had been flagged as
-+	 * being counted yet).  We can save that value out as a more
-+	 * conservative reloc_tree_size that avoids double-counting target
-+	 * buffers.  Since the first buffer happens to usually be the batch
-+	 * buffer in our callers, this can pull us back from doing the tree
-+	 * walk on every new batch emit.
-+	 */
-+	if (i == 0) {
-+	    drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo_array[i];
-+	    bo_gem->reloc_tree_size = total;
-+	}
-+    }
- 
-     for (i = 0; i < count; i++)
- 	drm_intel_gem_bo_clear_aperture_space_flag(bo_array[i]);
---
-cgit v0.8.2



More information about the arch-commits mailing list