summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/include/mes_v12_api_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/include/mes_v12_api_def.h')
-rw-r--r--drivers/gpu/drm/amd/include/mes_v12_api_def.h76
1 files changed, 74 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/include/mes_v12_api_def.h b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
index c9b2ca5cf75f..2f12cba4eb66 100644
--- a/drivers/gpu/drm/amd/include/mes_v12_api_def.h
+++ b/drivers/gpu/drm/amd/include/mes_v12_api_def.h
@@ -66,6 +66,7 @@ enum MES_SCH_API_OPCODE {
MES_SCH_API_SET_SE_MODE = 17,
MES_SCH_API_SET_GANG_SUBMIT = 18,
MES_SCH_API_SET_HW_RSRC_1 = 19,
+ MES_SCH_API_INV_TLBS = 20,
MES_SCH_API_MAX = 0xFF
};
@@ -105,6 +106,43 @@ struct MES_API_STATUS {
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 };
@@ -248,7 +286,9 @@ union MESAPI_SET_HW_RESOURCES {
uint32_t enable_mes_sch_stb_log : 1;
uint32_t limit_single_process : 1;
uint32_t unmapped_doorbell_handling: 2;
- uint32_t reserved : 11;
+ uint32_t enable_mes_fence_int: 1;
+ uint32_t enable_lr_compute_wa : 1;
+ uint32_t reserved : 9;
};
uint32_t uint32_all;
};
@@ -278,6 +318,8 @@ union MESAPI_SET_HW_RESOURCES_1 {
uint32_t mes_debug_ctx_size;
/* unit is 100ms */
uint32_t mes_kiq_unmap_timeout;
+ uint64_t reserved1;
+ uint64_t cleaner_shader_fence_mc_addr;
};
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -357,7 +399,8 @@ union MESAPI__REMOVE_QUEUE {
uint32_t unmap_kiq_utility_queue : 1;
uint32_t preempt_legacy_gfx_queue : 1;
uint32_t unmap_legacy_queue : 1;
- uint32_t reserved : 28;
+ uint32_t remove_queue_after_reset : 1;
+ uint32_t reserved : 27;
};
struct MES_API_STATUS api_status;
@@ -830,6 +873,35 @@ union MESAPI__SET_GANG_SUBMIT {
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
};
+/*
+ * @inv_sel 0-select pasid as input to do the invalidation , 1-select vmid
+ * @flush_type 0-old style, 1-light weight, 2-heavyweight, 3-heavyweight2
+ * @inv_sel_id specific pasid when inv_sel is 0 and specific vmid if inv_sel is 1
+ * @hub_id 0-gc_hub, 1-mm_hub
+ */
+struct INV_TLBS {
+ uint8_t inv_sel;
+ uint8_t flush_type;
+ uint16_t inv_sel_id;
+ uint32_t hub_id;
+ /* If following two inv_range setting are all 0 , whole VM will be invalidated,
+ * otherwise only required range be invalidated
+ */
+ uint64_t inv_range_va_start;
+ uint64_t inv_range_size;
+ uint64_t reserved;
+};
+
+union MESAPI__INV_TLBS {
+ struct {
+ union MES_API_HEADER header;
+ struct MES_API_STATUS api_status;
+ struct INV_TLBS invalidate_tlbs;
+ };
+
+ uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
+};
+
#pragma pack(pop)
#endif