radeonsi: stop using the VM_ALWAYS_VALID flag
Allocation all the bo as ALWAYS_VALID means they must all fit in memory (vram + gtt) at each command submission. This causes some trouble when the total allocated memory is greater than the available memory. Possible solutions: - being able to tag/untag a bo as ALWAYS_VALID: would require kernel changes - disable VM_ALWAYS_VALID when memory usage is more than a percentage of the available memory - disable VM_ALWAYS_VALID entirely v1 of this patch implemented option 2. v2 (this version) implements option 3. Related issues: - https://gitlab.freedesktop.org/drm/amd/issues/607 - https://gitlab.freedesktop.org/mesa/mesa/issues/1257 It also helps with some piglit tests (-t maxsize -t "max[_-].*size" -t maxuniformblocksize): instead of crashing the machine, the tests fail cleanly. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2190 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3430> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3430>
This commit is contained in:
@@ -1398,9 +1398,6 @@ void amdgpu_cs_submit_ib(void *job, int thread_index)
|
||||
|
||||
simple_mtx_lock(&ws->global_bo_list_lock);
|
||||
LIST_FOR_EACH_ENTRY(bo, &ws->global_bo_list, u.real.global_list_item) {
|
||||
if (bo->is_local)
|
||||
continue;
|
||||
|
||||
list[num_handles].bo_handle = bo->u.real.kms_handle;
|
||||
list[num_handles].bo_priority = 0;
|
||||
++num_handles;
|
||||
@@ -1425,10 +1422,6 @@ void amdgpu_cs_submit_ib(void *job, int thread_index)
|
||||
unsigned num_handles = 0;
|
||||
for (i = 0; i < cs->num_real_buffers; ++i) {
|
||||
struct amdgpu_cs_buffer *buffer = &cs->real_buffers[i];
|
||||
|
||||
if (buffer->bo->is_local)
|
||||
continue;
|
||||
|
||||
assert(buffer->u.real.priority_usage != 0);
|
||||
|
||||
list[num_handles].bo_handle = buffer->bo->u.real.kms_handle;
|
||||
|
Reference in New Issue
Block a user