aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-02-03 10:50:56 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-02-10 14:17:24 -0500
commit9f2ade33e659250a810e5bdab0c602085792d5b6 (patch)
tree8e8abe8a755c906b45ff756f688cd59e6289b6a7
parentd7af97dbccf01bc9ac6f35e2d81b0caafc5d7d25 (diff)
drm/amdgpu: send VCE IB tests directly to the ring again
We need the IB test for GPU resets as well and the scheduler should be stoped then. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c28
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h2
2 files changed, 22 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index 66e97ea0e6b0..97c22212d048 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -337,7 +337,7 @@ void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp)
337 337
338 amdgpu_vce_note_usage(adev); 338 amdgpu_vce_note_usage(adev);
339 339
340 r = amdgpu_vce_get_destroy_msg(ring, handle, NULL); 340 r = amdgpu_vce_get_destroy_msg(ring, handle, false, NULL);
341 if (r) 341 if (r)
342 DRM_ERROR("Error destroying VCE handle (%d)!\n", r); 342 DRM_ERROR("Error destroying VCE handle (%d)!\n", r);
343 343
@@ -411,9 +411,11 @@ int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
411 for (i = ib->length_dw; i < ib_size_dw; ++i) 411 for (i = ib->length_dw; i < ib_size_dw; ++i)
412 ib->ptr[i] = 0x0; 412 ib->ptr[i] = 0x0;
413 413
414 r = amdgpu_job_submit(job, ring, AMDGPU_FENCE_OWNER_UNDEFINED, &f); 414 r = amdgpu_ib_schedule(ring, 1, ib, AMDGPU_FENCE_OWNER_UNDEFINED, &f);
415 if (r) 415 if (r)
416 goto err; 416 goto err;
417
418 amdgpu_job_free(job);
417 if (fence) 419 if (fence)
418 *fence = fence_get(f); 420 *fence = fence_get(f);
419 fence_put(f); 421 fence_put(f);
@@ -435,7 +437,7 @@ err:
435 * Close up a stream for HW test or if userspace failed to do so 437 * Close up a stream for HW test or if userspace failed to do so
436 */ 438 */
437int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, 439int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
438 struct fence **fence) 440 bool direct, struct fence **fence)
439{ 441{
440 const unsigned ib_size_dw = 1024; 442 const unsigned ib_size_dw = 1024;
441 struct amdgpu_job *job; 443 struct amdgpu_job *job;
@@ -468,9 +470,21 @@ int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
468 470
469 for (i = ib->length_dw; i < ib_size_dw; ++i) 471 for (i = ib->length_dw; i < ib_size_dw; ++i)
470 ib->ptr[i] = 0x0; 472 ib->ptr[i] = 0x0;
471 r = amdgpu_job_submit(job, ring, AMDGPU_FENCE_OWNER_UNDEFINED, &f); 473
472 if (r) 474 if (direct) {
473 goto err; 475 r = amdgpu_ib_schedule(ring, 1, ib,
476 AMDGPU_FENCE_OWNER_UNDEFINED, &f);
477 if (r)
478 goto err;
479
480 amdgpu_job_free(job);
481 } else {
482 r = amdgpu_job_submit(job, ring,
483 AMDGPU_FENCE_OWNER_UNDEFINED, &f);
484 if (r)
485 goto err;
486 }
487
474 if (fence) 488 if (fence)
475 *fence = fence_get(f); 489 *fence = fence_get(f);
476 fence_put(f); 490 fence_put(f);
@@ -811,7 +825,7 @@ int amdgpu_vce_ring_test_ib(struct amdgpu_ring *ring)
811 goto error; 825 goto error;
812 } 826 }
813 827
814 r = amdgpu_vce_get_destroy_msg(ring, 1, &fence); 828 r = amdgpu_vce_get_destroy_msg(ring, 1, true, &fence);
815 if (r) { 829 if (r) {
816 DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); 830 DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
817 goto error; 831 goto error;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
index 5538cf725c85..ef99d2370182 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
@@ -31,7 +31,7 @@ int amdgpu_vce_resume(struct amdgpu_device *adev);
31int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle, 31int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
32 struct fence **fence); 32 struct fence **fence);
33int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, 33int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
34 struct fence **fence); 34 bool direct, struct fence **fence);
35void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp); 35void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp);
36int amdgpu_vce_ring_parse_cs(struct amdgpu_cs_parser *p, uint32_t ib_idx); 36int amdgpu_vce_ring_parse_cs(struct amdgpu_cs_parser *p, uint32_t ib_idx);
37void amdgpu_vce_ring_emit_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib); 37void amdgpu_vce_ring_emit_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib);