diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-03 10:01:06 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:17:23 -0500 |
commit | d7af97dbccf01bc9ac6f35e2d81b0caafc5d7d25 (patch) | |
tree | 2fe2cf805bfd338fe43f2dcad13f7c4a11309154 | |
parent | 0856cab1a6298d9cbf037dc683ce514cadb28040 (diff) |
drm/amdgpu: send UVD 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_uvd.c | 32 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 2 |
5 files changed, 25 insertions, 15 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index 4e98be8b29fb..00b608b6c8c4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |||
@@ -241,7 +241,7 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) | |||
241 | 241 | ||
242 | amdgpu_uvd_note_usage(adev); | 242 | amdgpu_uvd_note_usage(adev); |
243 | 243 | ||
244 | r = amdgpu_uvd_get_destroy_msg(ring, handle, &fence); | 244 | r = amdgpu_uvd_get_destroy_msg(ring, handle, false, &fence); |
245 | if (r) { | 245 | if (r) { |
246 | DRM_ERROR("Error destroying UVD (%d)!\n", r); | 246 | DRM_ERROR("Error destroying UVD (%d)!\n", r); |
247 | continue; | 247 | continue; |
@@ -295,7 +295,8 @@ void amdgpu_uvd_free_handles(struct amdgpu_device *adev, struct drm_file *filp) | |||
295 | 295 | ||
296 | amdgpu_uvd_note_usage(adev); | 296 | amdgpu_uvd_note_usage(adev); |
297 | 297 | ||
298 | r = amdgpu_uvd_get_destroy_msg(ring, handle, &fence); | 298 | r = amdgpu_uvd_get_destroy_msg(ring, handle, |
299 | false, &fence); | ||
299 | if (r) { | 300 | if (r) { |
300 | DRM_ERROR("Error destroying UVD (%d)!\n", r); | 301 | DRM_ERROR("Error destroying UVD (%d)!\n", r); |
301 | continue; | 302 | continue; |
@@ -823,9 +824,8 @@ int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx) | |||
823 | return 0; | 824 | return 0; |
824 | } | 825 | } |
825 | 826 | ||
826 | static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, | 827 | static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo, |
827 | struct amdgpu_bo *bo, | 828 | bool direct, struct fence **fence) |
828 | struct fence **fence) | ||
829 | { | 829 | { |
830 | struct ttm_validate_buffer tv; | 830 | struct ttm_validate_buffer tv; |
831 | struct ww_acquire_ctx ticket; | 831 | struct ww_acquire_ctx ticket; |
@@ -872,9 +872,19 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, | |||
872 | ib->ptr[i] = PACKET2(0); | 872 | ib->ptr[i] = PACKET2(0); |
873 | ib->length_dw = 16; | 873 | ib->length_dw = 16; |
874 | 874 | ||
875 | r = amdgpu_job_submit(job, ring, AMDGPU_FENCE_OWNER_UNDEFINED, &f); | 875 | if (direct) { |
876 | if (r) | 876 | r = amdgpu_ib_schedule(ring, 1, ib, |
877 | goto err_free; | 877 | AMDGPU_FENCE_OWNER_UNDEFINED, &f); |
878 | if (r) | ||
879 | goto err_free; | ||
880 | |||
881 | amdgpu_job_free(job); | ||
882 | } else { | ||
883 | r = amdgpu_job_submit(job, ring, | ||
884 | AMDGPU_FENCE_OWNER_UNDEFINED, &f); | ||
885 | if (r) | ||
886 | goto err_free; | ||
887 | } | ||
878 | 888 | ||
879 | ttm_eu_fence_buffer_objects(&ticket, &head, f); | 889 | ttm_eu_fence_buffer_objects(&ticket, &head, f); |
880 | 890 | ||
@@ -942,11 +952,11 @@ int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle, | |||
942 | amdgpu_bo_kunmap(bo); | 952 | amdgpu_bo_kunmap(bo); |
943 | amdgpu_bo_unreserve(bo); | 953 | amdgpu_bo_unreserve(bo); |
944 | 954 | ||
945 | return amdgpu_uvd_send_msg(ring, bo, fence); | 955 | return amdgpu_uvd_send_msg(ring, bo, true, fence); |
946 | } | 956 | } |
947 | 957 | ||
948 | int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, | 958 | int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, |
949 | struct fence **fence) | 959 | bool direct, struct fence **fence) |
950 | { | 960 | { |
951 | struct amdgpu_device *adev = ring->adev; | 961 | struct amdgpu_device *adev = ring->adev; |
952 | struct amdgpu_bo *bo; | 962 | struct amdgpu_bo *bo; |
@@ -984,7 +994,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, | |||
984 | amdgpu_bo_kunmap(bo); | 994 | amdgpu_bo_kunmap(bo); |
985 | amdgpu_bo_unreserve(bo); | 995 | amdgpu_bo_unreserve(bo); |
986 | 996 | ||
987 | return amdgpu_uvd_send_msg(ring, bo, fence); | 997 | return amdgpu_uvd_send_msg(ring, bo, direct, fence); |
988 | } | 998 | } |
989 | 999 | ||
990 | static void amdgpu_uvd_idle_work_handler(struct work_struct *work) | 1000 | static void amdgpu_uvd_idle_work_handler(struct work_struct *work) |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h index 1724c2c86151..9a3b449081a7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h | |||
@@ -31,7 +31,7 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev); | |||
31 | int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle, | 31 | int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle, |
32 | struct fence **fence); | 32 | struct fence **fence); |
33 | int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, | 33 | int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, |
34 | struct fence **fence); | 34 | bool direct, struct fence **fence); |
35 | void amdgpu_uvd_free_handles(struct amdgpu_device *adev, | 35 | void amdgpu_uvd_free_handles(struct amdgpu_device *adev, |
36 | struct drm_file *filp); | 36 | struct drm_file *filp); |
37 | int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx); | 37 | int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx); |
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c index d50679222b65..232fe2a3a9b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | |||
@@ -522,7 +522,7 @@ static int uvd_v4_2_ring_test_ib(struct amdgpu_ring *ring) | |||
522 | goto error; | 522 | goto error; |
523 | } | 523 | } |
524 | 524 | ||
525 | r = amdgpu_uvd_get_destroy_msg(ring, 1, &fence); | 525 | r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence); |
526 | if (r) { | 526 | if (r) { |
527 | DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); | 527 | DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); |
528 | goto error; | 528 | goto error; |
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c index e3e7136dfd78..5b4aa2a36c02 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | |||
@@ -568,7 +568,7 @@ static int uvd_v5_0_ring_test_ib(struct amdgpu_ring *ring) | |||
568 | goto error; | 568 | goto error; |
569 | } | 569 | } |
570 | 570 | ||
571 | r = amdgpu_uvd_get_destroy_msg(ring, 1, &fence); | 571 | r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence); |
572 | if (r) { | 572 | if (r) { |
573 | DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); | 573 | DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); |
574 | goto error; | 574 | goto error; |
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index aa536076e695..c6bca730d25b 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
@@ -800,7 +800,7 @@ static int uvd_v6_0_ring_test_ib(struct amdgpu_ring *ring) | |||
800 | goto error; | 800 | goto error; |
801 | } | 801 | } |
802 | 802 | ||
803 | r = amdgpu_uvd_get_destroy_msg(ring, 1, &fence); | 803 | r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence); |
804 | if (r) { | 804 | if (r) { |
805 | DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); | 805 | DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); |
806 | goto error; | 806 | goto error; |