0001
0002
0003
0004
0005
0006 #ifndef __INTEL_PXP_H__
0007 #define __INTEL_PXP_H__
0008
0009 #include <linux/errno.h>
0010 #include <linux/types.h>
0011
0012 struct intel_pxp;
0013 struct drm_i915_gem_object;
0014
0015 #ifdef CONFIG_DRM_I915_PXP
0016 struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp);
0017 bool intel_pxp_is_enabled(const struct intel_pxp *pxp);
0018 bool intel_pxp_is_active(const struct intel_pxp *pxp);
0019
0020 void intel_pxp_init(struct intel_pxp *pxp);
0021 void intel_pxp_fini(struct intel_pxp *pxp);
0022
0023 void intel_pxp_init_hw(struct intel_pxp *pxp);
0024 void intel_pxp_fini_hw(struct intel_pxp *pxp);
0025
0026 void intel_pxp_mark_termination_in_progress(struct intel_pxp *pxp);
0027
0028 int intel_pxp_start(struct intel_pxp *pxp);
0029
0030 int intel_pxp_key_check(struct intel_pxp *pxp,
0031 struct drm_i915_gem_object *obj,
0032 bool assign);
0033
0034 void intel_pxp_invalidate(struct intel_pxp *pxp);
0035 #else
0036 static inline void intel_pxp_init(struct intel_pxp *pxp)
0037 {
0038 }
0039
0040 static inline void intel_pxp_fini(struct intel_pxp *pxp)
0041 {
0042 }
0043
0044 static inline int intel_pxp_start(struct intel_pxp *pxp)
0045 {
0046 return -ENODEV;
0047 }
0048
0049 static inline bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
0050 {
0051 return false;
0052 }
0053
0054 static inline bool intel_pxp_is_active(const struct intel_pxp *pxp)
0055 {
0056 return false;
0057 }
0058
0059 static inline int intel_pxp_key_check(struct intel_pxp *pxp,
0060 struct drm_i915_gem_object *obj,
0061 bool assign)
0062 {
0063 return -ENODEV;
0064 }
0065 #endif
0066
0067 #endif