Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu/gmc: Fix AMDGPU_GART_PLACEMENT_LOW to not overlap with VRAM

When the GART placement is set to AMDGPU_GART_PLACEMENT_LOW:
Make sure that GART does not overlap with VRAM when
VRAM is configured to be in the low address space.

Solve this according to the following logic:
- When GART fits before VRAM, use zero address for GART
- Otherwise, put GART after the end of VRAM, aligned to 4 GiB

Previously, I had assumed this was not possible
so it was OK to not handle it, but now we got a report
from a user who has a board that is configured this way.

Fixes: 917f91d8d8e8 ("drm/amdgpu/gmc: add a way to force a particular placement for GART")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3d9de5d86a1658cadb311461b001eb1df67263ad)

authored by

Timur Kristóf and committed by
Alex Deucher
36d65da7 87612bab

+4 -1
+4 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
··· 314 314 mc->gart_start = max_mc_address - mc->gart_size + 1; 315 315 break; 316 316 case AMDGPU_GART_PLACEMENT_LOW: 317 - mc->gart_start = 0; 317 + if (size_bf >= mc->gart_size) 318 + mc->gart_start = 0; 319 + else 320 + mc->gart_start = ALIGN(mc->fb_end, four_gb); 318 321 break; 319 322 case AMDGPU_GART_PLACEMENT_BEST_FIT: 320 323 default: