intel_pxp.h (1468B)
1/* SPDX-License-Identifier: MIT */ 2/* 3 * Copyright(c) 2020, Intel Corporation. All rights reserved. 4 */ 5 6#ifndef __INTEL_PXP_H__ 7#define __INTEL_PXP_H__ 8 9#include <linux/errno.h> 10#include <linux/types.h> 11 12struct intel_pxp; 13struct drm_i915_gem_object; 14 15#ifdef CONFIG_DRM_I915_PXP 16struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp); 17bool intel_pxp_is_enabled(const struct intel_pxp *pxp); 18bool intel_pxp_is_active(const struct intel_pxp *pxp); 19 20void intel_pxp_init(struct intel_pxp *pxp); 21void intel_pxp_fini(struct intel_pxp *pxp); 22 23void intel_pxp_init_hw(struct intel_pxp *pxp); 24void intel_pxp_fini_hw(struct intel_pxp *pxp); 25 26void intel_pxp_mark_termination_in_progress(struct intel_pxp *pxp); 27 28int intel_pxp_start(struct intel_pxp *pxp); 29 30int intel_pxp_key_check(struct intel_pxp *pxp, 31 struct drm_i915_gem_object *obj, 32 bool assign); 33 34void intel_pxp_invalidate(struct intel_pxp *pxp); 35#else 36static inline void intel_pxp_init(struct intel_pxp *pxp) 37{ 38} 39 40static inline void intel_pxp_fini(struct intel_pxp *pxp) 41{ 42} 43 44static inline int intel_pxp_start(struct intel_pxp *pxp) 45{ 46 return -ENODEV; 47} 48 49static inline bool intel_pxp_is_enabled(const struct intel_pxp *pxp) 50{ 51 return false; 52} 53 54static inline bool intel_pxp_is_active(const struct intel_pxp *pxp) 55{ 56 return false; 57} 58 59static inline int intel_pxp_key_check(struct intel_pxp *pxp, 60 struct drm_i915_gem_object *obj, 61 bool assign) 62{ 63 return -ENODEV; 64} 65#endif 66 67#endif /* __INTEL_PXP_H__ */