From: Arvind Yadav <Arvind.Yadav@amd.com>
To: <Christian.Koenig@amd.com>, <alexander.deucher@amd.com>,
<shashank.sharma@amd.com>, <Xinhui.Pan@amd.com>,
<airlied@gmail.com>, <daniel@ffwll.ch>,
<amd-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Cc: Arvind Yadav <Arvind.Yadav@amd.com>,
Christian Koenig <christian.koenig@amd.com>
Subject: [PATCH 2/3] drm/amdgpu: Switch on/off GPU workload profile
Date: Mon, 14 Aug 2023 13:04:37 +0530 [thread overview]
Message-ID: <20230814073438.10682-3-Arvind.Yadav@amd.com> (raw)
In-Reply-To: <20230814073438.10682-1-Arvind.Yadav@amd.com>
This patch is to switch the GPU workload profile based
on the submitted job. The workload profile is reset to
default when the job is done.
Cc: Shashank Sharma <shashank.sharma@amd.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Arvind Yadav <Arvind.Yadav@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index c3d9d75143f4..8457d2468fd8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -176,6 +176,9 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
static void amdgpu_job_free_cb(struct drm_sched_job *s_job)
{
struct amdgpu_job *job = to_amdgpu_job(s_job);
+ struct amdgpu_ring *ring = to_amdgpu_ring(s_job->sched);
+
+ amdgpu_put_workload_profile(ring->adev, ring->funcs->type);
drm_sched_job_cleanup(s_job);
@@ -295,6 +298,8 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job)
DRM_ERROR("Error scheduling IBs (%d)\n", r);
}
+ amdgpu_set_workload_profile(ring->adev, ring->funcs->type);
+
job->job_run_counter++;
amdgpu_job_free_resources(job);
--
2.34.1
next prev parent reply other threads:[~2023-08-14 7:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 7:34 [PATCH 0/3] GPU workload hints for better performance Arvind Yadav
2023-08-14 7:34 ` [PATCH 1/3] drm/amdgpu: Add new api to switch on/off power profile mode Arvind Yadav
2023-08-14 12:05 ` Christian König
2023-08-14 12:52 ` Yadav, Arvind
2023-08-14 14:33 ` Alex Deucher
2023-08-17 7:51 ` Yadav, Arvind
2023-08-14 14:58 ` Shashank Sharma
2023-08-17 7:58 ` Yadav, Arvind
2023-08-14 7:34 ` Arvind Yadav [this message]
2023-08-14 7:34 ` [PATCH 3/3] Revert "drm/amd/amdgpu: switch on/off vcn power profile mode" Arvind Yadav
2023-08-14 15:20 ` Alex Deucher
2023-08-14 16:05 ` Shashank Sharma
2023-08-17 7:55 ` Yadav, Arvind
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=20230814073438.10682-3-Arvind.Yadav@amd.com \
--to=arvind.yadav@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shashank.sharma@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