diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/ltc_gm20b.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c index 305e28c2..07d405b2 100644 --- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c | |||
@@ -26,10 +26,6 @@ | |||
26 | 26 | ||
27 | static int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | 27 | static int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) |
28 | { | 28 | { |
29 | struct device *d = dev_from_gk20a(g); | ||
30 | DEFINE_DMA_ATTRS(attrs); | ||
31 | dma_addr_t iova; | ||
32 | |||
33 | /* max memory size (MB) to cover */ | 29 | /* max memory size (MB) to cover */ |
34 | u32 max_size = gr->max_comptag_mem; | 30 | u32 max_size = gr->max_comptag_mem; |
35 | /* one tag line covers 128KB */ | 31 | /* one tag line covers 128KB */ |
@@ -49,6 +45,8 @@ static int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
49 | 45 | ||
50 | u32 compbit_backing_size; | 46 | u32 compbit_backing_size; |
51 | 47 | ||
48 | int err; | ||
49 | |||
52 | gk20a_dbg_fn(""); | 50 | gk20a_dbg_fn(""); |
53 | 51 | ||
54 | if (max_comptag_lines == 0) { | 52 | if (max_comptag_lines == 0) { |
@@ -83,17 +81,13 @@ static int gm20b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
83 | gk20a_dbg_info("max comptag lines : %d", | 81 | gk20a_dbg_info("max comptag lines : %d", |
84 | max_comptag_lines); | 82 | max_comptag_lines); |
85 | 83 | ||
86 | dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs); | 84 | if (IS_ENABLED(CONFIG_GK20A_PHYS_PAGE_TABLES)) |
87 | gr->compbit_store.size = compbit_backing_size; | 85 | err = gk20a_ltc_alloc_phys_cbc(g, compbit_backing_size); |
88 | gr->compbit_store.pages = dma_alloc_attrs(d, gr->compbit_store.size, | 86 | else |
89 | &iova, GFP_KERNEL, &attrs); | 87 | err = gk20a_ltc_alloc_virt_cbc(g, compbit_backing_size); |
90 | if (!gr->compbit_store.pages) { | 88 | |
91 | gk20a_err(dev_from_gk20a(g), "failed to allocate" | 89 | if (err) |
92 | "backing store for compbit : size %d", | 90 | return err; |
93 | compbit_backing_size); | ||
94 | return -ENOMEM; | ||
95 | } | ||
96 | gr->compbit_store.base_iova = iova; | ||
97 | 91 | ||
98 | gk20a_allocator_init(&gr->comp_tags, "comptag", | 92 | gk20a_allocator_init(&gr->comp_tags, "comptag", |
99 | 1, /* start */ | 93 | 1, /* start */ |