]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/xe: Limit the system memory size to half of the system memory
authorJosé Roberto de Souza <jose.souza@intel.com>
Wed, 26 Apr 2023 16:20:05 +0000 (09:20 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:31:42 +0000 (18:31 -0500)
ttm_global_init() imposes this limitation.

Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_ttm_sys_mgr.c

index 5b0674bbb8ed0b9e84fc268cfd6b1d0051188fe9..3e1fa0c832cab287c2bf428f5076ce30c133e2af 100644 (file)
@@ -105,7 +105,10 @@ int xe_ttm_sys_mgr_init(struct xe_device *xe)
        u64 gtt_size;
 
        si_meminfo(&si);
-       gtt_size = (u64)si.totalram * si.mem_unit * 3/4;
+       gtt_size = (u64)si.totalram * si.mem_unit;
+       /* TTM limits allocation of all TTM devices by 50% of system memory */
+       gtt_size /= 2;
+
        man->use_tt = true;
        man->func = &xe_ttm_sys_mgr_func;
        ttm_resource_manager_init(man, &xe->ttm, gtt_size >> PAGE_SHIFT);