All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 09/13] drm/amdgpu: add get_gfx_shadow_info callback for gfx11
Date: Thu, 30 Mar 2023 15:17:46 -0400	[thread overview]
Message-ID: <20230330191750.1134210-10-alexander.deucher@amd.com> (raw)
In-Reply-To: <20230330191750.1134210-1-alexander.deucher@amd.com>

Used to get the size and alignment requirements for
the gfx shadow buffer for preemption.

v2: use FW version check to determine whether to
    return a valid size here
    return an error if not supported (Alex)
v3: drop GDS (Alex)
v4: make amdgpu_gfx_shadow_info mandatory (Alex)

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 1fc1e941f7df..7a5da13cffa0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -822,6 +822,27 @@ static void gfx_v11_0_select_me_pipe_q(struct amdgpu_device *adev,
 	soc21_grbm_select(adev, me, pipe, q, vm);
 }
 
+/* all sizes are in bytes */
+#define MQD_SHADOW_BASE_SIZE      73728
+#define MQD_SHADOW_BASE_ALIGNMENT 256
+#define MQD_FWWORKAREA_SIZE       484
+#define MQD_FWWORKAREA_ALIGNMENT  256
+
+static int gfx_v11_0_get_gfx_shadow_info(struct amdgpu_device *adev,
+					 struct amdgpu_gfx_shadow_info *shadow_info)
+{
+	if (adev->gfx.cp_gfx_shadow) {
+		shadow_info->shadow_size = MQD_SHADOW_BASE_SIZE;
+		shadow_info->shadow_alignment = MQD_SHADOW_BASE_ALIGNMENT;
+		shadow_info->csa_size = MQD_FWWORKAREA_SIZE;
+		shadow_info->csa_alignment = MQD_FWWORKAREA_ALIGNMENT;
+		return 0;
+	} else {
+		memset(shadow_info, 0, sizeof(struct amdgpu_gfx_shadow_info));
+		return -ENOTSUPP;
+	}
+}
+
 static const struct amdgpu_gfx_funcs gfx_v11_0_gfx_funcs = {
 	.get_gpu_clock_counter = &gfx_v11_0_get_gpu_clock_counter,
 	.select_se_sh = &gfx_v11_0_select_se_sh,
@@ -830,6 +851,7 @@ static const struct amdgpu_gfx_funcs gfx_v11_0_gfx_funcs = {
 	.read_wave_vgprs = &gfx_v11_0_read_wave_vgprs,
 	.select_me_pipe_q = &gfx_v11_0_select_me_pipe_q,
 	.update_perfmon_mgcg = &gfx_v11_0_update_perf_clk,
+	.get_gfx_shadow_info = &gfx_v11_0_get_gfx_shadow_info,
 };
 
 static int gfx_v11_0_gpu_early_init(struct amdgpu_device *adev)
-- 
2.39.2


  parent reply	other threads:[~2023-03-30 19:18 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 19:17 [PATCH V4 00/13] Enable FW assisted shadowing for GFX11 Alex Deucher
2023-03-30 19:17 ` [PATCH 01/13] drm/amdgpu/gfx11: add FW version check for new CP GFX shadow feature Alex Deucher
2023-03-30 19:17 ` [PATCH 02/13] drm/amdgpu/gfx11: check the CP FW version CP GFX shadow support Alex Deucher
2023-03-31  6:34   ` Christian König
2023-03-31 19:18     ` Alex Deucher
2023-03-30 19:17 ` [PATCH 03/13] drm/amdgpu/UAPI: add new CS chunk for GFX shadow buffers Alex Deucher
2023-04-06  7:36   ` Marek Olšák
2023-04-06  9:09     ` Christian König
2023-04-06  9:43       ` Marek Olšák
2023-04-06 10:31         ` Christian König
2023-04-06 15:01           ` Marek Olšák
2023-04-09 15:21             ` Christian König
2023-04-13  9:21               ` Marek Olšák
2023-04-13 11:32                 ` Christian König
2023-04-13 12:26                   ` Alex Deucher
2023-04-13 15:54                     ` Christian König
2023-04-13 16:56                       ` Alex Deucher
2023-04-13 18:23                         ` Marek Olšák
2023-04-13 18:58                           ` Christian König
2023-03-30 19:17 ` [PATCH 04/13] drm/amdgpu: add gfx shadow CS IOCTL support Alex Deucher
2023-03-31  6:33   ` Christian König
2023-03-30 19:17 ` [PATCH 05/13] drm/amdgpu: add gfx11 emit shadow callback Alex Deucher
2023-03-30 19:17 ` [PATCH 06/13] drm/amdgpu: don't require a job for cond_exec and shadow Alex Deucher
2023-03-30 19:17 ` [PATCH 07/13] drm/amdgpu: add UAPI to query GFX shadow sizes Alex Deucher
2023-03-30 19:17 ` [PATCH 08/13] drm/amdgpu: add gfx shadow callback Alex Deucher
2023-03-30 19:17 ` Alex Deucher [this message]
2023-04-19 22:11   ` [PATCH 09/13] drm/amdgpu: add get_gfx_shadow_info callback for gfx11 Alex Deucher
2023-03-30 19:17 ` [PATCH 10/13] drm/amdgpu: add support for new GFX shadow size query Alex Deucher
2023-04-19 22:12   ` Alex Deucher
2023-03-30 19:17 ` [PATCH 11/13] drm/amdgpu: bump driver version number for CP GFX shadow Alex Deucher
2023-04-19 22:12   ` Alex Deucher
2023-03-30 19:17 ` [PATCH 12/13] drm/amdgpu: track MQD size for gfx and compute Alex Deucher
2023-03-30 19:17 ` [PATCH 13/13] drm/amdgpu: add debugfs interface for reading MQDs Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2023-03-29 15:25 [PATCH V3 00/13] Enable FW assisted shadowing for GFX11 Alex Deucher
2023-03-29 15:25 ` [PATCH 09/13] drm/amdgpu: add get_gfx_shadow_info callback for gfx11 Alex Deucher
2023-03-30  6:16   ` Christian König
2023-03-30 18:48     ` Alex Deucher
2023-03-23 21:40 [PATCH V3 00/13] Enable FW assisted shadowing for GFX11 Alex Deucher
2023-03-23 21:40 ` [PATCH 09/13] drm/amdgpu: add get_gfx_shadow_info callback for gfx11 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=20230330191750.1134210-10-alexander.deucher@amd.com \
    --to=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.