History

habanalabs: Add busy engines bitmask to HW idle IOCTL

The information which is currently provided as a response to the "HL_INFO_HW_IDLE" IOCTL is merely a general boolean value. This patch extends it and provides also a bitmask that indicates which of the device engines are busy.

Tomer Tayar committed 7 years ago

Commit e8960ca1 parent 06deb865 files · +43 −6Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/misc/habanalabs.h+29−1
@@ -45,6 +45,30 @@ enum goya_queue_id { · 44 unmodified lines
4545 GOYA_QUEUE_ID_SIZE
4646 };
4747
48+/*
49+ * Engine Numbering
50+ *
51+ * Used in the "busy_engines_mask" field in `struct hl_info_hw_idle'
52+ */
53+
54+enum goya_engine_id {
55+ GOYA_ENGINE_ID_DMA_0 = 0,
56+ GOYA_ENGINE_ID_DMA_1,
57+ GOYA_ENGINE_ID_DMA_2,
58+ GOYA_ENGINE_ID_DMA_3,
59+ GOYA_ENGINE_ID_DMA_4,
60+ GOYA_ENGINE_ID_MME_0,
61+ GOYA_ENGINE_ID_TPC_0,
62+ GOYA_ENGINE_ID_TPC_1,
63+ GOYA_ENGINE_ID_TPC_2,
64+ GOYA_ENGINE_ID_TPC_3,
65+ GOYA_ENGINE_ID_TPC_4,
66+ GOYA_ENGINE_ID_TPC_5,
67+ GOYA_ENGINE_ID_TPC_6,
68+ GOYA_ENGINE_ID_TPC_7,
69+ GOYA_ENGINE_ID_SIZE
70+};
71+
4872 enum hl_device_status {
4973 HL_DEVICE_STATUS_OPERATIONAL,
5074 HL_DEVICE_STATUS_IN_RESET,
@@ -86,7 +110,11 @@ struct hl_info_dram_usage { · 35 unmodified lines
86110
87111 struct hl_info_hw_idle {
88112 __u32 is_idle;
89− __u32 pad;
113+ /*
114+ * Bitmask of busy engines.
115+ * Bits definition is according to `enum <chip>_enging_id'.
116+ */
117+ __u32 busy_engines_mask;
90118 };
91119
92120 struct hl_info_device_status {