diff options
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); | |||
122 | 122 | ||
123 | int amdgpu_uvd_sw_init(struct amdgpu_device *adev) | 123 | int amdgpu_uvd_sw_init(struct amdgpu_device *adev) |
124 | { | 124 | { |
125 | struct amdgpu_ring *ring; | ||
126 | struct drm_sched_rq *rq; | ||
127 | unsigned long bo_size; | 125 | unsigned long bo_size; |
128 | const char *fw_name; | 126 | const char *fw_name; |
129 | const struct common_firmware_header *hdr; | 127 | const struct common_firmware_header *hdr; |
@@ -266,13 +264,6 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) | |||
266 | } | 264 | } |
267 | } | 265 | } |
268 | 266 | ||
269 | ring = &adev->uvd.inst[0].ring; | ||
270 | rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; | ||
271 | r = drm_sched_entity_init(&adev->uvd.entity, &rq, 1, NULL); | ||
272 | if (r) { | ||
273 | DRM_ERROR("Failed setting up UVD kernel entity.\n"); | ||
274 | return r; | ||
275 | } | ||
276 | for (i = 0; i < adev->uvd.max_handles; ++i) { | 267 | for (i = 0; i < adev->uvd.max_handles; ++i) { |
277 | atomic_set(&adev->uvd.handles[i], 0); | 268 | atomic_set(&adev->uvd.handles[i], 0); |
278 | adev->uvd.filp[i] = NULL; | 269 | adev->uvd.filp[i] = NULL; |
@@ -327,6 +318,29 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev) | |||
327 | return 0; | 318 | return 0; |
328 | } | 319 | } |
329 | 320 | ||
321 | /** | ||
322 | * amdgpu_uvd_entity_init - init entity | ||
323 | * | ||
324 | * @adev: amdgpu_device pointer | ||
325 | * | ||
326 | */ | ||
327 | int amdgpu_uvd_entity_init(struct amdgpu_device *adev) | ||
328 | { | ||
329 | struct amdgpu_ring *ring; | ||
330 | struct drm_sched_rq *rq; | ||
331 | int r; | ||
332 | |||
333 | ring = &adev->uvd.inst[0].ring; | ||
334 | rq = &ring->sched.sched_rq[DRM_SCHED_PRIORITY_NORMAL]; | ||
335 | r = drm_sched_entity_init(&adev->uvd.entity, &rq, 1, NULL); | ||
336 | if (r) { | ||
337 | DRM_ERROR("Failed setting up UVD kernel entity.\n"); | ||
338 | return r; | ||
339 | } | ||
340 | |||
341 | return 0; | ||
342 | } | ||
343 | |||
330 | int amdgpu_uvd_suspend(struct amdgpu_device *adev) | 344 | int amdgpu_uvd_suspend(struct amdgpu_device *adev) |
331 | { | 345 | { |
332 | unsigned size; | 346 | unsigned size; |