]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu/vm: Check PRT uAPI flag instead of PTE flag
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 19 Nov 2025 09:25:42 +0000 (10:25 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Nov 2025 22:34:15 +0000 (17:34 -0500)
This fixes sparse mappings (aka. partially resident textures).

Check the correct flags.
Since a recent refactor, the code works with uAPI flags (for
mapping buffer objects), and not PTE (page table entry) flags.

Fixes: 6716a823d18d ("drm/amdgpu: rework how PTE flags are generated v3")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 7fc081e88b6a9e4f72eb878b62143013d046587e..57604864d1892a9ec8e1015ee94e1034262acd84 100644 (file)
@@ -2093,7 +2093,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
                struct amdgpu_bo *bo = before->bo_va->base.bo;
 
                amdgpu_vm_it_insert(before, &vm->va);
-               if (before->flags & AMDGPU_PTE_PRT_FLAG(adev))
+               if (before->flags & AMDGPU_VM_PAGE_PRT)
                        amdgpu_vm_prt_get(adev);
 
                if (amdgpu_vm_is_bo_always_valid(vm, bo) &&
@@ -2108,7 +2108,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
                struct amdgpu_bo *bo = after->bo_va->base.bo;
 
                amdgpu_vm_it_insert(after, &vm->va);
-               if (after->flags & AMDGPU_PTE_PRT_FLAG(adev))
+               if (after->flags & AMDGPU_VM_PAGE_PRT)
                        amdgpu_vm_prt_get(adev);
 
                if (amdgpu_vm_is_bo_always_valid(vm, bo) &&