| 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 | bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp); | 
|---|
| 27 |  | 
|---|
| 28 | #else | 
|---|
| 29 | static inline void intel_pxp_gsccs_fini(struct intel_pxp *pxp) | 
|---|
| 30 | { | 
|---|
| 31 | } | 
|---|
| 32 |  | 
|---|
| 33 | static inline int intel_pxp_gsccs_init(struct intel_pxp *pxp) | 
|---|
| 34 | { | 
|---|
| 35 | return 0; | 
|---|
| 36 | } | 
|---|
| 37 |  | 
|---|
| 38 | static inline bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp) | 
|---|
| 39 | { | 
|---|
| 40 | return false; | 
|---|
| 41 | } | 
|---|
| 42 |  | 
|---|
| 43 | #endif | 
|---|
| 44 |  | 
|---|
| 45 | #endif /*__INTEL_PXP_GSCCS_H__ */ | 
|---|
| 46 |  | 
|---|