summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ltc_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ltc_common.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ltc_common.c12
1 files changed, 10 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}