Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: move VM PDEs to idle after update

Move the page tables to the idle list after updating the PDEs.

We have gone back and forth with that a couple of times because of problems
with the inter PD dependencies, but it should work now that we have the
state handling cleanly separated.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
6e97c2f9 3f8951cc

+10 -32
+10 -32
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 1364 1364 } 1365 1365 1366 1366 /** 1367 - * amdgpu_vm_invalidate_pds - mark all PDs as invalid 1368 - * 1369 - * @adev: amdgpu_device pointer 1370 - * @vm: related vm 1371 - * 1372 - * Mark all PD level as invalid after an error. 1373 - */ 1374 - static void amdgpu_vm_invalidate_pds(struct amdgpu_device *adev, 1375 - struct amdgpu_vm *vm) 1376 - { 1377 - struct amdgpu_vm_pt_cursor cursor; 1378 - struct amdgpu_vm_bo_base *entry; 1379 - 1380 - for_each_amdgpu_vm_pt_dfs_safe(adev, vm, NULL, cursor, entry) 1381 - if (entry->bo && !entry->moved) 1382 - amdgpu_vm_bo_relocated(entry); 1383 - } 1384 - 1385 - /** 1386 1367 * amdgpu_vm_update_pdes - make sure that all directories are valid 1387 1368 * 1388 1369 * @adev: amdgpu_device pointer ··· 1379 1398 struct amdgpu_vm *vm, bool immediate) 1380 1399 { 1381 1400 struct amdgpu_vm_update_params params; 1401 + struct amdgpu_vm_bo_base *entry; 1382 1402 int r, idx; 1383 1403 1384 1404 if (list_empty(&vm->relocated)) ··· 1395 1413 1396 1414 r = vm->update_funcs->prepare(&params, NULL, AMDGPU_SYNC_EXPLICIT); 1397 1415 if (r) 1398 - goto exit; 1416 + goto error; 1399 1417 1400 - while (!list_empty(&vm->relocated)) { 1401 - struct amdgpu_vm_bo_base *entry; 1402 - 1403 - entry = list_first_entry(&vm->relocated, 1404 - struct amdgpu_vm_bo_base, 1405 - vm_status); 1406 - amdgpu_vm_bo_idle(entry); 1407 - 1418 + list_for_each_entry(entry, &vm->relocated, vm_status) { 1408 1419 r = amdgpu_vm_update_pde(&params, vm, entry); 1409 1420 if (r) 1410 1421 goto error; ··· 1406 1431 r = vm->update_funcs->commit(&params, &vm->last_update); 1407 1432 if (r) 1408 1433 goto error; 1409 - drm_dev_exit(idx); 1410 - return 0; 1434 + 1435 + while (!list_empty(&vm->relocated)) { 1436 + entry = list_first_entry(&vm->relocated, 1437 + struct amdgpu_vm_bo_base, 1438 + vm_status); 1439 + amdgpu_vm_bo_idle(entry); 1440 + } 1411 1441 1412 1442 error: 1413 - amdgpu_vm_invalidate_pds(adev, vm); 1414 - exit: 1415 1443 drm_dev_exit(idx); 1416 1444 return r; 1417 1445 }