[cairo-commit] 2 commits - src/drm

Chris Wilson ickle at kemper.freedesktop.org
Wed Jan 27 15:19:31 PST 2010


 src/drm/cairo-drm-i915-shader.c |    2 +-
 src/drm/cairo-drm-i915-spans.c  |    3 +++
 src/drm/cairo-drm-i965-glyphs.c |    4 ++++
 src/drm/cairo-drm-i965-spans.c  |    3 +++
 src/drm/cairo-drm-intel.c       |    6 +++++-
 5 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 44734b9d3ba60fb45abb0268a916e40cd688ef6a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 27 23:17:44 2010 +0000

    drm-intel: Assert that the bo is unmapped upon release.
    
    Check through error paths to catch a few more places where the mapped bo
    may have been leaked, and add an assert to abort in case we do leak a
    mapping.

diff --git a/src/drm/cairo-drm-i915-spans.c b/src/drm/cairo-drm-i915-spans.c
index 0f1617d..b3db71f 100644
--- a/src/drm/cairo-drm-i915-spans.c
+++ b/src/drm/cairo-drm-i915-spans.c
@@ -612,6 +612,9 @@ i915_spans_fini (i915_spans_t *spans)
 {
     i915_shader_fini (&spans->shader);
 
+    if (spans->tail->bo->virtual)
+	intel_bo_unmap (spans->tail->bo);
+
     if (spans->head.bo != NULL) {
 	struct vbo *vbo, *next;
 
diff --git a/src/drm/cairo-drm-i965-glyphs.c b/src/drm/cairo-drm-i965-glyphs.c
index fa86e34..e31bc9c 100644
--- a/src/drm/cairo-drm-i965-glyphs.c
+++ b/src/drm/cairo-drm-i965-glyphs.c
@@ -448,6 +448,10 @@ i965_surface_glyphs (void			*abstract_surface,
     cairo_device_release (surface->intel.drm.base.device);
   CLEANUP_GLYPHS:
     i965_shader_fini (&glyphs.shader);
+
+    if (glyphs.tail->bo->virtual)
+	intel_bo_unmap (glyphs.tail->bo);
+
     if (glyphs.head.bo != NULL) {
 	struct i965_vbo *vbo, *next;
 
diff --git a/src/drm/cairo-drm-i965-spans.c b/src/drm/cairo-drm-i965-spans.c
index 9cf6d00..581f1a7 100644
--- a/src/drm/cairo-drm-i965-spans.c
+++ b/src/drm/cairo-drm-i965-spans.c
@@ -344,6 +344,9 @@ i965_spans_fini (i965_spans_t *spans)
 {
     i965_shader_fini (&spans->shader);
 
+    if (spans->tail->bo->virtual)
+	intel_bo_unmap (spans->tail->bo);
+
     if (spans->head.bo != NULL) {
 	struct i965_vbo *vbo, *next;
 
diff --git a/src/drm/cairo-drm-intel.c b/src/drm/cairo-drm-intel.c
index 7cbbb16..984dcd8 100644
--- a/src/drm/cairo-drm-intel.c
+++ b/src/drm/cairo-drm-intel.c
@@ -491,6 +491,8 @@ intel_bo_release (void *_dev, void *_bo)
     intel_bo_t *bo = _bo;
     int bucket;
 
+    assert (bo->virtual == NULL);
+
     bucket = INTEL_BO_CACHE_BUCKETS;
     if (bo->base.size & -bo->base.size)
 	bucket = ffs (bo->base.size / 4096) - 1;
@@ -982,8 +984,10 @@ intel_glyph_cache_add_glyph (intel_device_t *device,
 
 	if (width > (int) sizeof (buf)) {
 	    a8 = malloc (width);
-	    if (unlikely (a8 == NULL))
+	    if (unlikely (a8 == NULL)) {
+		intel_bo_unmap (cache->buffer.bo);
 		return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+	    }
 	}
 
 	dst += node->x;
commit 6848c7c850aa0a710c1409d1fc2cb441d02a2b28
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 27 23:01:37 2010 +0000

    drm-i915: Don't tile temporary image textures.
    
    As uploading to a tiled buffer is much slower than linear memory, don't
    unless we expect to reuse the texture. This is not true for sub-image
    clones, which are single shot affairs.

diff --git a/src/drm/cairo-drm-i915-shader.c b/src/drm/cairo-drm-i915-shader.c
index cdefdf3..7c1291a 100644
--- a/src/drm/cairo-drm-i915-shader.c
+++ b/src/drm/cairo-drm-i915-shader.c
@@ -1274,7 +1274,7 @@ i915_surface_clone_subimage (i915_device_t *device,
 				      image->base.content,
 				      extents->width,
 				      extents->height,
-				      I915_TILING_DEFAULT,
+				      I915_TILING_NONE,
 				      FALSE);
     if (unlikely (clone->intel.drm.base.status))
 	return clone->intel.drm.base.status;


More information about the cairo-commit mailing list