From abe829338c128d18fd2c7af3387a537f55abd24d Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 27 Feb 2018 13:53:55 -0800 Subject: gpu: nvgpu: do not alloc ctx buffers if already allocated Bug 200393029 Change-Id: Ic2946958e34bcb9247179fcf2e8735c822155cce Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1665338 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Rajkumar Kasirajan Reviewed-by: Shreshtha Sahu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c') 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, int err = 0; size_t aligned_size = PAGE_ALIGN(size); + if (nvgpu_mem_is_valid(&desc->mem)) + return 0; + /* We ran out of preallocated memory */ if (secure_buffer->used + aligned_size > secure_buffer->size) { nvgpu_err(platform->g, "failed to alloc %zu bytes of VPR, %zu/%zu used", -- cgit v1.2.2