drm/amdgpu/vm: Check PRT uAPI flag instead of PTE flag
Subsystems (4)
PATCH 1/3 drm/amdgpu/vm: Check PRT uAPI flag instead of PTE flag
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -2
@@ -2091,7 +2091,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) &&
@@ -2106,7 +2106,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) &&
Signature · 1 line
2.51.1
PATCH 2/3 drm/amdgpu/uapi: Clarify comment on AMDGPU_VM_PAGE_PRT
In the context of the amdgpu uAPI, the PRT flag is referring only to unmapped pages of a partially resident texture (aka. sparse resource), but not the full resource.
Virtual addresses marked with this flag behave as follows:
- Reads return zero
- Writes are discarded
--- include/uapi/drm/amdgpu_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/drm/amdgpu_drm.h +1 -1
@@ -883,7 +883,7 @@ struct drm_amdgpu_gem_list_handles_entry {#define AMDGPU_VM_PAGE_WRITEABLE (1 << 2)/* executable mapping, new for VI */ #define AMDGPU_VM_PAGE_EXECUTABLE (1 << 3) -/* partially resident texture */ +/* unmapped page of partially resident textures */ #define AMDGPU_VM_PAGE_PRT (1 << 4)/* MTYPE flags use bit 5 to 8 */ #define AMDGPU_VM_MTYPE_MASK (0xf << 5)
Signature · 1 line
2.51.1
PATCH 3/3 Documentation/gpu: Add PRT, PTE, PDE to amdgpu glossary (v2)
In reply to Timur KristófPRT = Partially Resident Texture (aka. sparse residency) PTE = Page Table Entry
PDE = Page Directory Entry
v2:
- Add PDE
--- Documentation/gpu/amdgpu/amdgpu-glossary.rst | 9 +++++++++ 1 file changed, 9 insertions(+)
Documentation/gpu/amdgpu/amdgpu-glossary.rst +9 -0
@@ -143,15 +143,24 @@ we have a dedicated glossary for Display Core at PA Primitive Assembler / Physical Address + PDE + Page Directory Entry + PFP Pre-Fetch Parser (Graphics) PPLib PowerPlay Library - PowerPlay is the power management component. + PRT + Partially Resident Texture (also known as sparse residency) + PSP Platform Security Processor + PTE + Page Table Entry + RB Render Backends. Some people called it ROPs.
Signature · 1 line
2.51.1
Alex Deucher
AppliedRe: [PATCH 3/3] Documentation/gpu: Add PRT, PTE, PDE to amdgpu glossary (v2)
Applied the series. Thanks!
Alex
Quoted 46 lines · Timur Kristóf
PRT = Partially Resident Texture (aka. sparse residency) PTE = Page Table Entry
PDE = Page Directory Entryv2:
- Add PDESigned-off-by Timur Kristóf <[email protected]>Reviewed-by Christian König <[email protected]>--- Documentation/gpu/amdgpu/amdgpu-glossary.rst | 9 +++++++++ 1 file changed, 9 insertions(+)Documentation/gpu/amdgpu/amdgpu-glossary.rst +9
-1@@ -143,15 +143,24 @@ we have a dedicated glossary for Display Core at PA Primitive Assembler / Physical Address + PDE + Page Directory Entry + PFP Pre-Fetch Parser (Graphics) PPLib PowerPlay Library - PowerPlay is the power management component. + PRT + Partially Resident Texture (also known as sparse residency) + PSP Platform Security Processor + PTE + Page Table Entry + RB Render Backends. Some people called it ROPs. --2.51.1