Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "drm/amdgpu/vcn: add shared memory restore after wake up from sleep."

This reverts commit 21b704d78352c289d31697824ceea7ad0ff4ce59.
To merge vcn firmware shared memory bo into vcn vcpu bo.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

James Zhu and committed by
Alex Deucher
d10985f4 d182e788

+1 -28
+1 -27
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
··· 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 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; ··· 221 224 if (adev->vcn.harvest_config & (1 << j)) 222 225 continue; 223 226 224 - kvfree(adev->vcn.inst[j].saved_shm_bo); 225 227 amdgpu_bo_free_kernel(&adev->vcn.inst[j].fw_shared_bo, 226 228 &adev->vcn.inst[j].fw_shared_gpu_addr, 227 229 (void **)&adev->vcn.inst[j].fw_shared_cpu_addr); ··· 270 274 return -ENOMEM; 271 275 272 276 memcpy_fromio(adev->vcn.inst[i].saved_bo, ptr, size); 273 - 274 - if (adev->vcn.inst[i].fw_shared_bo == NULL) 275 - return 0; 276 - 277 - if (!adev->vcn.inst[i].saved_shm_bo) 278 - return -ENOMEM; 279 - 280 - size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo); 281 - ptr = adev->vcn.inst[i].fw_shared_cpu_addr; 282 - 283 - memcpy_fromio(adev->vcn.inst[i].saved_shm_bo, ptr, size); 284 277 } 285 278 return 0; 286 279 } ··· 307 322 } 308 323 memset_io(ptr, 0, size); 309 324 } 310 - 311 - if (adev->vcn.inst[i].fw_shared_bo == NULL) 312 - return -EINVAL; 313 - 314 - size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo); 315 - ptr = adev->vcn.inst[i].fw_shared_cpu_addr; 316 - 317 - if (adev->vcn.inst[i].saved_shm_bo != NULL) 318 - memcpy_toio(ptr, adev->vcn.inst[i].saved_shm_bo, size); 319 - else 320 - memset_io(ptr, 0, size); 321 325 } 322 326 return 0; 323 327 }
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
··· 207 207 atomic_t dpg_enc_submission_cnt; 208 208 void *fw_shared_cpu_addr; 209 209 uint64_t fw_shared_gpu_addr; 210 - void *saved_shm_bo; 211 210 }; 212 211 213 212 struct amdgpu_vcn {