Commit f5dee228 authored by Xiangliang Yu's avatar Xiangliang Yu Committed by Alex Deucher

drm/amdgpu/vce4: alloc mm table for MM sriov

Allocate MM table for sriov device.
Signed-off-by: default avatarXiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ecb2b9c6
......@@ -294,6 +294,21 @@ static int vce_v4_0_sw_init(void *handle)
return r;
}
if (amdgpu_sriov_vf(adev)) {
r = amdgpu_bo_create_kernel(adev, PAGE_SIZE, PAGE_SIZE,
AMDGPU_GEM_DOMAIN_VRAM,
&adev->virt.mm_table.bo,
&adev->virt.mm_table.gpu_addr,
(void *)&adev->virt.mm_table.cpu_addr);
if (!r) {
memset((void *)adev->virt.mm_table.cpu_addr, 0, PAGE_SIZE);
printk("mm table gpu addr = 0x%llx, cpu addr = %p. \n",
adev->virt.mm_table.gpu_addr,
adev->virt.mm_table.cpu_addr);
}
return r;
}
return r;
}
......@@ -302,6 +317,12 @@ static int vce_v4_0_sw_fini(void *handle)
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* free MM table */
if (amdgpu_sriov_vf(adev))
amdgpu_bo_free_kernel(&adev->virt.mm_table.bo,
&adev->virt.mm_table.gpu_addr,
(void *)&adev->virt.mm_table.cpu_addr);
r = amdgpu_vce_suspend(adev);
if (r)
return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment