mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
eee2744d49
commit
1a63ca3a65
@@ -2793,8 +2793,16 @@ int gk20a_gmmu_alloc(struct gk20a *g, size_t size, struct mem_desc *mem)
|
||||
int gk20a_gmmu_alloc_attr(struct gk20a *g, enum dma_attr attr, size_t size,
|
||||
struct mem_desc *mem)
|
||||
{
|
||||
if (g->mm.vidmem_is_vidmem)
|
||||
return gk20a_gmmu_alloc_attr_vid(g, attr, size, mem);
|
||||
if (g->mm.vidmem_is_vidmem) {
|
||||
int err = gk20a_gmmu_alloc_attr_vid(g, attr, size, mem);
|
||||
|
||||
if (!err)
|
||||
return 0;
|
||||
/*
|
||||
* Fall back to sysmem (which may then also fail) in case
|
||||
* vidmem is exhausted.
|
||||
*/
|
||||
}
|
||||
|
||||
return gk20a_gmmu_alloc_attr_sys(g, attr, size, mem);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user