diff options
author | Leo Liu <leo.liu@amd.com> | 2017-02-21 10:38:42 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-24 17:41:43 -0400 |
commit | c3bd304009dee48adbb2b6937b7f4a07c5e4e281 (patch) | |
tree | 2648a764b1182140eb16b917f8d69fa1b0312f32 /drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |
parent | 9b257116e784dafc83fd8094ed2bfc12d193d228 (diff) |
drm/amdgpu: enable vcn encode ring tests
Wire up the callback and enable them.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index f09d2aea9886..4ddaec318d91 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |||
@@ -144,7 +144,7 @@ static int vcn_v1_0_hw_init(void *handle) | |||
144 | { | 144 | { |
145 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 145 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
146 | struct amdgpu_ring *ring = &adev->vcn.ring_dec; | 146 | struct amdgpu_ring *ring = &adev->vcn.ring_dec; |
147 | int r; | 147 | int i, r; |
148 | 148 | ||
149 | r = vcn_v1_0_start(adev); | 149 | r = vcn_v1_0_start(adev); |
150 | if (r) | 150 | if (r) |
@@ -157,9 +157,19 @@ static int vcn_v1_0_hw_init(void *handle) | |||
157 | goto done; | 157 | goto done; |
158 | } | 158 | } |
159 | 159 | ||
160 | for (i = 0; i < adev->vcn.num_enc_rings; ++i) { | ||
161 | ring = &adev->vcn.ring_enc[i]; | ||
162 | ring->ready = true; | ||
163 | r = amdgpu_ring_test_ring(ring); | ||
164 | if (r) { | ||
165 | ring->ready = false; | ||
166 | goto done; | ||
167 | } | ||
168 | } | ||
169 | |||
160 | done: | 170 | done: |
161 | if (!r) | 171 | if (!r) |
162 | DRM_INFO("VCN decode initialized successfully.\n"); | 172 | DRM_INFO("VCN decode and encode initialized successfully.\n"); |
163 | 173 | ||
164 | return r; | 174 | return r; |
165 | } | 175 | } |
@@ -930,6 +940,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_enc_ring_vm_funcs = { | |||
930 | .emit_ib = vcn_v1_0_enc_ring_emit_ib, | 940 | .emit_ib = vcn_v1_0_enc_ring_emit_ib, |
931 | .emit_fence = vcn_v1_0_enc_ring_emit_fence, | 941 | .emit_fence = vcn_v1_0_enc_ring_emit_fence, |
932 | .emit_vm_flush = vcn_v1_0_enc_ring_emit_vm_flush, | 942 | .emit_vm_flush = vcn_v1_0_enc_ring_emit_vm_flush, |
943 | .test_ring = amdgpu_vcn_enc_ring_test_ring, | ||
933 | .insert_nop = amdgpu_ring_insert_nop, | 944 | .insert_nop = amdgpu_ring_insert_nop, |
934 | .insert_end = vcn_v1_0_enc_ring_insert_end, | 945 | .insert_end = vcn_v1_0_enc_ring_insert_end, |
935 | .pad_ib = amdgpu_ring_generic_pad_ib, | 946 | .pad_ib = amdgpu_ring_generic_pad_ib, |