From 65a2224996bc9a05f2bd4dfdd8facab913248821 Mon Sep 17 00:00:00 2001 From: Jesse Zhang Date: Fri, 18 Sep 2026 17:17:45 +0800 Subject: [PATCH] drm/amdgpu/gfx: add a gfx ME pipe reset capability helper Use gfx_supported_reset's PER_PIPE bit to report GFX pipe reset support through a shared helper. Signed-off-by: Jesse Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c index 3885ce346eda..1cd6eb4f4750 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -2381,6 +2381,16 @@ static void amdgpu_gfx_reset_stop_compute_scheds(struct amdgpu_device *adev, } } +bool amdgpu_gfx_me_pipe_reset_supported(struct amdgpu_device *adev) +{ + if (!!(adev->gfx.gfx_supported_reset & AMDGPU_RESET_TYPE_PER_PIPE)) + return true; + else + dev_warn_once(adev->dev, "Please use the latest ME version to see whether support pipe reset\n"); + + return false; +} + /* Caller holds reset_mutex and attempted MES suspend before HQD lookup. */ void amdgpu_gfx_pipe_reset_prepare(struct amdgpu_device *adev, struct amdgpu_ring *guilty_ring, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h index 855651f0c930..5939e1fb3b24 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h @@ -707,6 +707,7 @@ struct amdgpu_gfx_pipe_reset_ctx { unsigned long replay_mask; }; +bool amdgpu_gfx_me_pipe_reset_supported(struct amdgpu_device *adev); void amdgpu_gfx_pipe_reset_prepare(struct amdgpu_device *adev, struct amdgpu_ring *guilty_ring, u32 me, u32 pipe,