Revert "radv: stop using VM_ALWAYS_VALID on APUs"

Disabling VM_ALWAYS_VALID actually hurts more than it helps
after doing more testing. Managing the global BO list in userspace
is really costly and make a bunch of games CPU bound.

I think re-enabling VM_ALWAYS_VALID is a step in the right direction.

This reverts commit 6ac6e2fbfb.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9341>
This commit is contained in:
Samuel Pitoiset
2021-03-01 16:21:04 +00:00
committed by Marge Bot
parent e148d5ec99
commit 517600b4d5

View File

@@ -504,13 +504,7 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
request.flags |= AMDGPU_GEM_CREATE_EXPLICIT_SYNC;
if (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING &&
ws->info.has_local_buffers &&
(ws->use_local_bos ||
/* VM_ALWAYS_VALID means that all BOs must fit in memory (VRAM+GTT)
* for each submission. This is causing a lot of troubles when the
* total allocated memory is greater than the available memory,
* especially on APUs.
*/
(ws->info.has_dedicated_vram && (flags & RADEON_FLAG_PREFER_LOCAL_BO)))) {
(ws->use_local_bos || (flags & RADEON_FLAG_PREFER_LOCAL_BO))) {
bo->base.is_local = true;
request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID;
}