summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2016-09-06 04:18:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-15 15:23:46 -0400
commit1a63ca3a657fb65dfb8390aa7440f34d0b3d743b (patch)
tree3ad3253030d9c28e7fa28a719763067d9ff28a9b /drivers
parenteee2744d497213a503de927cbbfe179753f5e370 (diff)
gpu: nvgpu: fall back to sysmem for generic allocs
In gk20a_gmmu_alloc_attr(), which is used for in-kernel allocations, fall back to attempting to allocate sysmem when vidmem allocation fails. Bug 1809939 Change-Id: I0397026fd1b3bc803f6d8bb7409e05ab31ec961d Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1215447 (cherry picked from commit 3ec37992b830cee917e8ad35ede50e048907014a) Reviewed-on: http://git-master/r/1217687 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index bf4a8f57..4005d5f4 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -2793,8 +2793,16 @@ int gk20a_gmmu_alloc(struct gk20a *g, size_t size, struct mem_desc *mem)
2793int gk20a_gmmu_alloc_attr(struct gk20a *g, enum dma_attr attr, size_t size, 2793int gk20a_gmmu_alloc_attr(struct gk20a *g, enum dma_attr attr, size_t size,
2794 struct mem_desc *mem) 2794 struct mem_desc *mem)
2795{ 2795{
2796 if (g->mm.vidmem_is_vidmem) 2796 if (g->mm.vidmem_is_vidmem) {
2797 return gk20a_gmmu_alloc_attr_vid(g, attr, size, mem); 2797 int err = gk20a_gmmu_alloc_attr_vid(g, attr, size, mem);
2798
2799 if (!err)
2800 return 0;
2801 /*
2802 * Fall back to sysmem (which may then also fail) in case
2803 * vidmem is exhausted.
2804 */
2805 }
2798 2806
2799 return gk20a_gmmu_alloc_attr_sys(g, attr, size, mem); 2807 return gk20a_gmmu_alloc_attr_sys(g, attr, size, mem);
2800} 2808}