diff options
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 48aedd34bfb1..c9a6b1a1cb97 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | static int vcn_v1_0_start(struct amdgpu_device *adev); | 38 | static int vcn_v1_0_start(struct amdgpu_device *adev); |
| 39 | static int vcn_v1_0_stop(struct amdgpu_device *adev); | 39 | static int vcn_v1_0_stop(struct amdgpu_device *adev); |
| 40 | static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev); | 40 | static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev); |
| 41 | static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev); | ||
| 41 | 42 | ||
| 42 | /** | 43 | /** |
| 43 | * vcn_v1_0_early_init - set function pointers | 44 | * vcn_v1_0_early_init - set function pointers |
| @@ -51,6 +52,7 @@ static int vcn_v1_0_early_init(void *handle) | |||
| 51 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 52 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
| 52 | 53 | ||
| 53 | vcn_v1_0_set_dec_ring_funcs(adev); | 54 | vcn_v1_0_set_dec_ring_funcs(adev); |
| 55 | vcn_v1_0_set_irq_funcs(adev); | ||
| 54 | 56 | ||
| 55 | return 0; | 57 | return 0; |
| 56 | } | 58 | } |
| @@ -674,6 +676,25 @@ static void vcn_v1_0_dec_ring_emit_vm_flush(struct amdgpu_ring *ring, | |||
| 674 | vcn_v1_0_dec_vm_reg_wait(ring, data0, data1, mask); | 676 | vcn_v1_0_dec_vm_reg_wait(ring, data0, data1, mask); |
| 675 | } | 677 | } |
| 676 | 678 | ||
| 679 | static int vcn_v1_0_set_interrupt_state(struct amdgpu_device *adev, | ||
| 680 | struct amdgpu_irq_src *source, | ||
| 681 | unsigned type, | ||
| 682 | enum amdgpu_interrupt_state state) | ||
| 683 | { | ||
| 684 | return 0; | ||
| 685 | } | ||
| 686 | |||
| 687 | static int vcn_v1_0_process_interrupt(struct amdgpu_device *adev, | ||
| 688 | struct amdgpu_irq_src *source, | ||
| 689 | struct amdgpu_iv_entry *entry) | ||
| 690 | { | ||
| 691 | DRM_DEBUG("IH: VCN TRAP\n"); | ||
| 692 | |||
| 693 | amdgpu_fence_process(&adev->vcn.ring_dec); | ||
| 694 | |||
| 695 | return 0; | ||
| 696 | } | ||
| 697 | |||
| 677 | static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { | 698 | static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { |
| 678 | .name = "vcn_v1_0", | 699 | .name = "vcn_v1_0", |
| 679 | .early_init = vcn_v1_0_early_init, | 700 | .early_init = vcn_v1_0_early_init, |
| @@ -724,3 +745,14 @@ static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev) | |||
| 724 | adev->vcn.ring_dec.funcs = &vcn_v1_0_dec_ring_vm_funcs; | 745 | adev->vcn.ring_dec.funcs = &vcn_v1_0_dec_ring_vm_funcs; |
| 725 | DRM_INFO("VCN decode is enabled in VM mode\n"); | 746 | DRM_INFO("VCN decode is enabled in VM mode\n"); |
| 726 | } | 747 | } |
| 748 | |||
| 749 | static const struct amdgpu_irq_src_funcs vcn_v1_0_irq_funcs = { | ||
| 750 | .set = vcn_v1_0_set_interrupt_state, | ||
| 751 | .process = vcn_v1_0_process_interrupt, | ||
| 752 | }; | ||
| 753 | |||
| 754 | static void vcn_v1_0_set_irq_funcs(struct amdgpu_device *adev) | ||
| 755 | { | ||
| 756 | adev->vcn.irq.num_types = 1; | ||
| 757 | adev->vcn.irq.funcs = &vcn_v1_0_irq_funcs; | ||
| 758 | } | ||
