Skip to content

Commit 5c9b923

Browse files
ChristianKoenigAMDjfvogel
authored andcommitted
drm/amdgpu: immediately use GTT for new allocations
commit a755906fb2b8370c43e91ba437ae1b3e228e8b02 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]> (cherry picked from commit a53d959fe660341788cb8dbc3ac3330d90a09ecf) Signed-off-by: Jack Vogel <[email protected]>
1 parent d41903d commit 5c9b923

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
@@ -161,8 +161,8 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
161161
* When GTT is just an alternative to VRAM make sure that we
162162
* only use it as fallback and still try to fill up VRAM first.
163163
*/
164-
if (domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM &&
165-
!(adev->flags & AMD_IS_APU))
164+
if (abo->tbo.resource && !(adev->flags & AMD_IS_APU) &&
165+
domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM)
166166
places[c].flags |= TTM_PL_FLAG_FALLBACK;
167167
c++;
168168
}

0 commit comments

Comments
 (0)