VIGS: Remove "ttm shrink disable" hack
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Tue, 18 Jun 2013 06:32:00 +0000 (10:32 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Tue, 18 Jun 2013 06:32:00 +0000 (10:32 +0400)
There's a right way to do this by specifying 0 in
accounted size for a BO. That way we can allocate as much BOs
as we want with used_mem always remaining 0

drivers/gpu/drm/vigs/vigs_gem.c
drivers/gpu/drm/vigs/vigs_mman.c
drivers/gpu/drm/vigs/vigs_mman.h

index 6b7b14363381547541dc464c01a9ae8f5f7a5975..cc5761c5820d8f73ce2f06a241150c56ec794a22 100644 (file)
@@ -63,7 +63,7 @@ int vigs_gem_init(struct vigs_gem_object *vigs_gem,
 
     ret = ttm_bo_init(&vigs_dev->mman->bo_dev, &vigs_gem->bo, size, bo_type,
                       &placement, 0, 0,
-                      false, NULL, size,
+                      false, NULL, 0,
                       &vigs_gem_bo_destroy);
 
     if (ret != 0) {
index 19c63b5eba56291d9f94d86e43a02568a158460c..ae3a0c656b05106c40849bac50ba2b8fdb825eba 100644 (file)
@@ -85,24 +85,11 @@ static int vigs_mman_global_init(struct vigs_mman *mman)
         return ret;
     }
 
-    /*
-     * Hack. Assign 'shrink' to NULL in order to prevent
-     * swapping out BOs, we don't need this because
-     * we don't occupy any system RAM at all, our GPU
-     * placement is entirely on host.
-     */
-
-    mman->old_shrink = mman->bo_global_ref.mem_glob->shrink;
-    mman->bo_global_ref.mem_glob->shrink = NULL;
-
     return 0;
 }
 
 static void vigs_mman_global_cleanup(struct vigs_mman *mman)
 {
-    mman->bo_global_ref.mem_glob->shrink = mman->old_shrink;
-    mman->old_shrink = NULL;
-
     drm_global_item_unref(&mman->bo_global_ref.ref);
     drm_global_item_unref(&mman->mem_global_ref);
 }
index 0c1d8608b8b8e5da44687f4b5785803d2043bd75..1f2e462c960c15ff9f55852f76fba4913d4d7762 100644 (file)
@@ -23,7 +23,6 @@ struct vigs_mman
 {
     struct drm_global_reference mem_global_ref;
     struct ttm_bo_global_ref bo_global_ref;
-    struct ttm_mem_shrink *old_shrink;
     struct ttm_bo_device bo_dev;
 
     resource_size_t vram_base;