diff options
| author | Emily Deng <Emily.Deng@amd.com> | 2018-08-13 09:45:34 +0300 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-14 01:20:10 +0300 | 
| commit | 33d5bd0705440c158c909da7538f05fc7a0ebcdf (patch) | |
| tree | b08a880ef1c6da0816b9317ba96580e6cea681ff /drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |
| parent | 4d77c0f676e910fb1f1870738aa4bd168f253621 (diff) | |
| download | linux-33d5bd0705440c158c909da7538f05fc7a0ebcdf.tar.xz | |
drm/amdgpu/uvd: UVD entity initialization relys on ring initialization
Entity init should after ring init, as the entity's sched_rq's initialization
is in ring init.
SWDEV-161495
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 32 | 
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index 632fa5980ff4..433a741d0762 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -122,8 +122,6 @@ static void amdgpu_uvd_idle_work_handler(struct work_struct *work);  int amdgpu_uvd_sw_init(struct amdgpu_device *adev)  { -	struct amdgpu_ring *ring; -	struct drm_sched_rq *rq;  	unsigned long bo_size;  	const char *fw_name;  	const struct common_firmware_header *hdr; @@ -266,13 +264,6 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)  		}  	} -	ring = &adev->uvd.inst[0].ring; -	rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; -	r = drm_sched_entity_init(&adev->uvd.entity, &rq, 1, NULL); -	if (r) { -		DRM_ERROR("Failed setting up UVD kernel entity.\n"); -		return r; -	}  	for (i = 0; i < adev->uvd.max_handles; ++i) {  		atomic_set(&adev->uvd.handles[i], 0);  		adev->uvd.filp[i] = NULL; @@ -327,6 +318,29 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)  	return 0;  } +/** + * amdgpu_uvd_entity_init - init entity + * + * @adev: amdgpu_device pointer + * + */ +int amdgpu_uvd_entity_init(struct amdgpu_device *adev) +{ +	struct amdgpu_ring *ring; +	struct drm_sched_rq *rq; +	int r; + +	ring = &adev->uvd.inst[0].ring; +	rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; +	r = drm_sched_entity_init(&adev->uvd.entity, &rq, 1, NULL); +	if (r) { +		DRM_ERROR("Failed setting up UVD kernel entity.\n"); +		return r; +	} + +	return 0; +} +  int amdgpu_uvd_suspend(struct amdgpu_device *adev)  {  	unsigned size;  | 
