]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drm/amd/amdgpu: Fix style problems in amdgpu_debugfs.c
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ttm.c
index c5ef7f7bdc15cb4085c5889e038620d8ec26f8a4..f61f07575f63bd5969cbe526187c379909be75e9 100644 (file)
@@ -466,11 +466,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
                        return r;
        }
 
-       /* Can't move a pinned BO */
        abo = ttm_to_amdgpu_bo(bo);
-       if (WARN_ON_ONCE(abo->tbo.pin_count > 0))
-               return -EINVAL;
-
        adev = amdgpu_ttm_adev(bo->bdev);
 
        if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM &&
@@ -1807,26 +1803,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
        DRM_INFO("amdgpu: %uM of VRAM memory ready\n",
                 (unsigned) (adev->gmc.real_vram_size / (1024 * 1024)));
 
-       /* Compute GTT size, either based on 1/2 the size of RAM size
-        * or whatever the user passed on module init */
-       if (amdgpu_gtt_size == -1) {
-               struct sysinfo si;
-
-               si_meminfo(&si);
-               /* Certain GL unit tests for large textures can cause problems
-                * with the OOM killer since there is no way to link this memory
-                * to a process.  This was originally mitigated (but not necessarily
-                * eliminated) by limiting the GTT size.  The problem is this limit
-                * is often too low for many modern games so just make the limit 1/2
-                * of system memory which aligns with TTM. The OOM accounting needs
-                * to be addressed, but we shouldn't prevent common 3D applications
-                * from being usable just to potentially mitigate that corner case.
-                */
-               gtt_size = max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
-                              (u64)si.totalram * si.mem_unit / 2);
-       } else {
+       /* Compute GTT size, either based on TTM limit
+        * or whatever the user passed on module init.
+        */
+       if (amdgpu_gtt_size == -1)
+               gtt_size = ttm_tt_pages_limit() << PAGE_SHIFT;
+       else
                gtt_size = (uint64_t)amdgpu_gtt_size << 20;
-       }
 
        /* Initialize GTT memory pool */
        r = amdgpu_gtt_mgr_init(adev, gtt_size);
This page took 0.037568 seconds and 4 git commands to generate.