Skip to content

Commit 13c96ac

Browse files
xiaoleiwang123456lynxeye-dev
authored andcommitted
drm/etnaviv: Request pages from DMA32 zone on addressing_limited
Remove __GFP_HIGHMEM when requesting a page from DMA32 zone, and since all vivante GPUs in the system will share the same DMA constraints, move the check of whether to get a page from DMA32 to etnaviv_bind(). Fixes: b72af44 ("drm/etnaviv: request pages from DMA32 zone when needed") Suggested-by: Sui Jingfeng <[email protected]> Signed-off-by: Xiaolei Wang <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent 9852d85 commit 13c96ac

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

drivers/gpu/drm/etnaviv/etnaviv_drv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,16 @@ static int etnaviv_bind(struct device *dev)
538538
priv->num_gpus = 0;
539539
priv->shm_gfp_mask = GFP_HIGHUSER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
540540

541+
/*
542+
* If the GPU is part of a system with DMA addressing limitations,
543+
* request pages for our SHM backend buffers from the DMA32 zone to
544+
* hopefully avoid performance killing SWIOTLB bounce buffering.
545+
*/
546+
if (dma_addressing_limited(dev)) {
547+
priv->shm_gfp_mask |= GFP_DMA32;
548+
priv->shm_gfp_mask &= ~__GFP_HIGHMEM;
549+
}
550+
541551
priv->cmdbuf_suballoc = etnaviv_cmdbuf_suballoc_new(drm->dev);
542552
if (IS_ERR(priv->cmdbuf_suballoc)) {
543553
dev_err(drm->dev, "Failed to create cmdbuf suballocator\n");

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -839,14 +839,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
839839
if (ret)
840840
goto fail;
841841

842-
/*
843-
* If the GPU is part of a system with DMA addressing limitations,
844-
* request pages for our SHM backend buffers from the DMA32 zone to
845-
* hopefully avoid performance killing SWIOTLB bounce buffering.
846-
*/
847-
if (dma_addressing_limited(gpu->dev))
848-
priv->shm_gfp_mask |= GFP_DMA32;
849-
850842
/* Create buffer: */
851843
ret = etnaviv_cmdbuf_init(priv->cmdbuf_suballoc, &gpu->buffer,
852844
PAGE_SIZE);

0 commit comments

Comments
 (0)