diff mbox series

drm/lima: allow to retry when allocating memory for BO

Message ID 20190926105240.43144-1-icenowy@aosc.io (mailing list archive)
State New, archived
Headers show
Series drm/lima: allow to retry when allocating memory for BO | expand

Commit Message

Icenowy Zheng Sept. 26, 2019, 10:52 a.m. UTC
Currently, when allocating the memory for BO by Mesa, the lima kernel
driver set only GFP_DMA32 flag; and this allocation may fail when the
memory is relatively adequate, thus retrying is needed.

Add the GFP flags for retrying memory allocation.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 drivers/gpu/drm/lima/lima_object.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/lima/lima_object.c b/drivers/gpu/drm/lima/lima_object.c
index 87123b1d083c..1389aa1b948b 100644
--- a/drivers/gpu/drm/lima/lima_object.c
+++ b/drivers/gpu/drm/lima/lima_object.c
@@ -91,7 +91,9 @@  struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
 			goto err_out;
 		}
 	} else {
-		mapping_set_gfp_mask(bo->gem.filp->f_mapping, GFP_DMA32);
+		mapping_set_gfp_mask(bo->gem.filp->f_mapping,
+				     GFP_DMA32 | __GFP_RETRY_MAYFAIL |
+				     __GFP_NOWARN);
 		bo->pages = drm_gem_get_pages(&bo->gem);
 		if (IS_ERR(bo->pages)) {
 			ret = ERR_CAST(bo->pages);