diff options
author | Christian König <christian.koenig@amd.com> | 2016-07-05 16:47:54 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-29 20:37:03 +0200 |
commit | 8de190c9f44204810440e26ac09913a1fa40aa36 (patch) | |
tree | 5a72066fce7e5cdbeff34ea31a54bb02fda44e92 /drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |
parent | drm/amdgpu: use begin/end_use for VCE power/clock gating (diff) | |
download | linux-8de190c9f44204810440e26ac09913a1fa40aa36.tar.xz linux-8de190c9f44204810440e26ac09913a1fa40aa36.zip |
drm/amdgpu: move UVD IB test into common code v2
Since we now raise the clocks from begin_use() we don't need
a separate function for each hw generation any more.
v2: remove unintentional lowering of the UVD clocks, fix typos for CIK hw.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
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 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index bfb3c274d7f0..ef5342bd6968 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -1127,3 +1127,38 @@ void amdgpu_uvd_ring_end_use(struct amdgpu_ring *ring) { schedule_delayed_work(&ring->adev->uvd.idle_work, UVD_IDLE_TIMEOUT); } + +/** + * amdgpu_uvd_ring_test_ib - test ib execution + * + * @ring: amdgpu_ring pointer + * + * Test if we can successfully execute an IB + */ +int amdgpu_uvd_ring_test_ib(struct amdgpu_ring *ring) +{ + struct fence *fence = NULL; + int r; + + r = amdgpu_uvd_get_create_msg(ring, 1, NULL); + if (r) { + DRM_ERROR("amdgpu: failed to get create msg (%d).\n", r); + goto error; + } + + r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence); + if (r) { + DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r); + goto error; + } + + r = fence_wait(fence, false); + if (r) { + DRM_ERROR("amdgpu: fence wait failed (%d).\n", r); + goto error; + } + DRM_INFO("ib test on ring %d succeeded\n", ring->idx); +error: + fence_put(fence); + return r; +} |