Skip to content

Commit 6afb822

Browse files
ChristianKoenigAMDmehmetb0
authored andcommitted
drm/amdgpu: immediately use GTT for new allocations
BugLink: https://bugs.launchpad.net/bugs/2109367 commit a755906 upstream. Only use GTT as a fallback if we already have a backing store. This prevents evictions when an application constantly allocates and frees new memory. Partially fixes https://gitlab.freedesktop.org/drm/amd/-/issues/3844#note_2833985. Signed-off-by: Christian König <[email protected]> Fixes: 216c128 ("drm/amdgpu: use GTT only as fallback for VRAM|GTT") Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent ff21097 commit 6afb822

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
163163
* When GTT is just an alternative to VRAM make sure that we
164164
* only use it as fallback and still try to fill up VRAM first.
165165
*/
166-
if (domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM &&
167-
!(adev->flags & AMD_IS_APU))
166+
if (abo->tbo.resource && !(adev->flags & AMD_IS_APU) &&
167+
domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM)
168168
places[c].flags |= TTM_PL_FLAG_FALLBACK;
169169
c++;
170170
}

0 commit comments

Comments
 (0)