mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Allow mapping backing store
Backing store sgt needs to be mapped to gpuva to enable CDE swizzling. This patch adds necessary code to create sgt during initialisation so that the sgt is available when needed. Bug 1409151 Change-Id: I9d4671386fe9204d780c2e286b5f9b2dd87af35a Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
This commit is contained in:
committed by
Dan Willemsen
parent
d4586cc3ab
commit
542f729aa9
@@ -220,8 +220,7 @@ static int gk20a_ltc_alloc_phys_cbc(struct gk20a *g,
|
||||
*gr->compbit_store.pages = pages;
|
||||
gr->compbit_store.base_iova = sg_phys(sgt->sgl);
|
||||
gr->compbit_store.size = compbit_backing_size;
|
||||
|
||||
kfree(sgt);
|
||||
gr->compbit_store.sgt = sgt;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -241,6 +240,7 @@ static int gk20a_ltc_alloc_virt_cbc(struct gk20a *g,
|
||||
struct gr_gk20a *gr = &g->gr;
|
||||
DEFINE_DMA_ATTRS(attrs);
|
||||
dma_addr_t iova;
|
||||
int err;
|
||||
|
||||
dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs);
|
||||
|
||||
@@ -255,6 +255,14 @@ static int gk20a_ltc_alloc_virt_cbc(struct gk20a *g,
|
||||
|
||||
gr->compbit_store.base_iova = iova;
|
||||
gr->compbit_store.size = compbit_backing_size;
|
||||
err = gk20a_get_sgtable_from_pages(d,
|
||||
&gr->compbit_store.sgt,
|
||||
gr->compbit_store.pages, iova,
|
||||
compbit_backing_size);
|
||||
if (err) {
|
||||
gk20a_err(dev_from_gk20a(g), "failed to allocate sgt for backing store");
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ struct gr_ctx_desc {
|
||||
|
||||
struct compbit_store_desc {
|
||||
struct page **pages;
|
||||
struct sg_table *sgt;
|
||||
size_t size;
|
||||
u64 base_iova;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user