OSDN Git Service

Don't always free up memory space when we unpin buffers.
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Tue, 17 Apr 2007 12:15:37 +0000 (14:15 +0200)
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Tue, 17 Apr 2007 12:15:37 +0000 (14:15 +0200)
linux-core/drm_bo.c

index 88adfc9..450e448 100644 (file)
@@ -1399,7 +1399,10 @@ static int drm_buffer_object_validate(drm_buffer_object_t * bo,
        } else if (bo->pinned_node != NULL) {
 
                mutex_lock(&dev->struct_mutex);
-               drm_mm_put_block(bo->pinned_node);
+
+               if (bo->pinned_node != bo->mem.mm_node)
+                       drm_mm_put_block(bo->pinned_node);
+
                list_del_init(&bo->pinned_lru);
                bo->pinned_node = NULL;
                mutex_unlock(&dev->struct_mutex);