drm/ttm: Allow page allocations w/o triggering OOM..
[sfrench/cifs-2.6.git] / drivers / gpu / drm / ttm / ttm_page_alloc.c
index 2b12c55a3bff82e48b581a60dba23b5c4c33b7a2..c84da14311ec12b08f283b23306da1e395198f5f 100644 (file)
@@ -741,6 +741,9 @@ out:
                if (ttm_flags & TTM_PAGE_FLAG_ZERO_ALLOC)
                        gfp_flags |= __GFP_ZERO;
 
+               if (ttm_flags & TTM_PAGE_FLAG_NO_RETRY)
+                       gfp_flags |= __GFP_RETRY_MAYFAIL;
+
                /* ttm_alloc_new_pages doesn't reference pool so we can run
                 * multiple requests in parallel.
                 **/
@@ -893,6 +896,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags,
                if (flags & TTM_PAGE_FLAG_ZERO_ALLOC)
                        gfp_flags |= __GFP_ZERO;
 
+               if (flags & TTM_PAGE_FLAG_NO_RETRY)
+                       gfp_flags |= __GFP_RETRY_MAYFAIL;
+
                if (flags & TTM_PAGE_FLAG_DMA32)
                        gfp_flags |= GFP_DMA32;
                else