@@ -102,6 +102,7 @@ static int vcn_v2_5_pause_dpg_mode(struct amdgpu_vcn_inst *vinst,
102
102
struct dpg_pause_state * new_state );
103
103
static int vcn_v2_5_sriov_start (struct amdgpu_device * adev );
104
104
static void vcn_v2_5_set_ras_funcs (struct amdgpu_device * adev );
105
+ static int vcn_v2_5_reset (struct amdgpu_vcn_inst * vinst );
105
106
106
107
static int amdgpu_ih_clientid_vcns [] = {
107
108
SOC15_IH_CLIENTID_VCN ,
@@ -404,8 +405,14 @@ static int vcn_v2_5_sw_init(struct amdgpu_ip_block *ip_block)
404
405
405
406
if (adev -> pg_flags & AMD_PG_SUPPORT_VCN_DPG )
406
407
adev -> vcn .inst [j ].pause_dpg_mode = vcn_v2_5_pause_dpg_mode ;
408
+ adev -> vcn .inst [j ].reset = vcn_v2_5_reset ;
407
409
}
408
410
411
+ adev -> vcn .supported_reset =
412
+ amdgpu_get_soft_full_reset_mask (& adev -> vcn .inst [0 ].ring_enc [0 ]);
413
+ if (!amdgpu_sriov_vf (adev ))
414
+ adev -> vcn .supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE ;
415
+
409
416
if (amdgpu_sriov_vf (adev )) {
410
417
r = amdgpu_virt_alloc_mm_table (adev );
411
418
if (r )
@@ -425,6 +432,10 @@ static int vcn_v2_5_sw_init(struct amdgpu_ip_block *ip_block)
425
432
adev -> vcn .ip_dump = ptr ;
426
433
}
427
434
435
+ r = amdgpu_vcn_sysfs_reset_mask_init (adev );
436
+ if (r )
437
+ return r ;
438
+
428
439
return 0 ;
429
440
}
430
441
@@ -455,6 +466,8 @@ static int vcn_v2_5_sw_fini(struct amdgpu_ip_block *ip_block)
455
466
if (amdgpu_sriov_vf (adev ))
456
467
amdgpu_virt_free_mm_table (adev );
457
468
469
+ amdgpu_vcn_sysfs_reset_mask_fini (adev );
470
+
458
471
for (i = 0 ; i < adev -> vcn .num_vcn_inst ; i ++ ) {
459
472
r = amdgpu_vcn_suspend (adev , i );
460
473
if (r )
@@ -1816,6 +1829,7 @@ static const struct amdgpu_ring_funcs vcn_v2_5_dec_ring_vm_funcs = {
1816
1829
.emit_wreg = vcn_v2_0_dec_ring_emit_wreg ,
1817
1830
.emit_reg_wait = vcn_v2_0_dec_ring_emit_reg_wait ,
1818
1831
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper ,
1832
+ .reset = amdgpu_vcn_ring_reset ,
1819
1833
};
1820
1834
1821
1835
/**
@@ -1914,6 +1928,7 @@ static const struct amdgpu_ring_funcs vcn_v2_5_enc_ring_vm_funcs = {
1914
1928
.emit_wreg = vcn_v2_0_enc_ring_emit_wreg ,
1915
1929
.emit_reg_wait = vcn_v2_0_enc_ring_emit_reg_wait ,
1916
1930
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper ,
1931
+ .reset = amdgpu_vcn_ring_reset ,
1917
1932
};
1918
1933
1919
1934
static void vcn_v2_5_set_dec_ring_funcs (struct amdgpu_device * adev )
@@ -1942,6 +1957,16 @@ static void vcn_v2_5_set_enc_ring_funcs(struct amdgpu_device *adev)
1942
1957
}
1943
1958
}
1944
1959
1960
+ static int vcn_v2_5_reset (struct amdgpu_vcn_inst * vinst )
1961
+ {
1962
+ int r ;
1963
+
1964
+ r = vcn_v2_5_stop (vinst );
1965
+ if (r )
1966
+ return r ;
1967
+ return vcn_v2_5_start (vinst );
1968
+ }
1969
+
1945
1970
static bool vcn_v2_5_is_idle (struct amdgpu_ip_block * ip_block )
1946
1971
{
1947
1972
struct amdgpu_device * adev = ip_block -> adev ;
0 commit comments