public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix GPU virtual address collosion when CPU page size != GPU page size
@ 2024-10-04 19:42 Sui Jingfeng
  2024-10-04 19:42 ` [PATCH 1/3] drm/etnaviv: Track GPU VA size separately Sui Jingfeng
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Sui Jingfeng @ 2024-10-04 19:42 UTC (permalink / raw)
  To: Lucas Stach, Russell King, Christian Gmeiner
  Cc: David Airlie, Simona Vetter, etnaviv, dri-devel, linux-kernel,
	Sui Jingfeng

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-10-28 16:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 19:42 [PATCH 0/3] Fix GPU virtual address collosion when CPU page size != GPU page size Sui Jingfeng
2024-10-04 19:42 ` [PATCH 1/3] drm/etnaviv: Track GPU VA size separately Sui Jingfeng
2024-10-07 10:12   ` Lucas Stach
2024-10-25 17:42     ` Sui Jingfeng
2024-10-27  4:48     ` Sui Jingfeng
2024-10-04 19:42 ` [PATCH 2/3] drm/etnaviv: Map and unmap the GPU VA range with respect to its user size Sui Jingfeng
2024-10-07 10:17   ` Lucas Stach
2024-10-25 17:19     ` Sui Jingfeng
2024-10-26  5:55     ` Sui Jingfeng
2024-10-04 19:42 ` [PATCH 3/3] drm/etnaviv: Print an error message if inserting IOVA range fails Sui Jingfeng
2024-10-07 10:20   ` Lucas Stach
2024-10-28 16:01     ` Lucas Stach
2024-10-28 16:25       ` Sui Jingfeng
2024-10-25  8:06 ` [PATCH 0/3] Fix GPU virtual address collosion when CPU page size != GPU page size Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox