From: Shashank Sharma <shashank.sharma@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: "Arvind Yadav" <arvind.yadav@amd.com>,
"Shashank Sharma" <shashank.sharma@amd.com>,
"Christian König" <Christian.Koenig@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>
Subject: [PATCH v9 12/14] drm/amdgpu: enable SDMA usermode queues
Date: Fri, 26 Apr 2024 15:48:08 +0200 [thread overview]
Message-ID: <20240426134810.1250-13-shashank.sharma@amd.com> (raw)
In-Reply-To: <20240426134810.1250-1-shashank.sharma@amd.com>
This patch does necessary modifications to enable the SDMA
usermode queues using the existing userqueue infrastructure.
V9: introduced this patch in the series
Cc: Christian König <Christian.Koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Arvind Yadav <arvind.yadav@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 2 +-
drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c | 4 ++++
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 3 +++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
index 781283753804..e516487e8db9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
@@ -189,7 +189,7 @@ amdgpu_userqueue_create(struct drm_file *filp, union drm_amdgpu_userq *args)
int qid, r = 0;
/* Usermode queues are only supported for GFX/SDMA engines as of now */
- if (args->in.ip_type != AMDGPU_HW_IP_GFX) {
+ if (args->in.ip_type != AMDGPU_HW_IP_GFX && args->in.ip_type != AMDGPU_HW_IP_DMA) {
DRM_ERROR("Usermode queue doesn't support IP type %u\n", args->in.ip_type);
return -EINVAL;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c
index a6c3037d2d1f..a5e270eda37b 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c
@@ -182,6 +182,10 @@ static int mes_v11_0_userq_create_ctx_space(struct amdgpu_userq_mgr *uq_mgr,
return r;
}
+ /* We don't need to set other FW objects for SDMA queues */
+ if (queue->queue_type == AMDGPU_HW_IP_DMA)
+ return 0;
+
/* Shadow and GDS objects come directly from userspace */
mqd->shadow_base_lo = mqd_user->shadow_va & 0xFFFFFFFC;
mqd->shadow_base_hi = upper_32_bits(mqd_user->shadow_va);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
index 361835a61f2e..90354a70c807 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
@@ -1225,6 +1225,8 @@ static int sdma_v6_0_early_init(void *handle)
return 0;
}
+extern const struct amdgpu_userq_funcs userq_mes_v11_0_funcs;
+
static int sdma_v6_0_sw_init(void *handle)
{
struct amdgpu_ring *ring;
@@ -1265,6 +1267,7 @@ static int sdma_v6_0_sw_init(void *handle)
return -EINVAL;
}
+ adev->userq_funcs[AMDGPU_HW_IP_DMA] = &userq_mes_v11_0_funcs;
return r;
}
--
2.43.2
next prev parent reply other threads:[~2024-04-26 13:49 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 13:47 [PATCH v9 00/14] AMDGPU usermode queues Shashank Sharma
2024-04-26 13:47 ` [PATCH v9 01/14] drm/amdgpu: UAPI for user queue management Shashank Sharma
2024-05-01 20:39 ` Alex Deucher
2024-05-02 5:23 ` Sharma, Shashank
2024-05-02 12:53 ` Sharma, Shashank
2024-05-02 13:52 ` Alex Deucher
2024-04-26 13:47 ` [PATCH v9 02/14] drm/amdgpu: add usermode queue base code Shashank Sharma
2024-05-01 21:29 ` Alex Deucher
2024-04-26 13:47 ` [PATCH v9 03/14] drm/amdgpu: add new IOCTL for usermode queue Shashank Sharma
2024-04-30 10:55 ` Christian König
2024-04-26 13:48 ` [PATCH v9 04/14] drm/amdgpu: add helpers to create userqueue object Shashank Sharma
2024-05-01 21:30 ` Alex Deucher
2024-04-26 13:48 ` [PATCH v9 05/14] drm/amdgpu: create MES-V11 usermode queue for GFX Shashank Sharma
2024-05-01 20:50 ` Alex Deucher
2024-05-02 5:26 ` Sharma, Shashank
2024-05-02 15:14 ` Christian König
2024-05-02 15:35 ` Sharma, Shashank
2024-04-26 13:48 ` [PATCH v9 06/14] drm/amdgpu: create context space for usermode queue Shashank Sharma
2024-05-01 21:11 ` Alex Deucher
2024-05-02 5:27 ` Sharma, Shashank
2024-05-02 15:15 ` Christian König
2024-04-26 13:48 ` [PATCH v9 07/14] drm/amdgpu: map usermode queue into MES Shashank Sharma
2024-04-26 13:48 ` [PATCH v9 08/14] drm/amdgpu: map wptr BO into GART Shashank Sharma
2024-05-01 21:36 ` Alex Deucher
2024-05-02 5:31 ` Sharma, Shashank
2024-05-02 13:06 ` Kasiviswanathan, Harish
2024-05-02 13:23 ` Sharma, Shashank
2024-05-02 13:46 ` Alex Deucher
2024-05-02 15:18 ` Christian König
2024-05-02 15:36 ` Sharma, Shashank
2024-04-26 13:48 ` [PATCH v9 09/14] drm/amdgpu: generate doorbell index for userqueue Shashank Sharma
2024-04-26 13:48 ` [PATCH v9 10/14] drm/amdgpu: cleanup leftover queues Shashank Sharma
2024-04-26 13:48 ` [PATCH v9 11/14] drm/amdgpu: fix MES GFX mask Shashank Sharma
2024-05-01 21:27 ` Alex Deucher
2024-05-02 15:19 ` Christian König
2024-05-02 15:42 ` Sharma, Shashank
2024-04-26 13:48 ` Shashank Sharma [this message]
2024-05-01 20:41 ` [PATCH v9 12/14] drm/amdgpu: enable SDMA usermode queues Alex Deucher
2024-05-02 5:47 ` Sharma, Shashank
2024-05-02 13:55 ` Alex Deucher
2024-05-02 14:01 ` Sharma, Shashank
2024-04-26 13:48 ` [PATCH v9 13/14] drm/amdgpu: enable compute/gfx usermode queue Shashank Sharma
2024-05-01 20:44 ` Alex Deucher
2024-05-02 5:50 ` Sharma, Shashank
2024-05-02 14:10 ` Alex Deucher
2024-05-02 14:17 ` Sharma, Shashank
2024-04-26 13:48 ` [PATCH v9 14/14] drm/amdgpu: add kernel config for gfx-userqueue Shashank Sharma
2024-05-02 15:22 ` Christian König
2024-05-02 16:19 ` Sharma, Shashank
2024-05-02 18:18 ` Sharma, Shashank
2024-05-02 15:51 ` [PATCH v9 00/14] AMDGPU usermode queues 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=20240426134810.1250-13-shashank.sharma@amd.com \
--to=shashank.sharma@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=arvind.yadav@amd.com \
--cc=srinivasan.shanmugam@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).