diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c index 952a7ed1..3e1c6996 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | |||
@@ -122,6 +122,9 @@ static int gk20a_tegra_secure_alloc(struct gk20a *g, | |||
122 | int err = 0; | 122 | int err = 0; |
123 | size_t aligned_size = PAGE_ALIGN(size); | 123 | size_t aligned_size = PAGE_ALIGN(size); |
124 | 124 | ||
125 | if (nvgpu_mem_is_valid(&desc->mem)) | ||
126 | return 0; | ||
127 | |||
125 | /* We ran out of preallocated memory */ | 128 | /* We ran out of preallocated memory */ |
126 | if (secure_buffer->used + aligned_size > secure_buffer->size) { | 129 | if (secure_buffer->used + aligned_size > secure_buffer->size) { |
127 | nvgpu_err(platform->g, "failed to alloc %zu bytes of VPR, %zu/%zu used", | 130 | nvgpu_err(platform->g, "failed to alloc %zu bytes of VPR, %zu/%zu used", |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 8db6b42f..7160ab6f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -2482,6 +2482,11 @@ static int gk20a_gr_alloc_ctx_buffer(struct gk20a *g, | |||
2482 | { | 2482 | { |
2483 | int err = 0; | 2483 | int err = 0; |
2484 | 2484 | ||
2485 | nvgpu_log_fn(g, " "); | ||
2486 | |||
2487 | if (nvgpu_mem_is_valid(&desc->mem)) | ||
2488 | return 0; | ||
2489 | |||
2485 | err = nvgpu_dma_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, | 2490 | err = nvgpu_dma_alloc_flags_sys(g, NVGPU_DMA_NO_KERNEL_MAPPING, |
2486 | size, &desc->mem); | 2491 | size, &desc->mem); |
2487 | if (err) | 2492 | if (err) |