@@ -87,13 +87,13 @@ static int jpeg_v4_0_sw_init(void *handle)
87
87
88
88
/* JPEG DJPEG POISON EVENT */
89
89
r = amdgpu_irq_add_id (adev , SOC15_IH_CLIENTID_VCN ,
90
- VCN_4_0__SRCID_DJPEG0_POISON , & adev -> jpeg .inst -> irq );
90
+ VCN_4_0__SRCID_DJPEG0_POISON , & adev -> jpeg .inst -> ras_poison_irq );
91
91
if (r )
92
92
return r ;
93
93
94
94
/* JPEG EJPEG POISON EVENT */
95
95
r = amdgpu_irq_add_id (adev , SOC15_IH_CLIENTID_VCN ,
96
- VCN_4_0__SRCID_EJPEG0_POISON , & adev -> jpeg .inst -> irq );
96
+ VCN_4_0__SRCID_EJPEG0_POISON , & adev -> jpeg .inst -> ras_poison_irq );
97
97
if (r )
98
98
return r ;
99
99
@@ -202,7 +202,8 @@ static int jpeg_v4_0_hw_fini(void *handle)
202
202
RREG32_SOC15 (JPEG , 0 , regUVD_JRBC_STATUS ))
203
203
jpeg_v4_0_set_powergating_state (adev , AMD_PG_STATE_GATE );
204
204
}
205
- amdgpu_irq_put (adev , & adev -> jpeg .inst -> irq , 0 );
205
+ if (amdgpu_ras_is_supported (adev , AMDGPU_RAS_BLOCK__JPEG ))
206
+ amdgpu_irq_put (adev , & adev -> jpeg .inst -> ras_poison_irq , 0 );
206
207
207
208
return 0 ;
208
209
}
@@ -670,6 +671,14 @@ static int jpeg_v4_0_set_interrupt_state(struct amdgpu_device *adev,
670
671
return 0 ;
671
672
}
672
673
674
+ static int jpeg_v4_0_set_ras_interrupt_state (struct amdgpu_device * adev ,
675
+ struct amdgpu_irq_src * source ,
676
+ unsigned int type ,
677
+ enum amdgpu_interrupt_state state )
678
+ {
679
+ return 0 ;
680
+ }
681
+
673
682
static int jpeg_v4_0_process_interrupt (struct amdgpu_device * adev ,
674
683
struct amdgpu_irq_src * source ,
675
684
struct amdgpu_iv_entry * entry )
@@ -680,10 +689,6 @@ static int jpeg_v4_0_process_interrupt(struct amdgpu_device *adev,
680
689
case VCN_4_0__SRCID__JPEG_DECODE :
681
690
amdgpu_fence_process (& adev -> jpeg .inst -> ring_dec );
682
691
break ;
683
- case VCN_4_0__SRCID_DJPEG0_POISON :
684
- case VCN_4_0__SRCID_EJPEG0_POISON :
685
- amdgpu_jpeg_process_poison_irq (adev , source , entry );
686
- break ;
687
692
default :
688
693
DRM_DEV_ERROR (adev -> dev , "Unhandled interrupt: %d %d\n" ,
689
694
entry -> src_id , entry -> src_data [0 ]);
@@ -753,10 +758,18 @@ static const struct amdgpu_irq_src_funcs jpeg_v4_0_irq_funcs = {
753
758
.process = jpeg_v4_0_process_interrupt ,
754
759
};
755
760
761
+ static const struct amdgpu_irq_src_funcs jpeg_v4_0_ras_irq_funcs = {
762
+ .set = jpeg_v4_0_set_ras_interrupt_state ,
763
+ .process = amdgpu_jpeg_process_poison_irq ,
764
+ };
765
+
756
766
static void jpeg_v4_0_set_irq_funcs (struct amdgpu_device * adev )
757
767
{
758
768
adev -> jpeg .inst -> irq .num_types = 1 ;
759
769
adev -> jpeg .inst -> irq .funcs = & jpeg_v4_0_irq_funcs ;
770
+
771
+ adev -> jpeg .inst -> ras_poison_irq .num_types = 1 ;
772
+ adev -> jpeg .inst -> ras_poison_irq .funcs = & jpeg_v4_0_ras_irq_funcs ;
760
773
}
761
774
762
775
const struct amdgpu_ip_block_version jpeg_v4_0_ip_block = {
@@ -811,6 +824,7 @@ const struct amdgpu_ras_block_hw_ops jpeg_v4_0_ras_hw_ops = {
811
824
static struct amdgpu_jpeg_ras jpeg_v4_0_ras = {
812
825
.ras_block = {
813
826
.hw_ops = & jpeg_v4_0_ras_hw_ops ,
827
+ .ras_late_init = amdgpu_jpeg_ras_late_init ,
814
828
},
815
829
};
816
830
0 commit comments