mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: ngpu: gp106: 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: I9d34b3b964eb9ab781fcebecd15ba81643c5452d Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1165642 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
Deepak Nibade
parent
14e0681fe5
commit
dfc2f7e5df
@@ -91,31 +91,12 @@ static void flcn64_set_dma(struct falc_u64 *dma_addr, u64 value)
|
||||
int gp106_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.nonwpr_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.nonwpr_base);
|
||||
}
|
||||
|
||||
void gp106_init_secure_pmu(struct gpu_ops *gops)
|
||||
|
||||
Reference in New Issue
Block a user