diff options
| author | James Zhu <James.Zhu@amd.com> | 2020-07-16 09:47:35 -0400 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-21 15:37:39 -0400 | 
| commit | d10985f46e484eebf77eaa05eb614d76ec12a9a1 (patch) | |
| tree | 9d5dc1792ad61ebe0c29ac89450756d61947a76f /drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |
| parent | d182e78834d78fabf4e72509a2348f1aa193c7e0 (diff) | |
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 28 | 
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index a777d585db84..354ebf3507cf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c @@ -60,7 +60,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work);  int amdgpu_vcn_sw_init(struct amdgpu_device *adev)  { -	unsigned long bo_size, fw_shared_bo_size; +	unsigned long bo_size;  	const char *fw_name;  	const struct common_firmware_header *hdr;  	unsigned char fw_check; @@ -206,9 +206,6 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)  			dev_err(adev->dev, "VCN %d (%d) failed to allocate firmware shared bo\n", i, r);  			return r;  		} - -		fw_shared_bo_size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo); -		adev->vcn.inst[i].saved_shm_bo = kvmalloc(fw_shared_bo_size, GFP_KERNEL);  	}  	return 0; @@ -224,7 +221,6 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)  		if (adev->vcn.harvest_config & (1 << j))  			continue; -		kvfree(adev->vcn.inst[j].saved_shm_bo);  		amdgpu_bo_free_kernel(&adev->vcn.inst[j].fw_shared_bo,  					  &adev->vcn.inst[j].fw_shared_gpu_addr,  					  (void **)&adev->vcn.inst[j].fw_shared_cpu_addr); @@ -274,17 +270,6 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)  			return -ENOMEM;  		memcpy_fromio(adev->vcn.inst[i].saved_bo, ptr, size); - -		if (adev->vcn.inst[i].fw_shared_bo == NULL) -			return 0; - -		if (!adev->vcn.inst[i].saved_shm_bo) -			return -ENOMEM; - -		size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo); -		ptr = adev->vcn.inst[i].fw_shared_cpu_addr; - -		memcpy_fromio(adev->vcn.inst[i].saved_shm_bo, ptr, size);  	}  	return 0;  } @@ -322,17 +307,6 @@ int amdgpu_vcn_resume(struct amdgpu_device *adev)  			}  			memset_io(ptr, 0, size);  		} - -		if (adev->vcn.inst[i].fw_shared_bo == NULL) -			return -EINVAL; - -		size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo); -		ptr = adev->vcn.inst[i].fw_shared_cpu_addr; - -		if (adev->vcn.inst[i].saved_shm_bo != NULL) -			memcpy_toio(ptr, adev->vcn.inst[i].saved_shm_bo, size); -		else -			memset_io(ptr, 0, size);  	}  	return 0;  }  | 
