diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index db2cb7bd..6fb2b60b 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -2026,6 +2026,7 @@ int amdgpu_create_userqueue(amdgpu_device_handle dev, uint64_t wptr_va, uint64_t rptr_va, void *mqd_in, + uint32_t flags, uint32_t *queue_id); /** diff --git a/amdgpu/amdgpu_userq.c b/amdgpu/amdgpu_userq.c index 3de0bde5..123c979e 100644 --- a/amdgpu/amdgpu_userq.c +++ b/amdgpu/amdgpu_userq.c @@ -37,6 +37,7 @@ amdgpu_create_userqueue(amdgpu_device_handle dev, uint64_t wptr_va, uint64_t rptr_va, void *mqd_in, + uint32_t flags, uint32_t *queue_id) { int ret; @@ -75,6 +76,7 @@ amdgpu_create_userqueue(amdgpu_device_handle dev, userq.in.mqd = (uint64_t)mqd_in; userq.in.mqd_size = mqd_size; + userq.in.flags = flags; ret = drmCommandWriteRead(dev->fd, DRM_AMDGPU_USERQ, &userq, sizeof(userq)); diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index a81eb7f9..822539f7 100644 --- a/include/drm/amdgpu_drm.h +++ b/include/drm/amdgpu_drm.h @@ -327,6 +327,16 @@ union drm_amdgpu_ctx { #define AMDGPU_USERQ_OP_CREATE 1 #define AMDGPU_USERQ_OP_FREE 2 +/* queue priority levels */ +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK 0x3 +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_SHIFT 0 +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_NORMAL_LOW 0 +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_LOW 1 +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_NORMAL_HIGH 2 +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_HIGH 3 /* admin only */ +/* for queues that need access to protected content */ +#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE (1 << 2) + /* * This structure is a container to pass input configuration * info for all supported userqueue related operations. @@ -353,7 +363,11 @@ struct drm_amdgpu_userq_in { * and doorbell_offset in the doorbell bo. */ __u32 doorbell_offset; - __u32 _pad; + /** + * @flags: flags used for queue parameters + */ + __u32 flags; + /** * @queue_va: Virtual address of the GPU memory which holds the queue * object. The queue holds the workload packets.