mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
drm/amdgpu/sdma: Introduce is_guilty callbacks for sdma GFX and PAGE rings
This patch introduces the `is_guilty` callbacks for the GFX and PAGE rings. These callbacks check if a ring is guilty of causing a timeout or error. Suggested-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
4d3c4f4f7f
commit
0ad649321a
|
|
@ -1606,6 +1606,34 @@ static int sdma_v4_4_2_soft_reset(struct amdgpu_ip_block *ip_block)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool sdma_v4_4_2_is_queue_selected(struct amdgpu_device *adev, uint32_t instance_id, bool is_page_queue)
|
||||
{
|
||||
uint32_t reg_offset = is_page_queue ? regSDMA_PAGE_CONTEXT_STATUS : regSDMA_GFX_CONTEXT_STATUS;
|
||||
uint32_t context_status = RREG32(sdma_v4_4_2_get_reg_offset(adev, instance_id, reg_offset));
|
||||
|
||||
/* Check if the SELECTED bit is set */
|
||||
return (context_status & SDMA_GFX_CONTEXT_STATUS__SELECTED_MASK) != 0;
|
||||
}
|
||||
|
||||
static bool sdma_v4_4_2_ring_is_guilty(struct amdgpu_ring *ring)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
uint32_t instance_id = ring->me;
|
||||
|
||||
return sdma_v4_4_2_is_queue_selected(adev, instance_id, false);
|
||||
}
|
||||
|
||||
static bool sdma_v4_4_2_page_ring_is_guilty(struct amdgpu_ring *ring)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
uint32_t instance_id = ring->me;
|
||||
|
||||
if (!adev->sdma.has_page_queue)
|
||||
return false;
|
||||
|
||||
return sdma_v4_4_2_is_queue_selected(adev, instance_id, true);
|
||||
}
|
||||
|
||||
static int sdma_v4_4_2_reset_queue(struct amdgpu_ring *ring, unsigned int vmid)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
|
|
@ -2055,6 +2083,7 @@ static const struct amdgpu_ring_funcs sdma_v4_4_2_ring_funcs = {
|
|||
.emit_reg_wait = sdma_v4_4_2_ring_emit_reg_wait,
|
||||
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
|
||||
.reset = sdma_v4_4_2_reset_queue,
|
||||
.is_guilty = sdma_v4_4_2_ring_is_guilty,
|
||||
};
|
||||
|
||||
static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
|
||||
|
|
@ -2086,6 +2115,7 @@ static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
|
|||
.emit_wreg = sdma_v4_4_2_ring_emit_wreg,
|
||||
.emit_reg_wait = sdma_v4_4_2_ring_emit_reg_wait,
|
||||
.emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
|
||||
.is_guilty = sdma_v4_4_2_page_ring_is_guilty,
|
||||
};
|
||||
|
||||
static void sdma_v4_4_2_set_ring_funcs(struct amdgpu_device *adev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user