1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2025 Intel Corporation 4 */ 5 6 #ifndef _XE_SRIOV_VF_CCS_H_ 7 #define _XE_SRIOV_VF_CCS_H_ 8 9 #include "xe_device_types.h" 10 #include "xe_sriov.h" 11 #include "xe_sriov_vf_ccs_types.h" 12 13 struct drm_printer; 14 struct ttm_resource; 15 struct xe_device; 16 struct xe_bo; 17 18 int xe_sriov_vf_ccs_init(struct xe_device *xe); 19 int xe_sriov_vf_ccs_attach_bo(struct xe_bo *bo, struct ttm_resource *new_mem); 20 int xe_sriov_vf_ccs_detach_bo(struct xe_bo *bo); 21 int xe_sriov_vf_ccs_register_context(struct xe_device *xe); 22 void xe_sriov_vf_ccs_rebase(struct xe_device *xe); 23 void xe_sriov_vf_ccs_print(struct xe_device *xe, struct drm_printer *p); 24 void xe_sriov_vf_ccs_rw_update_bb_addr(struct xe_sriov_vf_ccs_ctx *ctx); 25 xe_sriov_vf_ccs_ready(struct xe_device * xe)26static inline bool xe_sriov_vf_ccs_ready(struct xe_device *xe) 27 { 28 xe_assert(xe, IS_SRIOV_VF(xe)); 29 return xe->sriov.vf.ccs.initialized; 30 } 31 32 #define IS_VF_CCS_READY(xe) ({ \ 33 struct xe_device *xe__ = (xe); \ 34 IS_SRIOV_VF(xe__) && xe_sriov_vf_ccs_ready(xe__); \ 35 }) 36 37 #endif 38