Skip to content

Commit 216c128

Browse files
drm/amdgpu: use GTT only as fallback for VRAM|GTT
Try to fill up VRAM as well by setting the busy flag on GTT allocations. This fixes the issue that when VRAM was evacuated for suspend it's never filled up again unless the application is restarted. Signed-off-by: Christian König <[email protected]> Reviewed-by: Zack Rusin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent cc941c7 commit 216c128

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
173173
abo->flags & AMDGPU_GEM_CREATE_PREEMPTIBLE ?
174174
AMDGPU_PL_PREEMPT : TTM_PL_TT;
175175
places[c].flags = 0;
176+
/*
177+
* When GTT is just an alternative to VRAM make sure that we
178+
* only use it as fallback and still try to fill up VRAM first.
179+
*/
180+
if (domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM)
181+
places[c].flags |= TTM_PL_FLAG_FALLBACK;
176182
c++;
177183
}
178184

0 commit comments

Comments
 (0)