From d63cfed376a6b71cf0c4417549597866d9c95d85 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 16 Jun 2016 11:48:22 +0300 Subject: gpu: ngpu: gm206: use vidmem allocator for ucode blob Use the general video memory allocator for reserving wpr space for acr ucode blob instead of crafting a mem_desc manually. Jira DNVGPU-16 Change-Id: Ie1b1e4b76b9678a33f4ef10ddcbf85259bfab5fd Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1165643 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm206/acr_gm206.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'drivers/gpu/nvgpu/gm206') diff --git a/drivers/gpu/nvgpu/gm206/acr_gm206.c b/drivers/gpu/nvgpu/gm206/acr_gm206.c index 8db03105..aeccbd28 100644 --- a/drivers/gpu/nvgpu/gm206/acr_gm206.c +++ b/drivers/gpu/nvgpu/gm206/acr_gm206.c @@ -56,31 +56,12 @@ static void flcn64_set_dma(struct falc_u64 *dma_addr, u64 value) int gm206_alloc_blob_space(struct gk20a *g, size_t size, struct mem_desc *mem) { - int err = 0; struct wpr_carveout_info wpr_inf; g->ops.pmu.get_wpr(g, &wpr_inf); - mem->aperture = APERTURE_VIDMEM; - mem->sgt = kzalloc(sizeof(*mem->sgt), GFP_KERNEL); - if (!mem->sgt) { - gk20a_err(dev_from_gk20a(g), "failed to allocate memory\n"); - return -ENOMEM; - } - - err = sg_alloc_table(mem->sgt, 1, GFP_KERNEL); - if (err) { - gk20a_err(dev_from_gk20a(g), "failed to allocate sg_table\n"); - goto free_sgt; - } - - sg_dma_address(mem->sgt->sgl) = wpr_inf.wpr_base; - - return err; - -free_sgt: - gk20a_free_sgtable(&mem->sgt); - return err; + return gk20a_gmmu_alloc_attr_vid_at(g, 0, wpr_inf.size, mem, + wpr_inf.wpr_base); } void gm206_init_secure_pmu(struct gpu_ops *gops) -- cgit v1.2.2