1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright(c) 2022, Intel Corporation. All rights reserved.
4  */
5 
6 #ifndef __INTEL_PXP_GSCCS_H__
7 #define __INTEL_PXP_GSCCS_H__
8 
9 #include <linux/types.h>
10 
11 struct intel_pxp;
12 
13 #define GSC_REPLY_LATENCY_MS 210
14 /*
15  * Max FW response time is 200ms, to which we add 10ms to account for overhead
16  * such as request preparation, GuC submission to hw and pipeline completion times.
17  */
18 #define GSC_PENDING_RETRY_MAXCOUNT 40
19 #define GSC_PENDING_RETRY_PAUSE_MS 50
20 #define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS)
21 
22 #ifdef CONFIG_DRM_I915_PXP
23 void intel_pxp_gsccs_fini(struct intel_pxp *pxp);
24 int intel_pxp_gsccs_init(struct intel_pxp *pxp);
25 
26 int intel_pxp_gsccs_create_session(struct intel_pxp *pxp, int arb_session_id);
27 void intel_pxp_gsccs_end_arb_fw_session(struct intel_pxp *pxp, u32 arb_session_id);
28 
29 #else
30 static inline void intel_pxp_gsccs_fini(struct intel_pxp *pxp)
31 {
32 }
33 
34 static inline int intel_pxp_gsccs_init(struct intel_pxp *pxp)
35 {
36 	return 0;
37 }
38 
39 #endif
40 
41 bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp);
42 
43 #endif /*__INTEL_PXP_GSCCS_H__ */
44