Skip to content

Fix GPU virtual address collosion when CPU page size != GPU page size

Sui Jingfeng dri-devel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/etnaviv: Track GPU VA size separatelydrivers/gpu/drm/etnaviv/etnaviv_gem.c drivers/gpu/drm/etnaviv/etnaviv_gem.h drivers/gpu/drm/etnaviv/etnaviv_mmu.c+10 -73 replies
2/3drm/etnaviv: Map and unmap the GPU VA range with respect to its user sizedrivers/gpu/drm/etnaviv/etnaviv_mmu.c+9 -193 replies
3/3drm/etnaviv: Print an error message if inserting IOVA range failsdrivers/gpu/drm/etnaviv/etnaviv_mmu.c+5 -13 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchLucas Stach
1/3
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Fix GPU virtual address collosion when CPU page size != GPU page size

Etnaviv assumes that GPU page size is 4KiB, however, when using softpin capable GPUs on a different CPU page size configuration. Userspace still doing the allocation with 4KiB page as unit. This results in userspace allocated GPU virtual address ranges collision and therefore unable to be inserted to the specified hole exactly.

The root cause is that kernel side BO takes up bigger address space than userspace assumes when the size of it is not CPU page size aligned.

To solve it with no GPU VA range space wasting, we first track the size of a buffer that userspace/GPU think of it is, then partially map and/or unmap the tail physical page with respect to this 'user size'. Ensure that GPU VA is fully mapped and/or unmapped.

Sui Jingfeng (3):
drm/etnaviv: Track GPU VA size separately
drm/etnaviv: Map and unmap the GPU VA range with respect to its user
size
drm/etnaviv: Print an error message if inserting IOVA range fails

 drivers/gpu/drm/etnaviv/etnaviv_gem.c |  8 +++--
 drivers/gpu/drm/etnaviv/etnaviv_gem.h |  1 +
 drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 42 ++++++++++++---------------
 3 files changed, 24 insertions(+), 27 deletions(-)
Signature · 1 line
2.34.1