Skip to contentSkip to conversation

drm/amdgpu: Use correct address to setup gart page table for vram access

PATCH Superseded Xiaogang.Chen 2 participants 2 messages Jan 7 – Jan 8

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Use correct address to setup gart page table for vram access

From: Xiaogang Chen <[email protected]>

Fixes 68a5940841684 (drm/amdgpu/gart: Add helper to bind VRAM pages (v2)")

Use dst input parameter to setup gart page table entries instead of using fixed location.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -1
index 16c3b78e50cb..68d8d0702b45 100644
@@ -396,7 +396,7 @@ void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa,
 		return;
 
 	for (i = 0; i < num_pages; ++i) {
-		amdgpu_gmc_set_pte_pde(adev, adev->gart.ptr,
+		amdgpu_gmc_set_pte_pde(adev, (dst ? dst : adev->gart.ptr),
 			start_page + i, pa + AMDGPU_GPU_PAGE_SIZE * i, flags);
 	}
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 18 lines · Xiaogang.Chen

From: Xiaogang Chen <[email protected]>

Fixes 68a5940841684 (drm/amdgpu/gart: Add helper to bind VRAM pages (v2)")

Use dst input parameter to setup gart page table entries instead of using fixed location.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +0 -0
index 16c3b78e50cb..68d8d0702b45 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa, · line 399

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -1
@@ -396,7 +396,7 @@ void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa,
                return;
 
        for (i = 0; i < num_pages; ++i) {
-               amdgpu_gmc_set_pte_pde(adev, adev->gart.ptr,
+               amdgpu_gmc_set_pte_pde(adev, (dst ? dst : adev->gart.ptr),

I think you can just use dst directly here. All of the callers set this. Either way, please update the documentation above the function to reflect the desired behavior.

Alex

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +0 -1
                        start_page + i, pa + AMDGPU_GPU_PAGE_SIZE * i, flags);
        }
 
--

2.34.1