summaryrefslogtreecommitdiff
path: root/linux-core/drm_ttm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-26 21:14:23 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-26 21:14:23 +0200
commitb4fba1679b6156e3ca6f053b44cae0b003febe7f (patch)
tree2bdae612350792621ffeb792c8778ffcf1d33f68 /linux-core/drm_ttm.c
parent7ea059ae076c50f2012dee2ccbb8d41745705383 (diff)
Add a one-page hole in the file offset space between buffers.
Diffstat (limited to 'linux-core/drm_ttm.c')
-rw-r--r--linux-core/drm_ttm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 7344acce..13bec48b 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -489,14 +489,20 @@ int drm_ttm_object_create(drm_device_t * dev, unsigned long size,
map->size = ttm->num_pages * PAGE_SIZE;
map->handle = (void *)object;
+ /*
+ * Add a one-page "hole" to the block size to avoid the mm subsystem
+ * merging vmas.
+ * FIXME: Is this really needed?
+ */
+
list->file_offset_node = drm_mm_search_free(&dev->offset_manager,
- ttm->num_pages, 0, 0);
+ ttm->num_pages + 1, 0, 0);
if (!list->file_offset_node) {
drm_ttm_object_remove(dev, object);
return -ENOMEM;
}
list->file_offset_node = drm_mm_get_block(list->file_offset_node,
- ttm->num_pages, 0);
+ ttm->num_pages + 1, 0);
list->hash.key = list->file_offset_node->start;