diff options
| author | Ramesh Errabolu <[email protected]> | 2021-01-28 03:34:22 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-02-02 17:05:29 +0000 |
| commit | b131c363c8a37815e5c7d748883f7d3e1d8e40c2 (patch) | |
| tree | ccdff5be3d633cddf21208b85aee44e99466773d /drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | |
| parent | drm/amdkfd: fix null pointer panic while free buffer in kfd (diff) | |
| download | kernel-b131c363c8a37815e5c7d748883f7d3e1d8e40c2.tar.gz kernel-b131c363c8a37815e5c7d748883f7d3e1d8e40c2.zip | |
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: Christian König <[email protected]>
Signed-off-by: Ramesh Errabolu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index d2de2a720a3d..c89b66bb70e2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -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, |
