xref: /linux/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h (revision ae22a94997b8a03dcb3c922857c203246711f9d4)
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 #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h"
12 
13 struct intel_pxp;
14 
15 #define GSC_PENDING_RETRY_MAXCOUNT 40
16 #define GSC_PENDING_RETRY_PAUSE_MS 50
17 #define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_HECI_REPLY_LATENCY_MS + \
18 					 (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS))
19 
20 #ifdef CONFIG_DRM_I915_PXP
21 void intel_pxp_gsccs_fini(struct intel_pxp *pxp);
22 int intel_pxp_gsccs_init(struct intel_pxp *pxp);
23 
24 int intel_pxp_gsccs_create_session(struct intel_pxp *pxp, int arb_session_id);
25 void intel_pxp_gsccs_end_arb_fw_session(struct intel_pxp *pxp, u32 arb_session_id);
26 
27 #else
28 static inline void intel_pxp_gsccs_fini(struct intel_pxp *pxp)
29 {
30 }
31 
32 static inline int intel_pxp_gsccs_init(struct intel_pxp *pxp)
33 {
34 	return 0;
35 }
36 
37 #endif
38 
39 bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp);
40 
41 #endif /*__INTEL_PXP_GSCCS_H__ */
42