mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-16 14:15:02 -05:00
drm/amdgpu/vcn2: implement ring reset
Use the new helpers to handle engine resets for VCN. Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com> Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -98,6 +98,8 @@ static int vcn_v2_0_set_pg_state(struct amdgpu_vcn_inst *vinst,
|
||||
static int vcn_v2_0_pause_dpg_mode(struct amdgpu_vcn_inst *vinst,
|
||||
struct dpg_pause_state *new_state);
|
||||
static int vcn_v2_0_start_sriov(struct amdgpu_device *adev);
|
||||
static int vcn_v2_0_reset(struct amdgpu_vcn_inst *vinst);
|
||||
|
||||
/**
|
||||
* vcn_v2_0_early_init - set function pointers and load microcode
|
||||
*
|
||||
@@ -213,6 +215,12 @@ static int vcn_v2_0_sw_init(struct amdgpu_ip_block *ip_block)
|
||||
}
|
||||
|
||||
adev->vcn.inst[0].pause_dpg_mode = vcn_v2_0_pause_dpg_mode;
|
||||
adev->vcn.inst[0].reset = vcn_v2_0_reset;
|
||||
|
||||
adev->vcn.supported_reset =
|
||||
amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]);
|
||||
if (!amdgpu_sriov_vf(adev))
|
||||
adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
|
||||
|
||||
r = amdgpu_virt_alloc_mm_table(adev);
|
||||
if (r)
|
||||
@@ -233,6 +241,10 @@ static int vcn_v2_0_sw_init(struct amdgpu_ip_block *ip_block)
|
||||
adev->vcn.ip_dump = ptr;
|
||||
}
|
||||
|
||||
r = amdgpu_vcn_sysfs_reset_mask_init(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -260,6 +272,8 @@ static int vcn_v2_0_sw_fini(struct amdgpu_ip_block *ip_block)
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
amdgpu_vcn_sysfs_reset_mask_fini(adev);
|
||||
|
||||
r = amdgpu_vcn_sw_fini(adev, 0);
|
||||
|
||||
kfree(adev->vcn.ip_dump);
|
||||
@@ -1355,6 +1369,16 @@ static int vcn_v2_0_pause_dpg_mode(struct amdgpu_vcn_inst *vinst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vcn_v2_0_reset(struct amdgpu_vcn_inst *vinst)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = vcn_v2_0_stop(vinst);
|
||||
if (r)
|
||||
return r;
|
||||
return vcn_v2_0_start(vinst);
|
||||
}
|
||||
|
||||
static bool vcn_v2_0_is_idle(struct amdgpu_ip_block *ip_block)
|
||||
{
|
||||
struct amdgpu_device *adev = ip_block->adev;
|
||||
@@ -2176,6 +2200,7 @@ static const struct amdgpu_ring_funcs vcn_v2_0_dec_ring_vm_funcs = {
|
||||
.emit_wreg = vcn_v2_0_dec_ring_emit_wreg,
|
||||
.emit_reg_wait = vcn_v2_0_dec_ring_emit_reg_wait,
|
||||
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
|
||||
.reset = amdgpu_vcn_ring_reset,
|
||||
};
|
||||
|
||||
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 = {
|
||||
.emit_wreg = vcn_v2_0_enc_ring_emit_wreg,
|
||||
.emit_reg_wait = vcn_v2_0_enc_ring_emit_reg_wait,
|
||||
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
|
||||
.reset = amdgpu_vcn_ring_reset,
|
||||
};
|
||||
|
||||
static void vcn_v2_0_set_dec_ring_funcs(struct amdgpu_device *adev)
|
||||
|
||||
Reference in New Issue
Block a user