]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/etnaviv: Map and unmap GPUVA range with respect to the GPUVA size
authorSui Jingfeng <sui.jingfeng@linux.dev>
Fri, 25 Oct 2024 20:43:55 +0000 (04:43 +0800)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 28 Oct 2024 15:41:54 +0000 (16:41 +0100)
commit68786b7f49873c69ec332a045a9bf4337d71ec20
treedebc93f0d945e06bfbe52424a84c3daf91633fea
parentb5f1eed853c6ea6a99149fd97fe179f3ebd96a02
drm/etnaviv: Map and unmap GPUVA range with respect to the GPUVA size

Etnaviv assumes that GPU page size is 4KiB, however, GPUVA ranges collision
when using softpin capable GPUs on a non 4KiB CPU page size configuration.
The root cause is that kernel side BO takes up bigger address space than
userspace expect, the size of backing memory of GEM buffer objects are
required to align to the CPU PAGE_SIZE. Therefore, results in userspace
allocated GPUVA range fails to be inserted to the specified hole exactly.

To solve this problem, record the GPU visiable size of a BO firstly, then
map and unmap the SG entry strictly with respect to the total GPUVA size.

Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_mmu.c