[PATCH 3/8] lib/amdgpu: Add user mode queue support in ring context
Sunil Khatri
sunil.khatri at amd.com
Thu Jan 16 06:52:06 UTC 2025
Add the meta data to support the user mode command
submission in the ring_context.
User mode command submission methods needs these
resources to be initialized and to create/destroy queues.
Also once we have the queue created the queue id is
used to submit the work load to the h/w.
Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
Reviewed-by: Vitaly Prosyak vitaly.prosyak at amd.com>
---
lib/amdgpu/amd_ip_blocks.h | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/lib/amdgpu/amd_ip_blocks.h b/lib/amdgpu/amd_ip_blocks.h
index dc4d87151..9d110d402 100644
--- a/lib/amdgpu/amd_ip_blocks.h
+++ b/lib/amdgpu/amd_ip_blocks.h
@@ -86,6 +86,14 @@ struct dynamic_test{
bool support_sdma;
};
+struct amdgpu_userq_bo {
+ amdgpu_bo_handle handle;
+ amdgpu_va_handle va_handle;
+ uint64_t mc_addr;
+ uint64_t size;
+ void *ptr;
+};
+
#define for_each_test(t, T) for(typeof(*T) *t = T; t->name; t++)
/* set during execution */
@@ -141,6 +149,29 @@ struct amdgpu_ring_context {
struct amdgpu_cs_ib_info ib_info; /* amdgpu_bo_list_create */
struct amdgpu_cs_request ibs_request; /* amdgpu_cs_query_fence_status */
struct amdgpu_cs_err_codes err_codes;
+
+ /* User queue resources */
+ struct amdgpu_userq_bo queue;
+ struct amdgpu_userq_bo shadow;
+ struct amdgpu_userq_bo doorbell;
+ struct amdgpu_userq_bo rptr;
+ struct amdgpu_userq_bo wptr;
+ struct amdgpu_userq_bo csa;
+ struct amdgpu_userq_bo eop;
+
+ uint32_t *queue_cpu;
+ uint64_t *wptr_cpu;
+ uint64_t *doorbell_cpu;
+
+ uint32_t db_handle;
+ uint32_t queue_id;
+ uint32_t npkt;
+
+ uint32_t timeline_syncobj_handle;
+ uint64_t point;
+ bool user_queue;
+
+ struct drm_amdgpu_info_device dev_info;
};
--
2.34.1
More information about the igt-dev
mailing list