diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ltc_common.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ltc_common.c b/drivers/gpu/nvgpu/gk20a/ltc_common.c index 2d2516d9..8f9bd8c2 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_common.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_common.c | |||
@@ -220,8 +220,7 @@ static int gk20a_ltc_alloc_phys_cbc(struct gk20a *g, | |||
220 | *gr->compbit_store.pages = pages; | 220 | *gr->compbit_store.pages = pages; |
221 | gr->compbit_store.base_iova = sg_phys(sgt->sgl); | 221 | gr->compbit_store.base_iova = sg_phys(sgt->sgl); |
222 | gr->compbit_store.size = compbit_backing_size; | 222 | gr->compbit_store.size = compbit_backing_size; |
223 | 223 | gr->compbit_store.sgt = sgt; | |
224 | kfree(sgt); | ||
225 | 224 | ||
226 | return 0; | 225 | return 0; |
227 | 226 | ||
@@ -241,6 +240,7 @@ static int gk20a_ltc_alloc_virt_cbc(struct gk20a *g, | |||
241 | struct gr_gk20a *gr = &g->gr; | 240 | struct gr_gk20a *gr = &g->gr; |
242 | DEFINE_DMA_ATTRS(attrs); | 241 | DEFINE_DMA_ATTRS(attrs); |
243 | dma_addr_t iova; | 242 | dma_addr_t iova; |
243 | int err; | ||
244 | 244 | ||
245 | dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs); | 245 | dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs); |
246 | 246 | ||
@@ -255,6 +255,14 @@ static int gk20a_ltc_alloc_virt_cbc(struct gk20a *g, | |||
255 | 255 | ||
256 | gr->compbit_store.base_iova = iova; | 256 | gr->compbit_store.base_iova = iova; |
257 | gr->compbit_store.size = compbit_backing_size; | 257 | gr->compbit_store.size = compbit_backing_size; |
258 | err = gk20a_get_sgtable_from_pages(d, | ||
259 | &gr->compbit_store.sgt, | ||
260 | gr->compbit_store.pages, iova, | ||
261 | compbit_backing_size); | ||
262 | if (err) { | ||
263 | gk20a_err(dev_from_gk20a(g), "failed to allocate sgt for backing store"); | ||
264 | return err; | ||
265 | } | ||
258 | 266 | ||
259 | return 0; | 267 | return 0; |
260 | } | 268 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index d583849d..e5d76f8f 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -157,6 +157,7 @@ struct gr_ctx_desc { | |||
157 | 157 | ||
158 | struct compbit_store_desc { | 158 | struct compbit_store_desc { |
159 | struct page **pages; | 159 | struct page **pages; |
160 | struct sg_table *sgt; | ||
160 | size_t size; | 161 | size_t size; |
161 | u64 base_iova; | 162 | u64 base_iova; |
162 | }; | 163 | }; |