Skip to content

Commit 9dc983a

Browse files
committed
nouveau/vmm: increase size of vmm pte tracker struct to u32 (v2)
We need to tracker large counts of spte than previously due to unref getting delayed sometimes. This doesn't fix LPT tracking yet, it just creates space for it. Reviewed-by: Mary Guillemard <[email protected]> Tested-by: Mary Guillemard <[email protected]> Tested-by: Mel Henning <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent c4d53e5 commit 9dc983a

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ nvkm_vmm_sparse_ptes(const struct nvkm_vmm_desc *desc,
387387
} else
388388
if (desc->type == LPT) {
389389
union nvkm_pte_tracker sparse = { .s.sparse = 1 };
390-
memset(&pgt->pte[ptei].u, sparse.u, ptes);
390+
memset32(&pgt->pte[ptei].u, sparse.u, ptes);
391391
}
392392
}
393393

@@ -399,7 +399,7 @@ nvkm_vmm_sparse_unref_ptes(struct nvkm_vmm_iter *it, bool pfn, u32 ptei, u32 pte
399399
memset(&pt->pde[ptei], 0x00, sizeof(pt->pde[0]) * ptes);
400400
else
401401
if (it->desc->type == LPT)
402-
memset(&pt->pte[ptei].u, 0x00, sizeof(pt->pte[0]) * ptes);
402+
memset32(&pt->pte[ptei].u, 0x00, ptes);
403403
return nvkm_vmm_unref_ptes(it, pfn, ptei, ptes);
404404
}
405405

@@ -458,7 +458,7 @@ nvkm_vmm_ref_hwpt(struct nvkm_vmm_iter *it, struct nvkm_vmm_pt *pgd, u32 pdei)
458458
desc->func->sparse(vmm, pt, pteb, ptes);
459459
else
460460
desc->func->invalid(vmm, pt, pteb, ptes);
461-
memset(&pgt->pte[pteb], 0x00, ptes);
461+
memset32(&pgt->pte[pteb].u, 0x00, ptes);
462462
} else {
463463
desc->func->unmap(vmm, pt, pteb, ptes);
464464
while (ptes--)

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
enum nvkm_memory_target;
66

77
union nvkm_pte_tracker {
8-
u8 u;
8+
u32 u;
99
struct {
10-
u8 sparse:1;
11-
u8 spte_valid:1;
12-
u8 sptes:6;
10+
u32 sparse:1;
11+
u32 spte_valid:1;
12+
u32 padding:14;
13+
u32 sptes:16;
1314
} s;
1415
};
1516

0 commit comments

Comments
 (0)