Commit b05e9e4c authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/radeon: raise UVD clocks on init v3

v2: not only raise the clocks on VCPU boot, but also on IB test.
v3: agd5f: fix r600_uvd_init return value.

fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=63730Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 55b51c88
...@@ -2645,6 +2645,9 @@ int r600_uvd_init(struct radeon_device *rdev) ...@@ -2645,6 +2645,9 @@ int r600_uvd_init(struct radeon_device *rdev)
{ {
int i, j, r; int i, j, r;
/* raise clocks while booting up the VCPU */
radeon_set_uvd_clocks(rdev, 53300, 40000);
/* disable clock gating */ /* disable clock gating */
WREG32(UVD_CGC_GATE, 0); WREG32(UVD_CGC_GATE, 0);
...@@ -2715,19 +2718,24 @@ int r600_uvd_init(struct radeon_device *rdev) ...@@ -2715,19 +2718,24 @@ int r600_uvd_init(struct radeon_device *rdev)
mdelay(10); mdelay(10);
r = -1; r = -1;
} }
if (r) { if (r) {
DRM_ERROR("UVD not responding, giving up!!!\n"); DRM_ERROR("UVD not responding, giving up!!!\n");
radeon_set_uvd_clocks(rdev, 0, 0);
return r; return r;
} }
/* enable interupt */ /* enable interupt */
WREG32_P(UVD_MASTINT_EN, 3<<1, ~(3 << 1)); WREG32_P(UVD_MASTINT_EN, 3<<1, ~(3 << 1));
r = r600_uvd_rbc_start(rdev); r = r600_uvd_rbc_start(rdev);
if (r) if (!r)
return r; DRM_INFO("UVD initialized successfully.\n");
DRM_INFO("UVD initialized successfully.\n"); /* lower clocks again */
return 0; radeon_set_uvd_clocks(rdev, 0, 0);
return r;
} }
/* /*
...@@ -3566,28 +3574,36 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -3566,28 +3574,36 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
int r600_uvd_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) int r600_uvd_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
{ {
struct radeon_fence *fence; struct radeon_fence *fence = NULL;
int r; int r;
r = radeon_set_uvd_clocks(rdev, 53300, 40000);
if (r) {
DRM_ERROR("radeon: failed to raise UVD clocks (%d).\n", r);
return r;
}
r = radeon_uvd_get_create_msg(rdev, ring->idx, 1, NULL); r = radeon_uvd_get_create_msg(rdev, ring->idx, 1, NULL);
if (r) { if (r) {
DRM_ERROR("radeon: failed to get create msg (%d).\n", r); DRM_ERROR("radeon: failed to get create msg (%d).\n", r);
return r; goto error;
} }
r = radeon_uvd_get_destroy_msg(rdev, ring->idx, 1, &fence); r = radeon_uvd_get_destroy_msg(rdev, ring->idx, 1, &fence);
if (r) { if (r) {
DRM_ERROR("radeon: failed to get destroy ib (%d).\n", r); DRM_ERROR("radeon: failed to get destroy ib (%d).\n", r);
return r; goto error;
} }
r = radeon_fence_wait(fence, false); r = radeon_fence_wait(fence, false);
if (r) { if (r) {
DRM_ERROR("radeon: fence wait failed (%d).\n", r); DRM_ERROR("radeon: fence wait failed (%d).\n", r);
return r; goto error;
} }
DRM_INFO("ib test on ring %d succeeded\n", ring->idx); DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
error:
radeon_fence_unref(&fence); radeon_fence_unref(&fence);
radeon_set_uvd_clocks(rdev, 0, 0);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment