From: Tom St Denis Date: Tue, 15 Dec 2015 15:55:34 +0000 (-0500) Subject: amdgpu/vce3: Simplify vce_v3_0_hw_init and ensure both rings default to not ready. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=691ca86a3a15a9c5054edb3c517a1aeb40e9fadc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Tom St Denis Reviewed-by: Alex Deucher Reviewed-by: Christian König --- diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c index ad56b1f49b09..e99af81e4aec 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c @@ -414,28 +414,22 @@ static int vce_v3_0_sw_fini(void *handle) static int vce_v3_0_hw_init(void *handle) { - struct amdgpu_ring *ring; - int r; + int r, i; struct amdgpu_device *adev = (struct amdgpu_device *)handle; r = vce_v3_0_start(adev); if (r) return r; - ring = &adev->vce.ring[0]; - ring->ready = true; - r = amdgpu_ring_test_ring(ring); - if (r) { - ring->ready = false; - return r; - } + adev->vce.ring[0].ready = false; + adev->vce.ring[1].ready = false; - ring = &adev->vce.ring[1]; - ring->ready = true; - r = amdgpu_ring_test_ring(ring); - if (r) { - ring->ready = false; - return r; + for (i = 0; i < 2; i++) { + r = amdgpu_ring_test_ring(&adev->vce.ring[i]); + if (r) + return r; + else + adev->vce.ring[i].ready = true; } DRM_INFO("VCE initialized successfully.\n");