@@ -60,7 +60,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work);
60
60
61
61
int amdgpu_vcn_sw_init (struct amdgpu_device * adev )
62
62
{
63
- unsigned long bo_size , fw_shared_bo_size ;
63
+ unsigned long bo_size ;
64
64
const char * fw_name ;
65
65
const struct common_firmware_header * hdr ;
66
66
unsigned char fw_check ;
@@ -206,9 +206,6 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
206
206
dev_err (adev -> dev , "VCN %d (%d) failed to allocate firmware shared bo\n" , i , r );
207
207
return r ;
208
208
}
209
-
210
- fw_shared_bo_size = amdgpu_bo_size (adev -> vcn .inst [i ].fw_shared_bo );
211
- adev -> vcn .inst [i ].saved_shm_bo = kvmalloc (fw_shared_bo_size , GFP_KERNEL );
212
209
}
213
210
214
211
return 0 ;
@@ -224,7 +221,6 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)
224
221
if (adev -> vcn .harvest_config & (1 << j ))
225
222
continue ;
226
223
227
- kvfree (adev -> vcn .inst [j ].saved_shm_bo );
228
224
amdgpu_bo_free_kernel (& adev -> vcn .inst [j ].fw_shared_bo ,
229
225
& adev -> vcn .inst [j ].fw_shared_gpu_addr ,
230
226
(void * * )& adev -> vcn .inst [j ].fw_shared_cpu_addr );
@@ -274,17 +270,6 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)
274
270
return - ENOMEM ;
275
271
276
272
memcpy_fromio (adev -> vcn .inst [i ].saved_bo , ptr , size );
277
-
278
- if (adev -> vcn .inst [i ].fw_shared_bo == NULL )
279
- return 0 ;
280
-
281
- if (!adev -> vcn .inst [i ].saved_shm_bo )
282
- return - ENOMEM ;
283
-
284
- size = amdgpu_bo_size (adev -> vcn .inst [i ].fw_shared_bo );
285
- ptr = adev -> vcn .inst [i ].fw_shared_cpu_addr ;
286
-
287
- memcpy_fromio (adev -> vcn .inst [i ].saved_shm_bo , ptr , size );
288
273
}
289
274
return 0 ;
290
275
}
@@ -322,17 +307,6 @@ int amdgpu_vcn_resume(struct amdgpu_device *adev)
322
307
}
323
308
memset_io (ptr , 0 , size );
324
309
}
325
-
326
- if (adev -> vcn .inst [i ].fw_shared_bo == NULL )
327
- return - EINVAL ;
328
-
329
- size = amdgpu_bo_size (adev -> vcn .inst [i ].fw_shared_bo );
330
- ptr = adev -> vcn .inst [i ].fw_shared_cpu_addr ;
331
-
332
- if (adev -> vcn .inst [i ].saved_shm_bo != NULL )
333
- memcpy_toio (ptr , adev -> vcn .inst [i ].saved_shm_bo , size );
334
- else
335
- memset_io (ptr , 0 , size );
336
310
}
337
311
return 0 ;
338
312
}
0 commit comments