Implement hsaKmtGetQueueInfo interface
For items in HsaQueueInfo, control stack information comes from KFD, CU mask information is maintained in Thunk, and others (queue detail error and queue type extended) are ignored (value = 0) at this point. Change-Id: Ib21370b0f52b2bb4ebe6a9b4b6ec6139cccb25ca Signed-off-by: Amber Lin <Amber.Lin@amd.com>
This commit is contained in:
@@ -330,6 +330,13 @@ hsaKmtSetQueueCUMask(
|
||||
HSAuint32* QueueCUMask //IN
|
||||
);
|
||||
|
||||
HSAKMT_STATUS
|
||||
HSAKMTAPI
|
||||
hsaKmtGetQueueInfo(
|
||||
HSA_QUEUEID QueueId, //IN
|
||||
HsaQueueInfo *QueueInfo //IN
|
||||
);
|
||||
|
||||
/**
|
||||
Allows an HSA process to set/change the default and alternate memory coherency, before starting to dispatch.
|
||||
*/
|
||||
|
||||
@@ -582,6 +582,25 @@ typedef enum _HSA_QUEUE_TYPE
|
||||
HSA_QUEUE_TYPE_SIZE = 0xFFFFFFFF //aligns to 32bit enum
|
||||
} HSA_QUEUE_TYPE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HSAuint32 QueueDetailError; // HW specific queue error state
|
||||
HSAuint32 QueueTypeExtended; // HW specific queue type info.
|
||||
// 0 = no information
|
||||
HSAuint32 NumCUAssigned; // size of *CUMaskInfo bit array, Multiple
|
||||
// of 32, 0 = no information
|
||||
HSAuint32* CUMaskInfo; // runtime/system CU assignment for realtime
|
||||
// queue & reserved CU priority. Ptr to
|
||||
// bit-array, each bit represents one CU.
|
||||
// NULL = no information
|
||||
HSAuint32* UserContextSaveArea; // reference to user space context save area
|
||||
HSAuint64 SaveAreaSizeInBytes; // Must be 4-Byte aligned
|
||||
HSAuint32* ControlStackTop; // ptr to the TOS
|
||||
HSAuint64 ControlStackUsedInBytes; // Must be 4-Byte aligned
|
||||
HSAuint64 Reserved1; // runtime/system CU assignment
|
||||
HSAuint64 Reserved2; // runtime/system CU assignment
|
||||
} HsaQueueInfo;
|
||||
|
||||
typedef struct _HsaQueueResource
|
||||
{
|
||||
HSA_QUEUEID QueueId; /** queue ID */
|
||||
|
||||
@@ -82,6 +82,14 @@ struct kfd_ioctl_set_cu_mask_args {
|
||||
uint64_t cu_mask_ptr; /* to KFD */
|
||||
};
|
||||
|
||||
struct kfd_ioctl_get_queue_wave_state_args {
|
||||
uint64_t ctl_stack_address; /* to KFD */
|
||||
uint32_t ctl_stack_used_size; /* from KFD */
|
||||
uint32_t save_area_used_size; /* from KFD */
|
||||
uint32_t queue_id; /* to KFD */
|
||||
uint32_t pad;
|
||||
};
|
||||
|
||||
/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
|
||||
#define KFD_IOC_CACHE_POLICY_COHERENT 0
|
||||
#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
|
||||
@@ -526,11 +534,14 @@ struct kfd_ioctl_cross_memory_copy_args {
|
||||
#define AMDKFD_IOC_CROSS_MEMORY_COPY \
|
||||
AMDKFD_IOWR(0x1F, struct kfd_ioctl_cross_memory_copy_args)
|
||||
|
||||
#define AMDKFD_IOC_GET_QUEUE_WAVE_STATE \
|
||||
AMDKFD_IOWR(0x20, struct kfd_ioctl_get_queue_wave_state_args)
|
||||
|
||||
/* TODO: remove this */
|
||||
#define AMDKFD_IOC_OPEN_GRAPHIC_HANDLE \
|
||||
AMDKFD_IOWR(0x20, struct kfd_ioctl_open_graphic_handle_args)
|
||||
AMDKFD_IOWR(0x21, struct kfd_ioctl_open_graphic_handle_args)
|
||||
|
||||
#define AMDKFD_COMMAND_START 0x01
|
||||
#define AMDKFD_COMMAND_END 0x21
|
||||
#define AMDKFD_COMMAND_END 0x22
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user