Commit 691ca86a authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher

amdgpu/vce3: Simplify vce_v3_0_hw_init and ensure both rings default to not ready.

Simplified the ring test and added logic to ensure rings are marked not ready
by default.
Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
parent 74af1276
...@@ -414,28 +414,22 @@ static int vce_v3_0_sw_fini(void *handle) ...@@ -414,28 +414,22 @@ static int vce_v3_0_sw_fini(void *handle)
static int vce_v3_0_hw_init(void *handle) static int vce_v3_0_hw_init(void *handle)
{ {
struct amdgpu_ring *ring; int r, i;
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
r = vce_v3_0_start(adev); r = vce_v3_0_start(adev);
if (r) if (r)
return r; return r;
ring = &adev->vce.ring[0]; adev->vce.ring[0].ready = false;
ring->ready = true; adev->vce.ring[1].ready = false;
r = amdgpu_ring_test_ring(ring);
if (r) {
ring->ready = false;
return r;
}
ring = &adev->vce.ring[1]; for (i = 0; i < 2; i++) {
ring->ready = true; r = amdgpu_ring_test_ring(&adev->vce.ring[i]);
r = amdgpu_ring_test_ring(ring); if (r)
if (r) { return r;
ring->ready = false; else
return r; adev->vce.ring[i].ready = true;
} }
DRM_INFO("VCE initialized successfully.\n"); DRM_INFO("VCE initialized successfully.\n");
......
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