Skip to contentSkip to conversation

drm/amdgpu/vm: Check PRT uAPI flag instead of PTE flag

PATCH Applied Timur Kristóf 2 participants 4 messages Nov 19, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 0fdf257286d7 ("drm/amdgpu: rework how PTE flags are generated v3")
---
 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
index e803d173e25b..1a8155bdce5e 100644
@@ -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
#1 lore raw

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
index 406a42be429b..f43592997b49 100644
@@ -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
#2 lore raw

PATCH 3/3 Documentation/gpu: Add PRT, PTE, PDE to amdgpu glossary (v2)

In reply to Timur Kristóf

PRT = 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
index 30812d9d53c6..43a36362dc73 100644
@@ -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
Applied
#3 lore raw

Re: [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 Entry

v2:
- Add PDE

---
 Documentation/gpu/amdgpu/amdgpu-glossary.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/gpu/amdgpu/amdgpu-glossary.rst +9 -1
index 30812d9d53c6..43a36362dc73 100644
@@ -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