drm/amdgpu/mes10.1: implement ucode buffers destruction
authorJack Xiao <Jack.Xiao@amd.com>
Fri, 12 Apr 2019 11:11:18 +0000 (19:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:59:28 +0000 (18:59 -0500)
Free ucode GPU buffers.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c

index 764967b..edf1fbc 100644 (file)
@@ -169,6 +169,17 @@ static int mes_v10_1_allocate_ucode_data_buffer(struct amdgpu_device *adev)
        return 0;
 }
 
+static void mes_v10_1_free_ucode_buffers(struct amdgpu_device *adev)
+{
+       amdgpu_bo_free_kernel(&adev->mes.data_fw_obj,
+                             &adev->mes.data_fw_gpu_addr,
+                             (void **)&adev->mes.data_fw_ptr);
+
+       amdgpu_bo_free_kernel(&adev->mes.ucode_fw_obj,
+                             &adev->mes.ucode_fw_gpu_addr,
+                             (void **)&adev->mes.ucode_fw_ptr);
+}
+
 static int mes_v10_1_sw_init(void *handle)
 {
        return 0;