drivers/gpu/drm/amd/include/mes_v12_api_def.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/include/mes_v12_api_def.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/include/mes_v12_api_def.h- Extension
.h- Size
- 26329 bytes
- Lines
- 961
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct MES_API_STATUSstruct MES_LOG_CONTEXT_STATE_CHANGEstruct MES_LOG_QUEUE_NEW_WORKstruct MES_LOG_QUEUE_UNWAIT_SYNC_OBJECTstruct MES_LOG_QUEUE_NO_MORE_WORKstruct MES_LOG_QUEUE_WAIT_SYNC_OBJECTstruct MES_LOG_ENTRY_HEADERstruct MES_LOG_ENTRY_DATAstruct MES_LOG_BUFFERstruct MES_API_QUERY_MES__CTX_ARRAY_SIZEstruct MES_API_QUERY_MES__HEALTHY_CHECKstruct RRMT_OPTIONstruct WRITE_REGstruct READ_REGstruct INV_GARTstruct QUERY_STATUSstruct WAIT_REG_MEMstruct SET_SHADER_DEBUGGERstruct SET_GANG_SUBMITstruct CHANGE_CONFIGstruct INV_TLBSenum MES_API_TYPEenum MES_SCH_API_OPCODEenum MES_RRMT_MODEenum MES_AMD_PRIORITY_LEVELenum MES_QUEUE_TYPEenum MES_ERROR_CATEGORY_CODE_12enum VM_HUB_TYPEenum SET_DEBUG_VMID_OPERATIONSenum MES_MS_LOG_CONTEXT_STATEenum MES_MS_LOG_OPERATIONenum MES_SWIP_TO_HWIP_DEFenum MES_API_QUERY_MES_OPCODEenum MESAPI_MISC_OPCODEenum WRM_OPERATIONenum MESAPI_MISC__CHANGE_CONFIG_OPTIONenum MES_SE_MODE
Annotated Snippet
struct MES_API_STATUS {
uint64_t api_completion_fence_addr;
uint64_t api_completion_fence_value;
};
/*
* MES will set api_completion_fence_value in api_completion_fence_addr
* when it can successflly process the API. MES will also trigger
* following interrupt when it finish process the API no matter success
* or failed.
* Interrupt source id 181 (EOP) with context ID (DW 6 in the int
* cookie) set to 0xb1 and context type set to 8. Driver side need
* to enable TIME_STAMP_INT_ENABLE in CPC_INT_CNTL for MES pipe to
* catch this interrupt.
* Driver side also need to set enable_mes_fence_int = 1 in
* set_HW_resource package to enable this fence interrupt.
* when the API process failed.
* lowre 32 bits set to 0.
* higher 32 bits set as follows (bit shift within high 32)
* bit 0 - 7 API specific error code.
* bit 8 - 15 API OPCODE.
* bit 16 - 23 MISC OPCODE if any
* bit 24 - 30 ERROR category (API_ERROR_XXX)
* bit 31 Set to 1 to indicate error status
*
*/
enum { MES_SCH_ERROR_CODE_HEADER_SHIFT_12 = 8 };
enum { MES_SCH_ERROR_CODE_MISC_OP_SHIFT_12 = 16 };
enum { MES_ERROR_CATEGORY_SHIFT_12 = 24 };
enum { MES_API_STATUS_ERROR_SHIFT_12 = 31 };
enum MES_ERROR_CATEGORY_CODE_12 {
MES_ERROR_API = 1,
MES_ERROR_SCHEDULING = 2,
MES_ERROR_UNKNOWN = 3,
};
#define MES_ERR_CODE(api_err, opcode, misc_op, category) \
((uint64) (api_err | opcode << MES_SCH_ERROR_CODE_HEADER_SHIFT_12 | \
misc_op << MES_SCH_ERROR_CODE_MISC_OP_SHIFT_12 | \
category << MES_ERROR_CATEGORY_SHIFT_12 | \
1 << MES_API_STATUS_ERROR_SHIFT_12) << 32)
enum { MAX_COMPUTE_PIPES = 8 };
enum { MAX_GFX_PIPES = 2 };
enum { MAX_SDMA_PIPES = 2 };
enum { MAX_COMPUTE_HQD_PER_PIPE = 8 };
enum { MAX_GFX_HQD_PER_PIPE = 8 };
enum { MAX_SDMA_HQD_PER_PIPE = 10 };
enum { MAX_SDMA_HQD_PER_PIPE_11_0 = 8 };
enum { MAX_QUEUES_IN_A_GANG = 8 };
enum VM_HUB_TYPE {
VM_HUB_TYPE_GC = 0,
VM_HUB_TYPE_MM = 1,
VM_HUB_TYPE_MAX,
};
enum { VMID_INVALID = 0xffff };
enum { MAX_VMID_GCHUB = 16 };
enum { MAX_VMID_MMHUB = 16 };
enum SET_DEBUG_VMID_OPERATIONS {
DEBUG_VMID_OP_PROGRAM = 0,
DEBUG_VMID_OP_ALLOCATE = 1,
DEBUG_VMID_OP_RELEASE = 2,
DEBUG_VMID_OP_VM_SETUP = 3 // used to set up the debug vmid page table in the kernel queue case (mode 1)
};
enum MES_MS_LOG_CONTEXT_STATE {
MES_LOG_CONTEXT_STATE_IDLE = 0,
MES_LOG_CONTEXT_STATE_RUNNING = 1,
MES_LOG_CONTEXT_STATE_READY = 2,
MES_LOG_CONTEXT_STATE_READY_STANDBY = 3,
MES_LOG_CONTEXT_STATE_INVALID = 0xF,
};
enum MES_MS_LOG_OPERATION {
MES_LOG_OPERATION_CONTEXT_STATE_CHANGE = 0,
MES_LOG_OPERATION_QUEUE_NEW_WORK = 1,
MES_LOG_OPERATION_QUEUE_UNWAIT_SYNC_OBJECT = 2,
MES_LOG_OPERATION_QUEUE_NO_MORE_WORK = 3,
MES_LOG_OPERATION_QUEUE_WAIT_SYNC_OBJECT = 4,
MES_LOG_OPERATION_QUEUE_INVALID = 0xF,
};
Annotation
- Detected declarations: `struct MES_API_STATUS`, `struct MES_LOG_CONTEXT_STATE_CHANGE`, `struct MES_LOG_QUEUE_NEW_WORK`, `struct MES_LOG_QUEUE_UNWAIT_SYNC_OBJECT`, `struct MES_LOG_QUEUE_NO_MORE_WORK`, `struct MES_LOG_QUEUE_WAIT_SYNC_OBJECT`, `struct MES_LOG_ENTRY_HEADER`, `struct MES_LOG_ENTRY_DATA`, `struct MES_LOG_BUFFER`, `struct MES_API_QUERY_MES__CTX_ARRAY_SIZE`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.