Skip to content

Commit bb8863c

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdgpu: remove unused code
Remove the unused function - amdgpu_vm_pt_is_root_clean and remove the impossible condition v1: entries == 0 is not possible any more, so this condition could probably be removed (Felix) Signed-off-by: Jesse Zhang <jesse.zhang@amd.com> Suggested-by:Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 8bc7558 commit bb8863c

File tree

2 files changed

+15
-47
lines changed

2 files changed

+15
-47
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
537537
int level, bool immediate, struct amdgpu_bo_vm **vmbo,
538538
int32_t xcp_id);
539539
void amdgpu_vm_pt_free_root(struct amdgpu_device *adev, struct amdgpu_vm *vm);
540-
bool amdgpu_vm_pt_is_root_clean(struct amdgpu_device *adev,
541-
struct amdgpu_vm *vm);
542540

543541
int amdgpu_vm_pde_update(struct amdgpu_vm_update_params *params,
544542
struct amdgpu_vm_bo_base *entry);

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

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -409,27 +409,24 @@ int amdgpu_vm_pt_clear(struct amdgpu_device *adev, struct amdgpu_vm *vm,
409409

410410
addr = 0;
411411

412-
if (entries) {
413-
uint64_t value = 0, flags = 0;
414-
415-
if (adev->asic_type >= CHIP_VEGA10) {
416-
if (level != AMDGPU_VM_PTB) {
417-
/* Handle leaf PDEs as PTEs */
418-
flags |= AMDGPU_PDE_PTE;
419-
amdgpu_gmc_get_vm_pde(adev, level,
420-
&value, &flags);
421-
} else {
422-
/* Workaround for fault priority problem on GMC9 */
423-
flags = AMDGPU_PTE_EXECUTABLE;
424-
}
412+
uint64_t value = 0, flags = 0;
413+
if (adev->asic_type >= CHIP_VEGA10) {
414+
if (level != AMDGPU_VM_PTB) {
415+
/* Handle leaf PDEs as PTEs */
416+
flags |= AMDGPU_PDE_PTE;
417+
amdgpu_gmc_get_vm_pde(adev, level,
418+
&value, &flags);
419+
} else {
420+
/* Workaround for fault priority problem on GMC9 */
421+
flags = AMDGPU_PTE_EXECUTABLE;
425422
}
426-
427-
r = vm->update_funcs->update(&params, vmbo, addr, 0, entries,
428-
value, flags);
429-
if (r)
430-
goto exit;
431423
}
432424

425+
r = vm->update_funcs->update(&params, vmbo, addr, 0, entries,
426+
value, flags);
427+
if (r)
428+
goto exit;
429+
433430
r = vm->update_funcs->commit(&params, NULL);
434431
exit:
435432
drm_dev_exit(idx);
@@ -673,33 +670,6 @@ void amdgpu_vm_pt_free_root(struct amdgpu_device *adev, struct amdgpu_vm *vm)
673670
amdgpu_vm_pt_free_dfs(adev, vm, NULL, false);
674671
}
675672

676-
/**
677-
* amdgpu_vm_pt_is_root_clean - check if a root PD is clean
678-
*
679-
* @adev: amdgpu_device pointer
680-
* @vm: the VM to check
681-
*
682-
* Check all entries of the root PD, if any subsequent PDs are allocated,
683-
* it means there are page table creating and filling, and is no a clean
684-
* VM
685-
*
686-
* Returns:
687-
* 0 if this VM is clean
688-
*/
689-
bool amdgpu_vm_pt_is_root_clean(struct amdgpu_device *adev,
690-
struct amdgpu_vm *vm)
691-
{
692-
enum amdgpu_vm_level root = adev->vm_manager.root_level;
693-
unsigned int entries = amdgpu_vm_pt_num_entries(adev, root);
694-
unsigned int i = 0;
695-
696-
for (i = 0; i < entries; i++) {
697-
if (to_amdgpu_bo_vm(vm->root.bo)->entries[i].bo)
698-
return false;
699-
}
700-
return true;
701-
}
702-
703673
/**
704674
* amdgpu_vm_pde_update - update a single level in the hierarchy
705675
*

0 commit comments

Comments
 (0)