Commit b131c363 authored by Ramesh Errabolu's avatar Ramesh Errabolu Committed by Alex Deucher

drm/amdgpu: Limit the maximum size of contiguous VRAM that can be encapsulated...

drm/amdgpu: Limit the maximum size of contiguous VRAM that can be encapsulated by an instance of DRM memory node

[Why]
Enable 1:1 mapping between VRAM of a DRM node and a scatterlist node

[How]
Ensure construction of DRM node to not exceed specified limit
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarRamesh Errabolu <Ramesh.Errabolu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 875440fd
......@@ -473,6 +473,9 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
for (i = 0; pages_left >= pages_per_node; ++i) {
unsigned long pages = rounddown_pow_of_two(pages_left);
/* Limit maximum size to 2GB due to SG table limitations */
pages = min(pages, (2UL << (30 - PAGE_SHIFT)));
r = drm_mm_insert_node_in_range(mm, &nodes[i], pages,
pages_per_node, 0,
place->fpfn, lpfn,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment