From: vitaly prosyak <vprosyak@amd.com>
To: Sunil Khatri <sunil.khatri@amd.com>,
igt-dev@lists.freedesktop.org, "Zhang,
Jesse(Jie)" <Jesse.Zhang@amd.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Vitaly Prosyak" <vitaly.prosyak@amd.com>
Subject: Re: [PATCH v3 01/19] drm-uapi/amdgpu: sync with drm-next
Date: Tue, 1 Apr 2025 19:46:45 -0400 [thread overview]
Message-ID: <4f1d523b-27be-48bb-b0c0-740b99a19a1f@amd.com> (raw)
In-Reply-To: <20250328082416.1469810-1-sunil.khatri@amd.com>
The entire series of 19 patches looks very good to me—thanks for the great work!
There are a few to-do items, such as making amdgpu_user_queue_submit an ASIC-specific hook due to the new parameters for futures ASIC's , and adding another function accordingly.
Additionally, there are some hacks in amdgpu-disable-check-for-IP-presence-with-no-kernel-queue.patch.
However, given the urgency and the need to unblock Jesse for additional tests, I’d like to proceed with merging your patches.
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
On 2025-03-28 04:23, Sunil Khatri wrote:
> Sync with drm-next commit ("e0400bf7d91ed477b827a674e5d64406c78ffd48")
>
> This patch introduces new UAPI/IOCTL for usermode graphics
> queue. IGT test cases fill this structure and request
> the graphics driver to add a graphics work queue for it.
> The output of this UAPI is a queue id.
>
> This UAPI maps the queue into GPU, so the graphics app can start
> submitting work to the queue as soon as the call returns.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> include/drm-uapi/amdgpu_drm.h | 123 ++++++++++++++++++++++++++++++++++
> 1 file changed, 123 insertions(+)
>
> diff --git a/include/drm-uapi/amdgpu_drm.h b/include/drm-uapi/amdgpu_drm.h
> index efe5de6ce..d780e1f2a 100644
> --- a/include/drm-uapi/amdgpu_drm.h
> +++ b/include/drm-uapi/amdgpu_drm.h
> @@ -54,6 +54,7 @@ extern "C" {
> #define DRM_AMDGPU_VM 0x13
> #define DRM_AMDGPU_FENCE_TO_HANDLE 0x14
> #define DRM_AMDGPU_SCHED 0x15
> +#define DRM_AMDGPU_USERQ 0x16
>
> #define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
> #define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
> @@ -71,6 +72,7 @@ extern "C" {
> #define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
> #define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle)
> #define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched)
> +#define DRM_IOCTL_AMDGPU_USERQ DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ, union drm_amdgpu_userq)
>
> /**
> * DOC: memory domains
> @@ -319,6 +321,127 @@ union drm_amdgpu_ctx {
> union drm_amdgpu_ctx_out out;
> };
>
> +/* user queue IOCTL operations */
> +#define AMDGPU_USERQ_OP_CREATE 1
> +#define AMDGPU_USERQ_OP_FREE 2
> +
> +/*
> + * This structure is a container to pass input configuration
> + * info for all supported userqueue related operations.
> + * For operation AMDGPU_USERQ_OP_CREATE: user is expected
> + * to set all fields, excep the parameter 'queue_id'.
> + * For operation AMDGPU_USERQ_OP_FREE: the only input parameter expected
> + * to be set is 'queue_id', eveything else is ignored.
> + */
> +struct drm_amdgpu_userq_in {
> + /** AMDGPU_USERQ_OP_* */
> + __u32 op;
> + /** Queue id passed for operation USERQ_OP_FREE */
> + __u32 queue_id;
> + /** the target GPU engine to execute workload (AMDGPU_HW_IP_*) */
> + __u32 ip_type;
> + /**
> + * @doorbell_handle: the handle of doorbell GEM object
> + * associated with this userqueue client.
> + */
> + __u32 doorbell_handle;
> + /**
> + * @doorbell_offset: 32-bit offset of the doorbell in the doorbell bo.
> + * Kernel will generate absolute doorbell offset using doorbell_handle
> + * and doorbell_offset in the doorbell bo.
> + */
> + __u32 doorbell_offset;
> + __u32 _pad;
> + /**
> + * @queue_va: Virtual address of the GPU memory which holds the queue
> + * object. The queue holds the workload packets.
> + */
> + __u64 queue_va;
> + /**
> + * @queue_size: Size of the queue in bytes, this needs to be 256-byte
> + * aligned.
> + */
> + __u64 queue_size;
> + /**
> + * @rptr_va : Virtual address of the GPU memory which holds the ring RPTR.
> + * This object must be at least 8 byte in size and aligned to 8-byte offset.
> + */
> + __u64 rptr_va;
> + /**
> + * @wptr_va : Virtual address of the GPU memory which holds the ring WPTR.
> + * This object must be at least 8 byte in size and aligned to 8-byte offset.
> + *
> + * Queue, RPTR and WPTR can come from the same object, as long as the size
> + * and alignment related requirements are met.
> + */
> + __u64 wptr_va;
> + /**
> + * @mqd: MQD (memory queue descriptor) is a set of parameters which allow
> + * the GPU to uniquely define and identify a usermode queue.
> + *
> + * MQD data can be of different size for different GPU IP/engine and
> + * their respective versions/revisions, so this points to a __u64 *
> + * which holds IP specific MQD of this usermode queue.
> + */
> + __u64 mqd;
> + /**
> + * @size: size of MQD data in bytes, it must match the MQD structure
> + * size of the respective engine/revision defined in UAPI for ex, for
> + * gfx11 workloads, size = sizeof(drm_amdgpu_userq_mqd_gfx11).
> + */
> + __u64 mqd_size;
> +};
> +
> +/* The structure to carry output of userqueue ops */
> +struct drm_amdgpu_userq_out {
> + /**
> + * For operation AMDGPU_USERQ_OP_CREATE: This field contains a unique
> + * queue ID to represent the newly created userqueue in the system, otherwise
> + * it should be ignored.
> + */
> + __u32 queue_id;
> + __u32 _pad;
> +};
> +
> +union drm_amdgpu_userq {
> + struct drm_amdgpu_userq_in in;
> + struct drm_amdgpu_userq_out out;
> +};
> +
> +/* GFX V11 IP specific MQD parameters */
> +struct drm_amdgpu_userq_mqd_gfx11 {
> + /**
> + * @shadow_va: Virtual address of the GPU memory to hold the shadow buffer.
> + * Use AMDGPU_INFO_IOCTL to find the exact size of the object.
> + */
> + __u64 shadow_va;
> + /**
> + * @csa_va: Virtual address of the GPU memory to hold the CSA buffer.
> + * Use AMDGPU_INFO_IOCTL to find the exact size of the object.
> + */
> + __u64 csa_va;
> +};
> +
> +/* GFX V11 SDMA IP specific MQD parameters */
> +struct drm_amdgpu_userq_mqd_sdma_gfx11 {
> + /**
> + * @csa_va: Virtual address of the GPU memory to hold the CSA buffer.
> + * This must be a from a separate GPU object, and use AMDGPU_INFO IOCTL
> + * to get the size.
> + */
> + __u64 csa_va;
> +};
> +
> +/* GFX V11 Compute IP specific MQD parameters */
> +struct drm_amdgpu_userq_mqd_compute_gfx11 {
> + /**
> + * @eop_va: Virtual address of the GPU memory to hold the EOP buffer.
> + * This must be a from a separate GPU object, and use AMDGPU_INFO IOCTL
> + * to get the size.
> + */
> + __u64 eop_va;
> +};
> +
> /* vm ioctl */
> #define AMDGPU_VM_OP_RESERVE_VMID 1
> #define AMDGPU_VM_OP_UNRESERVE_VMID 2
next prev parent reply other threads:[~2025-04-01 23:47 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 8:23 [PATCH v3 01/19] drm-uapi/amdgpu: sync with drm-next Sunil Khatri
2025-03-28 8:23 ` [PATCH v3 02/19] " Sunil Khatri
2025-03-31 19:11 ` vitaly prosyak
2025-04-01 4:39 ` Khatri, Sunil
2025-04-01 4:50 ` vitaly prosyak
2025-04-01 5:46 ` Khatri, Sunil
2025-04-01 16:09 ` Kamil Konieczny
2025-03-28 8:24 ` [PATCH v3 03/19] lib/amdgpu: Add user mode queue support in ring context Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 04/19] lib/amdgpu: Add support of amd user queues Sunil Khatri
2025-04-01 4:21 ` vitaly prosyak
2025-04-01 4:41 ` Khatri, Sunil
2025-03-28 8:24 ` [PATCH v3 05/19] lib/amdgpu: add func amdgpu_bo_alloc_and_map_sync Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 06/19] tests/amdgpu: Add user queue support for gfx and compute Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 07/19] tests/amdgpu: Add UMQ submission tests " Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 08/19] tests/amdgpu: Add amdgpu_sync_dependency_test with UMQ Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 09/19] tests/amdgpu: use memory API's from amd_memory.h Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 10/19] lib/amdgpu: add macro for adding cmds in user queue Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 11/19] lib/amdgpu: use macro to add cmds in the user ring Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 12/19] tests/amdgpu: Add amdgpu_cp_nops tests for UMQ Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 13/19] drm-uapi/amdgpu: sync with drm-next Sunil Khatri
2025-04-01 16:06 ` Kamil Konieczny
2025-04-01 23:52 ` vitaly prosyak
2025-04-02 10:51 ` Kamil Konieczny
2025-04-01 23:57 ` vitaly prosyak
2025-03-28 8:24 ` [PATCH v3 14/19] lib/amdgpu: use right API to get the correct size Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 15/19] lib/amdgpu: use a memory fence to serialize write Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 16/19] tests/amdgpu: disable check for IP presense with no kernel queue Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 17/19] lib/amdgpu: make the local functions as static Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 18/19] lib/amdgpu: enable UMQ function under macro Sunil Khatri
2025-03-28 8:24 ` [PATCH v3 19/19] tests/amdgpu: Disable the UMQ tests under a macro Sunil Khatri
2025-03-28 13:01 ` ✓ Xe.CI.BAT: success for series starting with [v3,01/19] drm-uapi/amdgpu: sync with drm-next Patchwork
2025-03-28 13:12 ` ✗ i915.CI.BAT: failure " Patchwork
2025-03-29 0:43 ` ✗ Xe.CI.Full: " Patchwork
2025-04-01 23:46 ` vitaly prosyak [this message]
2025-04-06 18:47 ` Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-03-28 8:19 [PATCH v3 01/19] " Sunil Khatri
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=4f1d523b-27be-48bb-b0c0-740b99a19a1f@amd.com \
--to=vprosyak@amd.com \
--cc=Jesse.Zhang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=sunil.khatri@amd.com \
--cc=vitaly.prosyak@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