]> git.baikalelectronics.ru Git - kernel.git/commit
drm/etnaviv: request pages from DMA32 zone when needed
authorLucas Stach <l.stach@pengutronix.de>
Thu, 27 Feb 2020 11:09:25 +0000 (12:09 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 20 Mar 2020 17:40:44 +0000 (18:40 +0100)
commite440528b80ee5f64c4ec574ca75d87abf7d985d9
treec8064bf641e89aeafc581cd110a33c5910d26724
parent4217ca541957b6a6e847e68e7a60cdf9e4b0dada
drm/etnaviv: request pages from DMA32 zone when needed

Some Vivante GPUs are found in systems that have interconnects restricted
to 32 address bits, but may have system memory mapped above the 4GB mark.
As this region isn't accessible to the GPU via DMA any GPU memory allocated
in the upper part needs to go through SWIOTLB bounce buffering. This kills
performance if it happens too often, as well as overrunning the available
bounce buffer space, as the GPU buffer may stay mapped for a long time.

Avoid bounce buffering by checking the addressing restrictions. If the
GPU is unable to access memory above the 4GB mark, request our SHM buffers
to be located in the DMA32 zone.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_drv.c
drivers/gpu/drm/etnaviv/etnaviv_drv.h
drivers/gpu/drm/etnaviv/etnaviv_gem.c
drivers/gpu/drm/etnaviv/etnaviv_gpu.c