From: Alex Deucher <alexdeucher@gmail.com>
To: "Jesse.Zhang" <Jesse.Zhang@amd.com>
Cc: amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com,
Christian Koenig <christian.koenig@amd.com>
Subject: Re: [v7 03/11] drm/amd/amdgpu: Implement MES suspend/resume gang functionality for v12
Date: Fri, 8 Aug 2025 15:47:30 -0400 [thread overview]
Message-ID: <CADnq5_Pi-UD1VgRTKD9f5ZggO-bMLfzaRBbM++F9ZRvJF9vF_g@mail.gmail.com> (raw)
In-Reply-To: <20250806022816.1050823-3-Jesse.Zhang@amd.com>
On Tue, Aug 5, 2025 at 10:54 PM Jesse.Zhang <Jesse.Zhang@amd.com> wrote:
>
> This commit implements the actual MES (Micro Engine Scheduler) suspend
> and resume gang operations for version 12 hardware. Previously these
> functions were just stubs returning success.
>
> v2: Always use AMDGPU_MES_SCHED_PIPE
>
What about the MES implementation for v11?
Alex
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 32 ++++++++++++++++++++++++--
> 1 file changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> index 6b222630f3fa..24c61239b25d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> @@ -567,13 +567,41 @@ static int mes_v12_0_unmap_legacy_queue(struct amdgpu_mes *mes,
> static int mes_v12_0_suspend_gang(struct amdgpu_mes *mes,
> struct mes_suspend_gang_input *input)
> {
> - return 0;
> + union MESAPI__SUSPEND mes_suspend_gang_pkt;
> +
> + memset(&mes_suspend_gang_pkt, 0, sizeof(mes_suspend_gang_pkt));
> +
> + mes_suspend_gang_pkt.header.type = MES_API_TYPE_SCHEDULER;
> + mes_suspend_gang_pkt.header.opcode = MES_SCH_API_SUSPEND;
> + mes_suspend_gang_pkt.header.dwsize = API_FRAME_SIZE_IN_DWORDS;
> +
> + mes_suspend_gang_pkt.suspend_all_gangs = input->suspend_all_gangs;
> + mes_suspend_gang_pkt.gang_context_addr = input->gang_context_addr;
> + mes_suspend_gang_pkt.suspend_fence_addr = input->suspend_fence_addr;
> + mes_suspend_gang_pkt.suspend_fence_value = input->suspend_fence_value;
> +
> + return mes_v12_0_submit_pkt_and_poll_completion(mes, AMDGPU_MES_SCHED_PIPE,
> + &mes_suspend_gang_pkt, sizeof(mes_suspend_gang_pkt),
> + offsetof(union MESAPI__SUSPEND, api_status));
> }
>
> static int mes_v12_0_resume_gang(struct amdgpu_mes *mes,
> struct mes_resume_gang_input *input)
> {
> - return 0;
> + union MESAPI__RESUME mes_resume_gang_pkt;
> +
> + memset(&mes_resume_gang_pkt, 0, sizeof(mes_resume_gang_pkt));
> +
> + mes_resume_gang_pkt.header.type = MES_API_TYPE_SCHEDULER;
> + mes_resume_gang_pkt.header.opcode = MES_SCH_API_RESUME;
> + mes_resume_gang_pkt.header.dwsize = API_FRAME_SIZE_IN_DWORDS;
> +
> + mes_resume_gang_pkt.resume_all_gangs = input->resume_all_gangs;
> + mes_resume_gang_pkt.gang_context_addr = input->gang_context_addr;
> +
> + return mes_v12_0_submit_pkt_and_poll_completion(mes, AMDGPU_MES_SCHED_PIPE,
> + &mes_resume_gang_pkt, sizeof(mes_resume_gang_pkt),
> + offsetof(union MESAPI__RESUME, api_status));
> }
>
> static int mes_v12_0_query_sched_status(struct amdgpu_mes *mes, int pipe)
> --
> 2.49.0
>
next prev parent reply other threads:[~2025-08-08 19:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 2:24 [v7 01/11] drm/amdgpu: Add preempt and restore callbacks to userq funcs Jesse.Zhang
2025-08-06 2:24 ` [v7 02/11] drm/amdgpu: adjust MES API used for suspend and resume Jesse.Zhang
2025-08-06 2:24 ` [v7 03/11] drm/amd/amdgpu: Implement MES suspend/resume gang functionality for v12 Jesse.Zhang
2025-08-08 19:47 ` Alex Deucher [this message]
2025-08-11 0:32 ` Zhang, Jesse(Jie)
2025-08-06 2:24 ` [v7 04/11] drm/amdgpu: Add helper functions for user queue preemption and restoration Jesse.Zhang
2025-08-08 19:49 ` Alex Deucher
2025-08-06 2:24 ` [v7 05/11] drm/amdgpu/mes: add front end for detect and reset hung queue Jesse.Zhang
2025-08-06 2:24 ` [v7 06/11] drm/amdgpu/mes11: implement detect and reset callback Jesse.Zhang
2025-08-06 2:24 ` [v7 07/11] drm/amdgpu/mes12: " Jesse.Zhang
2025-08-06 2:24 ` [v7 08/11] drm/amdgpu/userq: add a " Jesse.Zhang
2025-08-08 19:53 ` Alex Deucher
2025-08-06 2:24 ` [v7 09/11] drm/amdgpu: add user queue reset source Jesse.Zhang
2025-08-06 2:24 ` [v7 10/11] drm/amdgpu/userq: add force completion helpers Jesse.Zhang
2025-08-06 2:24 ` [v7 11/11] drm/amdgpu: Implement user queue reset handling and recovery Jesse.Zhang
2025-08-08 19:58 ` Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADnq5_Pi-UD1VgRTKD9f5ZggO-bMLfzaRBbM++F9ZRvJF9vF_g@mail.gmail.com \
--to=alexdeucher@gmail.com \
--cc=Alexander.Deucher@amd.com \
--cc=Jesse.Zhang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).