drm/amdgpu: add MEC pipe reset helpers
Subsystems (2)
PATCH 1/4 drm/amdgpu: add MEC pipe reset helpers
Add IP-agnostic helpers to coordinate a MEC pipe reset across all KCQs on the same (me, pipe): prepare (back up siblings, stop schedulers, stop KFD), restart_schedulers, and recover_queues (re-init/remap KCQs and run amdgpu_ring_reset_helper_end on each — guilty gets the timeout fence, siblings get a synthetic context so collateral work is reemitted).
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 115 ++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 11 +++ 2 files changed, 126 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +115 -0
@@ -69,6 +69,121 @@ void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit, } +static bool amdgpu_gfx_ring_on_mec_pipe (struct amdgpu_ring *ring,u32 me,u32 pipe) +{ +if (!ring || !ring->funcs || ring->funcs->type !=AMDGPU_RING_TYPE_COMPUTE ) +return false; +if (ring->no_scheduler) +return false; + +return ring->me == me && ring->pipe == pipe; +} + +static unsigned int amdgpu_gfx_mec_pipe_compute_ring_base (struct amdgpu_device *adev, +u32 xcc_id) +{ +int num_xcc = adev->gfx.xcc_mask ?NUM_XCC (adev->gfx.xcc_mask) :1 ; + +if (num_xcc <=1 ) +return 0 ; +return xcc_id * adev->gfx.num_compute_rings; +} + +void amdgpu_gfx_mec_pipe_reset_prepare (struct amdgpu_device *adev, +struct amdgpu_ring *guilty) +{ +struct amdgpu_ring *r; +unsigned int j, base; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, guilty->xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; +if (r != guilty) +amdgpu_ring_backup_unprocessed_commands (r,NULL ); +if (amdgpu_ring_sched_ready (r)) +drm_sched_wqueue_stop (&r->sched); + } + +if (adev->kfd.init_complete) +amdgpu_amdkfd_stop_sched (adev, guilty->xcc_id); +} + +void amdgpu_gfx_mec_pipe_restart_schedulers (struct amdgpu_device *adev, +u32 me,u32 pipe,u32 xcc_id) +{ +struct amdgpu_ring *r; +unsigned int j, base; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, me, pipe)) +continue ; +if (amdgpu_ring_sched_ready (r)) +drm_sched_wqueue_start (&r->sched); + } + +if (adev->kfd.init_complete) +amdgpu_amdkfd_start_sched (adev, xcc_id); +} + +int amdgpu_gfx_mec_pipe_reset_recover_queues (struct amdgpu_device *adev, +struct amdgpu_ring *guilty, +struct amdgpu_fence *timedout_fence, +amdgpu_gfx_kcq_init_queue_t kcq_init) +{ +struct amdgpu_fence collateral_reemit = {}; +struct amdgpu_ring *r; +unsigned int j, base; +int err =0 ; + +if (!timedout_fence) +return -EINVAL ; + + collateral_reemit.context = (u64)-1 ; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, guilty->xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; + + err =kcq_init (r, true); +if (err) + goto err_sched; + err =amdgpu_mes_map_legacy_queue (adev, r,0 ); +if (err) + goto err_sched; + } + +amdgpu_gfx_mec_pipe_restart_schedulers (adev, guilty->me, guilty->pipe, + guilty->xcc_id); + +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; + + err =amdgpu_ring_reset_helper_end ( + r, r == guilty ? timedout_fence : &collateral_reemit); +if (err) { +dev_err (adev->dev, +"ring %s failed recover after MEC pipe reset (%d)\n" , + r->name, err); +return err; + } + } + +return 0 ; + +err_sched: +amdgpu_gfx_mec_pipe_restart_schedulers (adev, guilty->me, guilty->pipe, + guilty->xcc_id); +return err; +} +bool amdgpu_gfx_is_mec_queue_enabled (struct amdgpu_device *adev,int xcc_id,int mec,int pipe,int queue) {
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +11 -0
@@ -603,6 +603,17 @@ int amdgpu_gfx_mec_queue_to_bit(struct amdgpu_device *adev, int mec, int pipe, int queue);void amdgpu_queue_mask_bit_to_mec_queue (struct amdgpu_device *adev,int bit,int *mec,int *pipe,int *queue); + +typedef int (*amdgpu_gfx_kcq_init_queue_t )(struct amdgpu_ring *ring,bool clear); + +void amdgpu_gfx_mec_pipe_reset_prepare (struct amdgpu_device *adev, +struct amdgpu_ring *guilty); +void amdgpu_gfx_mec_pipe_restart_schedulers (struct amdgpu_device *adev, +u32 me,u32 pipe,u32 xcc_id); +int amdgpu_gfx_mec_pipe_reset_recover_queues ( +struct amdgpu_device *adev,struct amdgpu_ring *guilty, +struct amdgpu_fence *timedout_fence, +amdgpu_gfx_kcq_init_queue_t kcq_init);bool amdgpu_gfx_is_mec_queue_enabled (struct amdgpu_device *adev,int xcc_id,int mec,int pipe,int queue); bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
Signature · 1 line
2.49.0
PATCH 2/4 drm/amdgpu/gfx_v11_0: fix GFX11 MEC pipe reset ordering
Hold MEC pipe reset asserted, walk every queue on that (me, pipe) and tear down CP_HQD_ACTIVE / CP_HQD_DEQUEUE_REQUEST via gfx_v11_0_clear_hqds_on_mec_pipe(), then deassert reset. Avoids releasing pipe reset while HQDs may still be active.
Legacy (non-RS64) path: read CP_MEC_CNTL for the reset mask instead of reusing CP_MEC_RS64_CNTL state.
Wire reset_kcq into the new amdgpu_gfx_mec_pipe_reset_{prepare, recover_queues} helpers so sibling KCQs on the same pipe are stopped, restarted, and have their fences handled correctly.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 151 +++++++++++++++---------- 1 file changed, 93 insertions(+), 58 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +93 -58
@@ -6874,11 +6874,34 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring,return amdgpu_ring_reset_helper_end (ring, timedout_fence); } +/* Caller must hold adev->srbm_mutex; pipe reset must be asserted. */ +static void gfx_v11_0_clear_hqds_on_mec_pipe (struct amdgpu_device *adev,u32 me, +u32 pipe) +{ +unsigned int q; +int j; + +for (q =0 ; q < adev->gfx.mec.num_queue_per_pipe; q++) { +soc21_grbm_select (adev, me, pipe, q,0 ); +WREG32_SOC15 (GC ,0 , regCP_HQD_ACTIVE,0 ); +if (RREG32_SOC15 (GC ,0 , regCP_HQD_ACTIVE) &1 ) { +WREG32_SOC15 (GC ,0 , regCP_HQD_DEQUEUE_REQUEST,1 ); +for (j =0 ; j < adev->usec_timeout; j++) { +if (!(RREG32_SOC15 (GC ,0 , regCP_HQD_ACTIVE) &1 )) +break ; +udelay (1 ); + } + } + +WREG32_SOC15 (GC ,0 , regCP_HQD_DEQUEUE_REQUEST,0 ); + } +} +static int gfx_v11_0_reset_compute_pipe (struct amdgpu_ring *ring) {struct amdgpu_device *adev = ring->adev; -uint32_t reset_pipe =0 , clean_pipe =0 ; +uint32_t reset_val, clean_val;int r;if (!gfx_v11_pipe_reset_support (adev))
@@ -6888,69 +6911,73 @@ static int gfx_v11_0_reset_compute_pipe(struct amdgpu_ring *ring)mutex_lock (&adev->srbm_mutex);soc21_grbm_select (adev, ring->me, ring->pipe, ring->queue,0 ); - reset_pipe =RREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL); - clean_pipe = reset_pipe; -if (adev->gfx.rs64_enable) { + reset_val =RREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL); + clean_val = reset_val;switch (ring->pipe) {case 0 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE0_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE0_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE0_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE0_RESET ,0 );break ;case 1 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE1_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE1_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE1_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE1_RESET ,0 );break ;case 2 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE2_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE2_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE2_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE2_RESET ,0 );break ;case 3 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE3_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE3_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE3_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE3_RESET ,0 );break ;default :break ; } -WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, reset_pipe); -WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, clean_pipe); +WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, reset_val); +gfx_v11_0_clear_hqds_on_mec_pipe (adev, ring->me, ring->pipe); +soc21_grbm_select (adev, ring->me, ring->pipe, ring->queue,0 ); +WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, clean_val); r = (RREG32_SOC15 (GC ,0 , regCP_MEC_RS64_INSTR_PNTR) <<2 ) -RS64_FW_UC_START_ADDR_LO ; }else { + reset_val =RREG32_SOC15 (GC ,0 , regCP_MEC_CNTL); + clean_val = reset_val; +if (ring->me ==1 ) {switch (ring->pipe) {case 0 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE0_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE0_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME1_PIPE0_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME1_PIPE0_RESET ,0 );break ;case 1 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE1_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE1_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME1_PIPE1_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME1_PIPE1_RESET ,0 );break ;case 2 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE2_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE2_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME1_PIPE2_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME1_PIPE2_RESET ,0 );break ;case 3 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE3_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE3_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME1_PIPE3_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME1_PIPE3_RESET ,0 );break ;default :break ;
@@ -6959,36 +6986,38 @@ static int gfx_v11_0_reset_compute_pipe(struct amdgpu_ring *ring) }else {switch (ring->pipe) {case 0 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE0_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE0_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME2_PIPE0_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME2_PIPE0_RESET ,0 );break ;case 1 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE1_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE1_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME2_PIPE1_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME2_PIPE1_RESET ,0 );break ;case 2 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE2_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE2_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME2_PIPE2_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME2_PIPE2_RESET ,0 );break ;case 3 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE3_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME2_PIPE3_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME2_PIPE3_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME2_PIPE3_RESET ,0 );break ;default :break ; }/* mec2 fw pc: CP:CP_MEC2_INSTR_PNTR */ } -WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, reset_pipe); -WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, clean_pipe); +WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, reset_val); +gfx_v11_0_clear_hqds_on_mec_pipe (adev, ring->me, ring->pipe); +soc21_grbm_select (adev, ring->me, ring->pipe, ring->queue,0 ); +WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, clean_val); r =RREG32 (SOC15_REG_OFFSET (GC ,0 , regCP_MEC1_INSTR_PNTR)); }
@@ -6996,7 +7025,7 @@ static int gfx_v11_0_reset_compute_pipe(struct amdgpu_ring *ring)mutex_unlock (&adev->srbm_mutex);gfx_v11_0_unset_safe_mode (adev,0 ); -dev_info (adev->dev,"The ring %s pipe resets to MEC FW start PC: %s\n" , ring->name, +dev_dbg (adev->dev,"The ring %s pipe resets to MEC FW start PC: %s\n" , ring->name, r ==0 ?"successfully" :"failed" );/*FIXME:Sometimes driver can't cache the MEC firmware start PC correctly, so the pipe * reset status relies on the compute ring test result.
@@ -7016,9 +7045,15 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring, r =amdgpu_mes_reset_legacy_queue (ring->adev, ring, vmid, true,0 );if (r) {dev_warn (adev->dev,"fail(%d) to reset kcq and try pipe reset\n" , r); +amdgpu_gfx_mec_pipe_reset_prepare (adev, ring); r =gfx_v11_0_reset_compute_pipe (ring); -if (r) +if (r) { +amdgpu_gfx_mec_pipe_restart_schedulers (adev, ring->me, ring->pipe, + ring->xcc_id);return r; + } +return amdgpu_gfx_mec_pipe_reset_recover_queues (adev, ring, timedout_fence, + gfx_v11_0_kcq_init_queue); } r =gfx_v11_0_kcq_init_queue (ring, true);
Signature · 1 line
2.49.0
PATCH 3/4 drm/amdgpu/gfx_v12_0: set gfx.rs64_enable from PFP header on GFX12
In reply to Jesse Zhanggfx_v12_0_init_microcode() always loads RS64 CP ucode but never set adev->gfx.rs64_enable, so it stayed false and code that branches on it (e.g. MEC pipe reset) used the legacy CP_MEC_CNTL path incorrectly.
Match GFX11: derive RS64 mode from the PFP firmware header (v2.0) via amdgpu_ucode_hdr_version(). Log at debug when RS64 is enabled.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +7 -0
@@ -602,6 +602,13 @@ static int gfx_v12_0_init_microcode(struct amdgpu_device *adev) "amdgpu/%s_pfp.bin", ucode_prefix);if (err) goto out; + + adev->gfx.rs64_enable =amdgpu_ucode_hdr_version ( + (union amdgpu_firmware_header *) + adev->gfx.pfp_fw->data,2 ,0 ); +if (adev->gfx.rs64_enable) +dev_dbg (adev->dev,"CP RS64 enable\n" ); +amdgpu_gfx_cp_init_microcode (adev,AMDGPU_UCODE_ID_CP_RS64_PFP );amdgpu_gfx_cp_init_microcode (adev,AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK );
Signature · 1 line
2.49.0
Re: [PATCH 3/4] drm/amdgpu/gfx_v12_0: set gfx.rs64_enable from PFP header on GFX12
Quoted 9 lines · Jesse Zhang
gfx_v12_0_init_microcode()always loads RS64 CP ucode but never setadev->gfx.rs64_enable, so it stayed false and code that branches on it (e.g. MEC pipe reset) used the legacyCP_MEC_CNTLpath incorrectly.Match GFX11: derive RS64 mode from the PFP firmware header (v2.0) via
amdgpu_ucode_hdr_version(). Log at debug when RS64 is enabled.Signed-off-by Jesse Zhang <[email protected]>
This can land right away.
Quoted 25 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +7
-1@@ -602,6 +602,13 @@ static int gfx_v12_0_init_microcode(struct amdgpu_device *adev) "amdgpu/%s_pfp.bin", ucode_prefix);if (err) goto out; + + adev->gfx.rs64_enable =amdgpu_ucode_hdr_version ( + (union amdgpu_firmware_header *) + adev->gfx.pfp_fw->data,2 ,0 ); +if (adev->gfx.rs64_enable) +dev_dbg (adev->dev,"CP RS64 enable\n" ); +amdgpu_gfx_cp_init_microcode (adev,AMDGPU_UCODE_ID_CP_RS64_PFP );amdgpu_gfx_cp_init_microcode (adev,AMDGPU_UCODE_ID_CP_RS64_PFP_P0_STACK ); --2.49.0
PATCH 4/4 drm/amdgpu/gfx_v12_0: fix GFX11 MEC pipe reset ordering
In reply to Jesse ZhangHold MEC pipe reset asserted, walk every queue on that (me, pipe) and tear down CP_HQD_ACTIVE / CP_HQD_DEQUEUE_REQUEST via gfx_v11_0_clear_hqds_on_mec_pipe(), then deassert reset. Avoids releasing pipe reset while HQDs may still be active.
Legacy (non-RS64) path: read CP_MEC_CNTL for the reset mask instead of reusing CP_MEC_RS64_CNTL state.
V2:stop the schedulers for all queues on the pipe and then mark the fences with an error
and then make sure to re-enable and test all of the queues after the reset (Alex)
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 119 ++++++++++++++++--------- 1 file changed, 78 insertions(+), 41 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +78 -41
@@ -5309,10 +5309,38 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring,return amdgpu_ring_reset_helper_end (ring, timedout_fence); } +/* +* With MEC pipe reset asserted, clear CP_HQD_ACTIVE / CP_HQD_DEQUEUE_REQUEST for +* every queue on (me, pipe). HQDs must be torn down while pipe reset stays +* asserted; only then clear the pipe reset bit. +* Caller must hold adev->srbm_mutex. +*/ +static void gfx_v12_0_clear_hqds_on_mec_pipe (struct amdgpu_device *adev,u32 me, +u32 pipe) +{ +unsigned int q; +int j; + +for (q =0 ; q < adev->gfx.mec.num_queue_per_pipe; q++) { +soc24_grbm_select (adev, me, pipe, q,0 ); +/* Start from a clean HQD dequeue state before forcing HQD inactive. */ +WREG32_SOC15 (GC ,0 , regCP_HQD_ACTIVE,0 ); +if (RREG32_SOC15 (GC ,0 , regCP_HQD_ACTIVE) &1 ) { +WREG32_SOC15 (GC ,0 , regCP_HQD_DEQUEUE_REQUEST,1 ); +for (j =0 ; j < adev->usec_timeout; j++) { +if (!(RREG32_SOC15 (GC ,0 , regCP_HQD_ACTIVE) &1 )) +break ; +udelay (1 ); + } + } +WREG32_SOC15 (GC ,0 , regCP_HQD_DEQUEUE_REQUEST,0 ); + } +} +static int gfx_v12_0_reset_compute_pipe (struct amdgpu_ring *ring) {struct amdgpu_device *adev = ring->adev; -uint32_t reset_pipe =0 , clean_pipe =0 ; +uint32_t reset_val, clean_val;int r =0 ;if (!gfx_v12_pipe_reset_support (adev))
@@ -5321,74 +5349,77 @@ static int gfx_v12_0_reset_compute_pipe(struct amdgpu_ring *ring)gfx_v12_0_set_safe_mode (adev,0 );mutex_lock (&adev->srbm_mutex);soc24_grbm_select (adev, ring->me, ring->pipe, ring->queue,0 ); - - reset_pipe =RREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL); - clean_pipe = reset_pipe; -if (adev->gfx.rs64_enable) { + reset_val =RREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL); + clean_val = reset_val; +switch (ring->pipe) {case 0 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE0_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE0_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE0_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE0_RESET ,0 );break ;case 1 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE1_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE1_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE1_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE1_RESET ,0 );break ;case 2 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE2_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE2_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE2_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE2_RESET ,0 );break ;case 3 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE3_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_RS64_CNTL , -MEC_PIPE3_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_RS64_CNTL , +MEC_PIPE3_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_RS64_CNTL , +MEC_PIPE3_RESET ,0 );break ;default :break ; } -WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, reset_pipe); -WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, clean_pipe); +WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, reset_val); +gfx_v12_0_clear_hqds_on_mec_pipe (adev, ring->me, ring->pipe); +soc24_grbm_select (adev, ring->me, ring->pipe, ring->queue,0 ); +WREG32_SOC15 (GC ,0 , regCP_MEC_RS64_CNTL, clean_val); r = (RREG32_SOC15 (GC ,0 , regCP_MEC_RS64_INSTR_PNTR) <<2 ) -RS64_FW_UC_START_ADDR_LO ; }else { + reset_val =RREG32_SOC15 (GC ,0 , regCP_MEC_CNTL); + clean_val = reset_val; +switch (ring->pipe) {case 0 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE0_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE0_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME1_PIPE0_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME1_PIPE0_RESET ,0 );break ;case 1 : - reset_pipe =REG_SET_FIELD (reset_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE1_RESET ,1 ); - clean_pipe =REG_SET_FIELD (clean_pipe,CP_MEC_CNTL , -MEC_ME1_PIPE1_RESET ,0 ); + reset_val =REG_SET_FIELD (reset_val,CP_MEC_CNTL , +MEC_ME1_PIPE1_RESET ,1 ); + clean_val =REG_SET_FIELD (clean_val,CP_MEC_CNTL , +MEC_ME1_PIPE1_RESET ,0 );break ;default : -break ; +break ; } -WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, reset_pipe); -WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, clean_pipe); -/* Doesn't find the F32 MEC instruction pointer register, and suppose -* the driver won't run into the F32 mode. -*/ + +WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, reset_val); +gfx_v12_0_clear_hqds_on_mec_pipe (adev, ring->me, ring->pipe); +soc24_grbm_select (adev, ring->me, ring->pipe, ring->queue,0 ); +WREG32_SOC15 (GC ,0 , regCP_MEC_CNTL, clean_val); }soc24_grbm_select (adev,0 ,0 ,0 ,0 );mutex_unlock (&adev->srbm_mutex);gfx_v12_0_unset_safe_mode (adev,0 ); -dev_info (adev->dev,"The ring %s pipe resets: %s\n" , ring->name, - r ==0 ?"successfully" :"failed" ); -/* Need the ring test to verify the pipe reset result.*/ +dev_dbg (adev->dev,"The ring %s pipe resets to MEC FW start PC: %s\n" , ring->name, + r ==0 ?"successfully" :"failed" );return 0 ; }
@@ -5404,9 +5435,15 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring, r =amdgpu_mes_reset_legacy_queue (ring->adev, ring, vmid, true,0 );if (r) {dev_warn (adev->dev,"fail(%d) to reset kcq and try pipe reset\n" , r); +amdgpu_gfx_mec_pipe_reset_prepare (adev, ring); r =gfx_v12_0_reset_compute_pipe (ring); -if (r) +if (r) { +amdgpu_gfx_mec_pipe_restart_schedulers (adev, ring->me, ring->pipe, + ring->xcc_id);return r; + } +return amdgpu_gfx_mec_pipe_reset_recover_queues (adev, ring, timedout_fence, + gfx_v12_0_kcq_init_queue); } r =gfx_v12_0_kcq_init_queue (ring, true);
Signature · 1 line
2.49.0
Quoted 112 lines · Jesse Zhang
Add IP-agnostic helpers to coordinate a MEC pipe reset across all KCQs on the same (me, pipe): prepare (back up siblings, stop schedulers, stop KFD),
restart_schedulers, andrecover_queues(re-init/remap KCQs and runamdgpu_ring_reset_helper_endon each — guilty gets the timeout fence, siblings get a synthetic context so collateral work is reemitted).Suggested-by Manu Rastogi <[email protected]>Suggested-by Alex Deucher <[email protected]>Signed-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 115 ++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 11 +++ 2 files changed, 126 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +89
-0@@ -69,6 +69,121 @@ void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit, } +static bool amdgpu_gfx_ring_on_mec_pipe (struct amdgpu_ring *ring,u32 me,u32 pipe) +{ +if (!ring || !ring->funcs || ring->funcs->type !=AMDGPU_RING_TYPE_COMPUTE ) +return false; +if (ring->no_scheduler) +return false; + +return ring->me == me && ring->pipe == pipe; +} + +static unsigned int amdgpu_gfx_mec_pipe_compute_ring_base (struct amdgpu_device *adev, +u32 xcc_id) +{ +int num_xcc = adev->gfx.xcc_mask ?NUM_XCC (adev->gfx.xcc_mask) :1 ; + +if (num_xcc <=1 ) +return 0 ; +return xcc_id * adev->gfx.num_compute_rings; +} + +void amdgpu_gfx_mec_pipe_reset_prepare (struct amdgpu_device *adev, +struct amdgpu_ring *guilty) +{ +struct amdgpu_ring *r; +unsigned int j, base; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, guilty->xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; +if (r != guilty) +amdgpu_ring_backup_unprocessed_commands (r,NULL ); +if (amdgpu_ring_sched_ready (r)) +drm_sched_wqueue_stop (&r->sched); + } + +if (adev->kfd.init_complete) +amdgpu_amdkfd_stop_sched (adev, guilty->xcc_id); +} + +void amdgpu_gfx_mec_pipe_restart_schedulers (struct amdgpu_device *adev, +u32 me,u32 pipe,u32 xcc_id) +{ +struct amdgpu_ring *r; +unsigned int j, base; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, me, pipe)) +continue ; +if (amdgpu_ring_sched_ready (r)) +drm_sched_wqueue_start (&r->sched); + } + +if (adev->kfd.init_complete) +amdgpu_amdkfd_start_sched (adev, xcc_id); +} + +int amdgpu_gfx_mec_pipe_reset_recover_queues (struct amdgpu_device *adev, +struct amdgpu_ring *guilty, +struct amdgpu_fence *timedout_fence, +amdgpu_gfx_kcq_init_queue_t kcq_init) +{ +struct amdgpu_fence collateral_reemit = {}; +struct amdgpu_ring *r; +unsigned int j, base; +int err =0 ; + +if (!timedout_fence) +return -EINVAL ; + + collateral_reemit.context = (u64)-1 ; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, guilty->xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; + + err =kcq_init (r, true); +if (err) + goto err_sched; + err =amdgpu_mes_map_legacy_queue (adev, r,0 ); +if (err) + goto err_sched; + } +
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit, · line 170
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +10
-0+amdgpu_gfx_mec_pipe_restart_schedulers (adev, guilty->me, guilty->pipe, + guilty->xcc_id); + +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; + + err =amdgpu_ring_reset_helper_end ( + r, r == guilty ? timedout_fence : &collateral_reemit);
I don't think this will work. We don't actually know which job hung the pipe so we can't resubmit all of the jobs. We either need to discard all jobs (amdgpu_fence_driver_force_completion()) or just the ones associated with the context from the earliest job on the queue. Rather than stopping the jobs and doing all of the resets here, it might be cleaner to have a worker thread which schedules a call to drm_sched_fault() for all of the affected queues. Then each queue reset will run sequentially. You need to be careful however since you could get into a loop where each reset ends up scheduling more resets if we end up falling back to the pipe reset handler for some reason.
Alex
Quoted 44 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +16
-0+if (err) { +dev_err (adev->dev, +"ring %s failed recover after MEC pipe reset (%d)\n" , + r->name, err); +return err; + } + } + +return 0 ; + +err_sched: +amdgpu_gfx_mec_pipe_restart_schedulers (adev, guilty->me, guilty->pipe, + guilty->xcc_id); +return err; +} +bool amdgpu_gfx_is_mec_queue_enabled (struct amdgpu_device *adev,int xcc_id,int mec,int pipe,int queue) {drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +11
-1@@ -603,6 +603,17 @@ int amdgpu_gfx_mec_queue_to_bit(struct amdgpu_device *adev, int mec, int pipe, int queue);void amdgpu_queue_mask_bit_to_mec_queue (struct amdgpu_device *adev,int bit,int *mec,int *pipe,int *queue); + +typedef int (*amdgpu_gfx_kcq_init_queue_t )(struct amdgpu_ring *ring,bool clear); + +void amdgpu_gfx_mec_pipe_reset_prepare (struct amdgpu_device *adev, +struct amdgpu_ring *guilty); +void amdgpu_gfx_mec_pipe_restart_schedulers (struct amdgpu_device *adev, +u32 me,u32 pipe,u32 xcc_id); +int amdgpu_gfx_mec_pipe_reset_recover_queues ( +struct amdgpu_device *adev,struct amdgpu_ring *guilty, +struct amdgpu_fence *timedout_fence, +amdgpu_gfx_kcq_init_queue_t kcq_init);bool amdgpu_gfx_is_mec_queue_enabled (struct amdgpu_device *adev,int xcc_id,int mec,int pipe,int queue); bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev, --2.49.0
AMD General
Hi Alex,
Quoted 130 lines
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 8, 2026 9:42 PM
To: Zhang, Jesse(Jie) <[email protected]>
Cc: [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Rastogi, Manu <[email protected]>
Subject: Re: [PATCH 1/4] drm/amdgpu: add MEC pipe reset helpersQuoted 22 lines · Jesse Zhang
Add IP-agnostic helpers to coordinate a MEC pipe reset across all KCQs on the same (me, pipe): prepare (back up siblings, stop schedulers, stop KFD),
restart_schedulers, andrecover_queues(re-init/remap KCQs and runamdgpu_ring_reset_helper_endon each — guilty gets the timeout fence, siblings get a synthetic context so collateral work is reemitted).Suggested-by Manu Rastogi <[email protected]>Suggested-by Alex Deucher <[email protected]>Signed-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 115 ++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 11 +++ 2 files changed, 126 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_queue_mask_bit_to_mec_queue(struct · line 75
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-0@@ -69,6 +69,121 @@ void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit, } +static bool amdgpu_gfx_ring_on_mec_pipe(struct amdgpu_ring *ring, u32 +me, u32 pipe) { + if (!ring || !ring->funcs || ring->funcs->type !=
AMDGPU_RING_TYPE_COMPUTE)drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit,
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +7
-0+return false; +if (ring->no_scheduler) +return false; + +return ring->me == me && ring->pipe == pipe; } + +static unsigned int amdgpu_gfx_mec_pipe_compute_ring_base(struct
amdgpu_device*adev,Quoted 82 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +82
-0+ u32 xcc_id) { +int num_xcc = adev->gfx.xcc_mask ?NUM_XCC (adev->gfx.xcc_mask) +:1 ; + +if (num_xcc <=1 ) +return 0 ; +return xcc_id * adev->gfx.num_compute_rings; } + +void amdgpu_gfx_mec_pipe_reset_prepare (struct amdgpu_device *adev, +struct amdgpu_ring *guilty) { +struct amdgpu_ring *r; +unsigned int j, base; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, guilty->xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; +if (r != guilty) +amdgpu_ring_backup_unprocessed_commands (r,NULL ); +if (amdgpu_ring_sched_ready (r)) +drm_sched_wqueue_stop (&r->sched); + } + +if (adev->kfd.init_complete) +amdgpu_amdkfd_stop_sched (adev, guilty->xcc_id); } + +void amdgpu_gfx_mec_pipe_restart_schedulers (struct amdgpu_device *adev, +u32 me,u32 pipe,u32 +xcc_id) { +struct amdgpu_ring *r; +unsigned int j, base; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, me, pipe)) +continue ; +if (amdgpu_ring_sched_ready (r)) +drm_sched_wqueue_start (&r->sched); + } + +if (adev->kfd.init_complete) +amdgpu_amdkfd_start_sched (adev, xcc_id); } + +int amdgpu_gfx_mec_pipe_reset_recover_queues (struct amdgpu_device *adev, +struct amdgpu_ring *guilty, +struct amdgpu_fence *timedout_fence, + +amdgpu_gfx_kcq_init_queue_t kcq_init) { +struct amdgpu_fence collateral_reemit = {}; +struct amdgpu_ring *r; +unsigned int j, base; +int err =0 ; + +if (!timedout_fence) +return -EINVAL ; + + collateral_reemit.context = (u64)-1 ; + + base =amdgpu_gfx_mec_pipe_compute_ring_base (adev, guilty->xcc_id); +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; + + err =kcq_init (r, true); +if (err) + goto err_sched; + err =amdgpu_mes_map_legacy_queue (adev, r,0 ); +if (err) + goto err_sched; + } + +amdgpu_gfx_mec_pipe_restart_schedulers (adev, guilty->me, guilty->pipe, + guilty->xcc_id); + +for (j =0 ; j < adev->gfx.num_compute_rings; j++) { + r = &adev->gfx.compute_ring[base + j]; +if (!amdgpu_gfx_ring_on_mec_pipe (r, guilty->me, guilty->pipe)) +continue ; +
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_queue_mask_bit_to_mec_queue(struct · line 167
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-0+ err =amdgpu_ring_reset_helper_end ( + r, r == guilty ? timedout_fence : + &collateral_reemit);I don't think this will work. We don't actually know which job hung the pipe so we can't resubmit all of the jobs. We either need to discard all jobs (
amdgpu_fence_driver_force_completion()) or just the ones associated with the context from the earliest job on the queue.
Agreed.
Quoted 6 lines
Rather than stopping the jobs and doing all of the resets here, it might be cleaner to have a worker thread which schedules a call to
drm_sched_fault()for all of the affected queues. Then each queue reset will run sequentially. You need to be careful however since you could get into a loop where each reset ends up scheduling more resets if we end up falling back to the pipe reset handler for some reason.
do you mean that the DRM scheduler doesn't need to be stopped before the pipeline reset, and it doesn't need to be restarted after the pipeline reset. just need to call the drm_sched_fault() for the other queues on the pipe after the pipe reset, right?
How about this? Simply remove the patch, just like the pipe reset in gfx_v9_4_3_reset_kcq.
The pipe reset follows the same sequence without drm_sched_fault after reset。 If there are running jobs in the affected queues, those jobs should automatically time out. This will then trigger the queues/pipelines in sequence
Thanks
Jesse
Quoted 52 lines
Alex
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h int amdgpu_gfx_mec_queue_to_bit(struct
Quoted 24 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +16
-0+if (err) { +dev_err (adev->dev, +"ring %s failed recover after MEC pipe reset (%d)\n" , + r->name, err); +return err; + } + } + +return 0 ; + +err_sched: +amdgpu_gfx_mec_pipe_restart_schedulers (adev, guilty->me, guilty->pipe, + guilty->xcc_id); +return err; +} + bool amdgpu_gfx_is_mec_queue_enabled(struct amdgpu_device *adev, int xcc_id, int mec, int pipe,int queue) { diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.hb/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index77050f9884f2..38b317b91bbe100644drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +0
-0@@ -603,6 +603,17 @@ int amdgpu_gfx_mec_queue_to_bit(struct
amdgpu_device*adev, int mec,Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +3
-0int pipe, int queue); voidamdgpu_queue_mask_bit_to_mec_queue (struct amdgpu_device *adev,int bit,int *mec,int *pipe,int *queue); + +typedef int (*amdgpu_gfx_kcq_init_queue_t )(struct amdgpu_ring *ring, +bool clear);drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h int amdgpu_gfx_mec_queue_to_bit(struct amdgpu_device *adev, int mec,
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +9
-0+ +void amdgpu_gfx_mec_pipe_reset_prepare (struct amdgpu_device *adev, +struct amdgpu_ring *guilty); +void amdgpu_gfx_mec_pipe_restart_schedulers (struct amdgpu_device *adev, +u32 me,u32 pipe,u32 +xcc_id);int amdgpu_gfx_mec_pipe_reset_recover_queues ( +struct amdgpu_device *adev,struct amdgpu_ring *guilty, +struct amdgpu_fence *timedout_fence, +amdgpu_gfx_kcq_init_queue_t kcq_init); bool amdgpu_gfx_is_mec_queue_enabled(struct amdgpu_device *adev, int
xcc_id,Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +0
-0int mec, int pipe, int queue);bool amdgpu_gfx_is_high_priority_compute_queue(struct
amdgpu_device*adev,
--
2.49.0