1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2021 Intel Corporation 4 */ 5 6 #ifndef _XE_HW_ENGINE_H_ 7 #define _XE_HW_ENGINE_H_ 8 9 #include "xe_hw_engine_types.h" 10 11 struct drm_printer; 12 13 #ifdef CONFIG_DRM_XE_JOB_TIMEOUT_MIN 14 #define XE_HW_ENGINE_JOB_TIMEOUT_MIN CONFIG_DRM_XE_JOB_TIMEOUT_MIN 15 #else 16 #define XE_HW_ENGINE_JOB_TIMEOUT_MIN 1 17 #endif 18 #ifdef CONFIG_DRM_XE_JOB_TIMEOUT_MAX 19 #define XE_HW_ENGINE_JOB_TIMEOUT_MAX CONFIG_DRM_XE_JOB_TIMEOUT_MAX 20 #else 21 #define XE_HW_ENGINE_JOB_TIMEOUT_MAX (10 * 1000) 22 #endif 23 #ifdef CONFIG_DRM_XE_TIMESLICE_MIN 24 #define XE_HW_ENGINE_TIMESLICE_MIN CONFIG_DRM_XE_TIMESLICE_MIN 25 #else 26 #define XE_HW_ENGINE_TIMESLICE_MIN 1 27 #endif 28 #ifdef CONFIG_DRM_XE_TIMESLICE_MAX 29 #define XE_HW_ENGINE_TIMESLICE_MAX CONFIG_DRM_XE_TIMESLICE_MAX 30 #else 31 #define XE_HW_ENGINE_TIMESLICE_MAX (10 * 1000 * 1000) 32 #endif 33 #ifdef CONFIG_DRM_XE_PREEMPT_TIMEOUT 34 #define XE_HW_ENGINE_PREEMPT_TIMEOUT CONFIG_DRM_XE_PREEMPT_TIMEOUT 35 #else 36 #define XE_HW_ENGINE_PREEMPT_TIMEOUT (640 * 1000) 37 #endif 38 #ifdef CONFIG_DRM_XE_PREEMPT_TIMEOUT_MIN 39 #define XE_HW_ENGINE_PREEMPT_TIMEOUT_MIN CONFIG_DRM_XE_PREEMPT_TIMEOUT_MIN 40 #else 41 #define XE_HW_ENGINE_PREEMPT_TIMEOUT_MIN 1 42 #endif 43 #ifdef CONFIG_DRM_XE_PREEMPT_TIMEOUT_MAX 44 #define XE_HW_ENGINE_PREEMPT_TIMEOUT_MAX CONFIG_DRM_XE_PREEMPT_TIMEOUT_MAX 45 #else 46 #define XE_HW_ENGINE_PREEMPT_TIMEOUT_MAX (10 * 1000 * 1000) 47 #endif 48 49 int xe_hw_engines_init_early(struct xe_gt *gt); 50 int xe_hw_engines_init(struct xe_gt *gt); 51 void xe_hw_engine_handle_irq(struct xe_hw_engine *hwe, u16 intr_vec); 52 void xe_hw_engine_enable_ring(struct xe_hw_engine *hwe); 53 u32 xe_hw_engine_mask_per_class(struct xe_gt *gt, 54 enum xe_engine_class engine_class); 55 56 struct xe_hw_engine_snapshot * 57 xe_hw_engine_snapshot_capture(struct xe_hw_engine *hwe); 58 void xe_hw_engine_snapshot_free(struct xe_hw_engine_snapshot *snapshot); 59 void xe_hw_engine_snapshot_print(struct xe_hw_engine_snapshot *snapshot, 60 struct drm_printer *p); 61 void xe_hw_engine_print(struct xe_hw_engine *hwe, struct drm_printer *p); 62 void xe_hw_engine_setup_default_lrc_state(struct xe_hw_engine *hwe); 63 64 bool xe_hw_engine_is_reserved(struct xe_hw_engine *hwe); 65 static inline bool xe_hw_engine_is_valid(struct xe_hw_engine *hwe) 66 { 67 return hwe->name; 68 } 69 70 #endif 71