drm/amdgpu: store whether to use MMIO or MES for reset

Separate settings for gfx (ME) and compute (MEC).
Use this rather than explicitly specifying it.

Reviewed-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Deucher 2026-05-19 17:36:09 -04:00
parent 9b8a22c396
commit 0268259988
3 changed files with 12 additions and 4 deletions

View File

@ -116,6 +116,7 @@ struct amdgpu_mec {
u32 num_pipe_per_mec;
u32 num_queue_per_pipe;
void *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS * AMDGPU_MAX_GC_INSTANCES];
bool use_mmio_for_reset;
};
struct amdgpu_mec_bitmap {
@ -401,6 +402,7 @@ struct amdgpu_me {
uint32_t num_pipe_per_me;
uint32_t num_queue_per_pipe;
void *mqd_backup[AMDGPU_MAX_GFX_RINGS];
bool use_mmio_for_reset;
/* These are the resources for which amdgpu takes ownership */
DECLARE_BITMAP(queue_bitmap, AMDGPU_MAX_GFX_QUEUES);

View File

@ -1911,6 +1911,9 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
if (r)
return r;
adev->gfx.me.use_mmio_for_reset = false;
adev->gfx.mec.use_mmio_for_reset = true;
return 0;
}
@ -6819,7 +6822,7 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring,
struct amdgpu_fence *timedout_fence)
{
struct amdgpu_device *adev = ring->adev;
bool use_mmio = false;
bool use_mmio = adev->gfx.me.use_mmio_for_reset;
int r;
amdgpu_ring_reset_helper_begin(ring, timedout_fence);
@ -6850,7 +6853,7 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring,
struct amdgpu_fence *timedout_fence)
{
struct amdgpu_device *adev = ring->adev;
bool use_mmio = true;
bool use_mmio = adev->gfx.mec.use_mmio_for_reset;
int r = 0;
amdgpu_ring_reset_helper_begin(ring, timedout_fence);

View File

@ -1603,6 +1603,9 @@ static int gfx_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
if (r)
return r;
adev->gfx.me.use_mmio_for_reset = false;
adev->gfx.mec.use_mmio_for_reset = true;
return 0;
}
@ -5245,7 +5248,7 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring,
struct amdgpu_fence *timedout_fence)
{
struct amdgpu_device *adev = ring->adev;
bool use_mmio = false;
bool use_mmio = adev->gfx.me.use_mmio_for_reset;
int r;
amdgpu_ring_reset_helper_begin(ring, timedout_fence);
@ -5276,7 +5279,7 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring,
struct amdgpu_fence *timedout_fence)
{
struct amdgpu_device *adev = ring->adev;
bool use_mmio = true;
bool use_mmio = adev->gfx.mec.use_mmio_for_reset;
int r;
amdgpu_ring_reset_helper_begin(ring, timedout_fence);