mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
drm/amdgpu: avoid the modulo in amdgpu_vm_get_entry
We can do this with a simple mask as well. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2ffe31deb2
commit
e3a1b32a12
1 changed files with 3 additions and 3 deletions
|
@ -1285,11 +1285,11 @@ void amdgpu_vm_get_entry(struct amdgpu_pte_update_params *p, uint64_t addr,
|
|||
*parent = NULL;
|
||||
*entry = &p->vm->root;
|
||||
while ((*entry)->entries) {
|
||||
unsigned idx = addr >> amdgpu_vm_level_shift(p->adev, level++);
|
||||
unsigned shift = amdgpu_vm_level_shift(p->adev, level++);
|
||||
|
||||
idx %= amdgpu_bo_size((*entry)->base.bo) / 8;
|
||||
*parent = *entry;
|
||||
*entry = &(*entry)->entries[idx];
|
||||
*entry = &(*entry)->entries[addr >> shift];
|
||||
addr &= (1ULL << shift) - 1;
|
||||
}
|
||||
|
||||
if (level != p->adev->vm_manager.num_level)
|
||||
|
|
Loading…
Reference in a new issue