@@ -98,6 +98,8 @@ static int vcn_v2_0_set_pg_state(struct amdgpu_vcn_inst *vinst,
98
98
static int vcn_v2_0_pause_dpg_mode (struct amdgpu_vcn_inst * vinst ,
99
99
struct dpg_pause_state * new_state );
100
100
static int vcn_v2_0_start_sriov (struct amdgpu_device * adev );
101
+ static int vcn_v2_0_reset (struct amdgpu_vcn_inst * vinst );
102
+
101
103
/**
102
104
* vcn_v2_0_early_init - set function pointers and load microcode
103
105
*
@@ -213,6 +215,12 @@ static int vcn_v2_0_sw_init(struct amdgpu_ip_block *ip_block)
213
215
}
214
216
215
217
adev -> vcn .inst [0 ].pause_dpg_mode = vcn_v2_0_pause_dpg_mode ;
218
+ adev -> vcn .inst [0 ].reset = vcn_v2_0_reset ;
219
+
220
+ adev -> vcn .supported_reset =
221
+ amdgpu_get_soft_full_reset_mask (& adev -> vcn .inst [0 ].ring_enc [0 ]);
222
+ if (!amdgpu_sriov_vf (adev ))
223
+ adev -> vcn .supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE ;
216
224
217
225
r = amdgpu_virt_alloc_mm_table (adev );
218
226
if (r )
@@ -233,6 +241,10 @@ static int vcn_v2_0_sw_init(struct amdgpu_ip_block *ip_block)
233
241
adev -> vcn .ip_dump = ptr ;
234
242
}
235
243
244
+ r = amdgpu_vcn_sysfs_reset_mask_init (adev );
245
+ if (r )
246
+ return r ;
247
+
236
248
return 0 ;
237
249
}
238
250
@@ -260,6 +272,8 @@ static int vcn_v2_0_sw_fini(struct amdgpu_ip_block *ip_block)
260
272
if (r )
261
273
return r ;
262
274
275
+ amdgpu_vcn_sysfs_reset_mask_fini (adev );
276
+
263
277
r = amdgpu_vcn_sw_fini (adev , 0 );
264
278
265
279
kfree (adev -> vcn .ip_dump );
@@ -1355,6 +1369,16 @@ static int vcn_v2_0_pause_dpg_mode(struct amdgpu_vcn_inst *vinst,
1355
1369
return 0 ;
1356
1370
}
1357
1371
1372
+ static int vcn_v2_0_reset (struct amdgpu_vcn_inst * vinst )
1373
+ {
1374
+ int r ;
1375
+
1376
+ r = vcn_v2_0_stop (vinst );
1377
+ if (r )
1378
+ return r ;
1379
+ return vcn_v2_0_start (vinst );
1380
+ }
1381
+
1358
1382
static bool vcn_v2_0_is_idle (struct amdgpu_ip_block * ip_block )
1359
1383
{
1360
1384
struct amdgpu_device * adev = ip_block -> adev ;
@@ -2176,6 +2200,7 @@ static const struct amdgpu_ring_funcs vcn_v2_0_dec_ring_vm_funcs = {
2176
2200
.emit_wreg = vcn_v2_0_dec_ring_emit_wreg ,
2177
2201
.emit_reg_wait = vcn_v2_0_dec_ring_emit_reg_wait ,
2178
2202
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper ,
2203
+ .reset = amdgpu_vcn_ring_reset ,
2179
2204
};
2180
2205
2181
2206
static const struct amdgpu_ring_funcs vcn_v2_0_enc_ring_vm_funcs = {
@@ -2205,6 +2230,7 @@ static const struct amdgpu_ring_funcs vcn_v2_0_enc_ring_vm_funcs = {
2205
2230
.emit_wreg = vcn_v2_0_enc_ring_emit_wreg ,
2206
2231
.emit_reg_wait = vcn_v2_0_enc_ring_emit_reg_wait ,
2207
2232
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper ,
2233
+ .reset = amdgpu_vcn_ring_reset ,
2208
2234
};
2209
2235
2210
2236
static void vcn_v2_0_set_dec_ring_funcs (struct amdgpu_device * adev )
0 commit comments