diff options
| author | James Zhu <James.Zhu@amd.com> | 2017-09-29 16:47:31 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-06 17:44:11 -0400 |
| commit | 65da0d40e561a717fee065d69d6e4f8d5b34db32 (patch) | |
| tree | b49c5bd822cbeb0713db9aeb190e29010a8f72f6 | |
| parent | e0128efb08b3d628d767ec8578e77cdd7ecc8f81 (diff) | |
drm/amdgpu: add uvd enc irq
Add UVD encode IRQ handle and enable the UVD encode trap
Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 5fd14c972fe7..60af7310a234 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
| @@ -393,6 +393,15 @@ static int uvd_v6_0_sw_init(void *handle) | |||
| 393 | if (r) | 393 | if (r) |
| 394 | return r; | 394 | return r; |
| 395 | 395 | ||
| 396 | /* UVD ENC TRAP */ | ||
| 397 | if (uvd_v6_0_enc_support(adev)) { | ||
| 398 | for (i = 0; i < adev->uvd.num_enc_rings; ++i) { | ||
| 399 | r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i + 119, &adev->uvd.irq); | ||
| 400 | if (r) | ||
| 401 | return r; | ||
| 402 | } | ||
| 403 | } | ||
| 404 | |||
| 396 | r = amdgpu_uvd_sw_init(adev); | 405 | r = amdgpu_uvd_sw_init(adev); |
| 397 | if (r) | 406 | if (r) |
| 398 | return r; | 407 | return r; |
| @@ -1236,8 +1245,31 @@ static int uvd_v6_0_process_interrupt(struct amdgpu_device *adev, | |||
| 1236 | struct amdgpu_irq_src *source, | 1245 | struct amdgpu_irq_src *source, |
| 1237 | struct amdgpu_iv_entry *entry) | 1246 | struct amdgpu_iv_entry *entry) |
| 1238 | { | 1247 | { |
| 1248 | bool int_handled = true; | ||
| 1239 | DRM_DEBUG("IH: UVD TRAP\n"); | 1249 | DRM_DEBUG("IH: UVD TRAP\n"); |
| 1240 | amdgpu_fence_process(&adev->uvd.ring); | 1250 | |
| 1251 | switch (entry->src_id) { | ||
| 1252 | case 124: | ||
| 1253 | amdgpu_fence_process(&adev->uvd.ring); | ||
| 1254 | break; | ||
| 1255 | case 119: | ||
| 1256 | if (likely(uvd_v6_0_enc_support(adev))) | ||
| 1257 | amdgpu_fence_process(&adev->uvd.ring_enc[0]); | ||
| 1258 | else | ||
| 1259 | int_handled = false; | ||
| 1260 | break; | ||
| 1261 | case 120: | ||
| 1262 | if (likely(uvd_v6_0_enc_support(adev))) | ||
| 1263 | amdgpu_fence_process(&adev->uvd.ring_enc[1]); | ||
| 1264 | else | ||
| 1265 | int_handled = false; | ||
| 1266 | break; | ||
| 1267 | } | ||
| 1268 | |||
| 1269 | if (false == int_handled) | ||
| 1270 | DRM_ERROR("Unhandled interrupt: %d %d\n", | ||
| 1271 | entry->src_id, entry->src_data[0]); | ||
| 1272 | |||
| 1241 | return 0; | 1273 | return 0; |
| 1242 | } | 1274 | } |
| 1243 | 1275 | ||
| @@ -1619,7 +1651,11 @@ static const struct amdgpu_irq_src_funcs uvd_v6_0_irq_funcs = { | |||
| 1619 | 1651 | ||
| 1620 | static void uvd_v6_0_set_irq_funcs(struct amdgpu_device *adev) | 1652 | static void uvd_v6_0_set_irq_funcs(struct amdgpu_device *adev) |
| 1621 | { | 1653 | { |
| 1622 | adev->uvd.irq.num_types = 1; | 1654 | if (uvd_v6_0_enc_support(adev)) |
| 1655 | adev->uvd.irq.num_types = adev->uvd.num_enc_rings + 1; | ||
| 1656 | else | ||
| 1657 | adev->uvd.irq.num_types = 1; | ||
| 1658 | |||
| 1623 | adev->uvd.irq.funcs = &uvd_v6_0_irq_funcs; | 1659 | adev->uvd.irq.funcs = &uvd_v6_0_irq_funcs; |
| 1624 | } | 1660 | } |
| 1625 | 1661 | ||
