diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 28f82816..148496dd 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | |||
@@ -135,6 +135,7 @@ static int gk20a_tegra_secure_alloc(struct platform_device *pdev, | |||
135 | struct gr_ctx_buffer_desc *desc, | 135 | struct gr_ctx_buffer_desc *desc, |
136 | size_t size) | 136 | size_t size) |
137 | { | 137 | { |
138 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | ||
138 | struct device *dev = &pdev->dev; | 139 | struct device *dev = &pdev->dev; |
139 | DEFINE_DMA_ATTRS(attrs); | 140 | DEFINE_DMA_ATTRS(attrs); |
140 | dma_addr_t iova; | 141 | dma_addr_t iova; |
@@ -142,6 +143,9 @@ static int gk20a_tegra_secure_alloc(struct platform_device *pdev, | |||
142 | struct page *page; | 143 | struct page *page; |
143 | int err = 0; | 144 | int err = 0; |
144 | 145 | ||
146 | if (!platform->secure_alloc_ready) | ||
147 | return -EINVAL; | ||
148 | |||
145 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, | 149 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, |
146 | DMA_MEMORY_NOMAP, &attrs); | 150 | DMA_MEMORY_NOMAP, &attrs); |
147 | if (dma_mapping_error(&tegra_vpr_dev, iova)) | 151 | if (dma_mapping_error(&tegra_vpr_dev, iova)) |