diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2016-06-16 04:48:22 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-06-17 12:06:22 -0400 |
commit | d63cfed376a6b71cf0c4417549597866d9c95d85 (patch) | |
tree | dd46a062ca1e4f0914741d11e9db407ecc771ddd /drivers/gpu/nvgpu | |
parent | 22d0233d3a2c7e2805f0251e43e776fa07469c8b (diff) |
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 <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1165643
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gm206/acr_gm206.c | 23 |
1 files changed, 2 insertions, 21 deletions
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) | |||
56 | int gm206_alloc_blob_space(struct gk20a *g, | 56 | int gm206_alloc_blob_space(struct gk20a *g, |
57 | size_t size, struct mem_desc *mem) | 57 | size_t size, struct mem_desc *mem) |
58 | { | 58 | { |
59 | int err = 0; | ||
60 | struct wpr_carveout_info wpr_inf; | 59 | struct wpr_carveout_info wpr_inf; |
61 | 60 | ||
62 | g->ops.pmu.get_wpr(g, &wpr_inf); | 61 | g->ops.pmu.get_wpr(g, &wpr_inf); |
63 | 62 | ||
64 | mem->aperture = APERTURE_VIDMEM; | 63 | return gk20a_gmmu_alloc_attr_vid_at(g, 0, wpr_inf.size, mem, |
65 | mem->sgt = kzalloc(sizeof(*mem->sgt), GFP_KERNEL); | 64 | wpr_inf.wpr_base); |
66 | if (!mem->sgt) { | ||
67 | gk20a_err(dev_from_gk20a(g), "failed to allocate memory\n"); | ||
68 | return -ENOMEM; | ||
69 | } | ||
70 | |||
71 | err = sg_alloc_table(mem->sgt, 1, GFP_KERNEL); | ||
72 | if (err) { | ||
73 | gk20a_err(dev_from_gk20a(g), "failed to allocate sg_table\n"); | ||
74 | goto free_sgt; | ||
75 | } | ||
76 | |||
77 | sg_dma_address(mem->sgt->sgl) = wpr_inf.wpr_base; | ||
78 | |||
79 | return err; | ||
80 | |||
81 | free_sgt: | ||
82 | gk20a_free_sgtable(&mem->sgt); | ||
83 | return err; | ||
84 | } | 65 | } |
85 | 66 | ||
86 | void gm206_init_secure_pmu(struct gpu_ops *gops) | 67 | void gm206_init_secure_pmu(struct gpu_ops *gops) |