diff options
author | Leo Liu <leo.liu@amd.com> | 2017-02-21 15:19:18 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-24 17:41:42 -0400 |
commit | 9b257116e784dafc83fd8094ed2bfc12d193d228 (patch) | |
tree | 6c89aec6bcd2d462ee41fa938185a2aa53c3e9e3 /drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |
parent | 8ace845ff0e8fc610686c0fa12ec05130fbf1f6b (diff) |
drm/amdgpu: add vcn enc irq support
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 | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index e15a81ffa2ca..f09d2aea9886 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |||
@@ -74,11 +74,19 @@ static int vcn_v1_0_sw_init(void *handle) | |||
74 | int i, r; | 74 | int i, r; |
75 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 75 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
76 | 76 | ||
77 | /* VCN TRAP */ | 77 | /* VCN DEC TRAP */ |
78 | r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VCN, 124, &adev->vcn.irq); | 78 | r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VCN, 124, &adev->vcn.irq); |
79 | if (r) | 79 | if (r) |
80 | return r; | 80 | return r; |
81 | 81 | ||
82 | /* VCN ENC TRAP */ | ||
83 | for (i = 0; i < adev->vcn.num_enc_rings; ++i) { | ||
84 | r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VCN, i + 119, | ||
85 | &adev->vcn.irq); | ||
86 | if (r) | ||
87 | return r; | ||
88 | } | ||
89 | |||
82 | r = amdgpu_vcn_sw_init(adev); | 90 | r = amdgpu_vcn_sw_init(adev); |
83 | if (r) | 91 | if (r) |
84 | return r; | 92 | return r; |
@@ -839,7 +847,21 @@ static int vcn_v1_0_process_interrupt(struct amdgpu_device *adev, | |||
839 | { | 847 | { |
840 | DRM_DEBUG("IH: VCN TRAP\n"); | 848 | DRM_DEBUG("IH: VCN TRAP\n"); |
841 | 849 | ||
842 | amdgpu_fence_process(&adev->vcn.ring_dec); | 850 | switch (entry->src_id) { |
851 | case 124: | ||
852 | amdgpu_fence_process(&adev->vcn.ring_dec); | ||
853 | break; | ||
854 | case 119: | ||
855 | amdgpu_fence_process(&adev->vcn.ring_enc[0]); | ||
856 | break; | ||
857 | case 120: | ||
858 | amdgpu_fence_process(&adev->vcn.ring_enc[1]); | ||
859 | break; | ||
860 | default: | ||
861 | DRM_ERROR("Unhandled interrupt: %d %d\n", | ||
862 | entry->src_id, entry->src_data[0]); | ||
863 | break; | ||
864 | } | ||
843 | 865 | ||
844 | return 0; | 866 | return 0; |
845 | } | 867 | } |
@@ -938,7 +960,7 @@ static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = { | |||
938 | 960 | ||
939 | static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev) | 961 | static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev) |
940 | { | 962 | { |
941 | adev->vcn.irq.num_types = 1; | 963 | adev->uvd.irq.num_types = adev->vcn.num_enc_rings + 1; |
942 | adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs; | 964 | adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs; |
943 | } | 965 | } |
944 | 966 | ||