diff options
author | Emily Deng <Emily.Deng@amd.com> | 2018-08-13 02:46:06 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-13 18:21:29 -0400 |
commit | 20acbed47d30efbf14e5aecc5ec5e5f152db7810 (patch) | |
tree | c3b93697a4a2b34c2c32af0caf517e37f0081b48 /drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | |
parent | 33d5bd0705440c158c909da7538f05fc7a0ebcdf (diff) |
drm/amdgpu/vce: VCE entity initialization relies on ring initializtion
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_vce.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index b6ab4f5350c8..0cc5190f4f36 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | |||
@@ -90,8 +90,6 @@ static void amdgpu_vce_idle_work_handler(struct work_struct *work); | |||
90 | */ | 90 | */ |
91 | int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) | 91 | int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) |
92 | { | 92 | { |
93 | struct amdgpu_ring *ring; | ||
94 | struct drm_sched_rq *rq; | ||
95 | const char *fw_name; | 93 | const char *fw_name; |
96 | const struct common_firmware_header *hdr; | 94 | const struct common_firmware_header *hdr; |
97 | unsigned ucode_version, version_major, version_minor, binary_id; | 95 | unsigned ucode_version, version_major, version_minor, binary_id; |
@@ -188,14 +186,6 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) | |||
188 | return r; | 186 | return r; |
189 | } | 187 | } |
190 | 188 | ||
191 | ring = &adev->vce.ring[0]; | ||
192 | rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; | ||
193 | r = drm_sched_entity_init(&adev->vce.entity, &rq, 1, NULL); | ||
194 | if (r != 0) { | ||
195 | DRM_ERROR("Failed setting up VCE run queue.\n"); | ||
196 | return r; | ||
197 | } | ||
198 | |||
199 | for (i = 0; i < AMDGPU_MAX_VCE_HANDLES; ++i) { | 189 | for (i = 0; i < AMDGPU_MAX_VCE_HANDLES; ++i) { |
200 | atomic_set(&adev->vce.handles[i], 0); | 190 | atomic_set(&adev->vce.handles[i], 0); |
201 | adev->vce.filp[i] = NULL; | 191 | adev->vce.filp[i] = NULL; |
@@ -236,6 +226,29 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) | |||
236 | } | 226 | } |
237 | 227 | ||
238 | /** | 228 | /** |
229 | * amdgpu_vce_entity_init - init entity | ||
230 | * | ||
231 | * @adev: amdgpu_device pointer | ||
232 | * | ||
233 | */ | ||
234 | int amdgpu_vce_entity_init(struct amdgpu_device *adev) | ||
235 | { | ||
236 | struct amdgpu_ring *ring; | ||
237 | struct drm_sched_rq *rq; | ||
238 | int r; | ||
239 | |||
240 | ring = &adev->vce.ring[0]; | ||
241 | rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; | ||
242 | r = drm_sched_entity_init(&adev->vce.entity, &rq, 1, NULL); | ||
243 | if (r != 0) { | ||
244 | DRM_ERROR("Failed setting up VCE run queue.\n"); | ||
245 | return r; | ||
246 | } | ||
247 | |||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | /** | ||
239 | * amdgpu_vce_suspend - unpin VCE fw memory | 252 | * amdgpu_vce_suspend - unpin VCE fw memory |
240 | * | 253 | * |
241 | * @adev: amdgpu_device pointer | 254 | * @adev: amdgpu_device pointer |