1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2022 Intel Corporation 4 */ 5 6 #ifndef _XE_GT_MCR_H_ 7 #define _XE_GT_MCR_H_ 8 9 #include "regs/xe_reg_defs.h" 10 #include "xe_gt_topology.h" 11 12 struct drm_printer; 13 struct xe_gt; 14 15 void xe_gt_mcr_init_early(struct xe_gt *gt); 16 void xe_gt_mcr_init(struct xe_gt *gt); 17 18 void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt); 19 20 u32 xe_gt_mcr_unicast_read(struct xe_gt *gt, struct xe_reg_mcr mcr_reg, 21 int group, int instance); 22 u32 xe_gt_mcr_unicast_read_any(struct xe_gt *gt, struct xe_reg_mcr mcr_reg); 23 24 void xe_gt_mcr_unicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg, 25 u32 value, int group, int instance); 26 void xe_gt_mcr_multicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg, 27 u32 value); 28 29 void xe_gt_mcr_steering_dump(struct xe_gt *gt, struct drm_printer *p); 30 void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group, u16 *instance); 31 u32 xe_gt_mcr_steering_info_to_dss_id(struct xe_gt *gt, u16 group, u16 instance); 32 33 /* 34 * Loop over each DSS and determine the group and instance IDs that 35 * should be used to steer MCR accesses toward this DSS. 36 * @dss: DSS ID to obtain steering for 37 * @gt: GT structure 38 * @group: steering group ID, data type: u16 39 * @instance: steering instance ID, data type: u16 40 */ 41 #define for_each_dss_steering(dss, gt, group, instance) \ 42 for_each_dss((dss), (gt)) \ 43 for_each_if((xe_gt_mcr_get_dss_steering((gt), (dss), &(group), &(instance)), true)) 44 45 /* 46 * Loop over each DSS available for geometry and determine the group and 47 * instance IDs that should be used to steer MCR accesses toward this DSS. 48 * @dss: DSS ID to obtain steering for 49 * @gt: GT structure 50 * @group: steering group ID, data type: u16 51 * @instance: steering instance ID, data type: u16 52 */ 53 #define for_each_geometry_dss(dss, gt, group, instance) \ 54 for_each_dss_steering(dss, gt, group, instance) \ 55 if (xe_gt_has_geometry_dss(gt, dss)) 56 57 /* 58 * Loop over each DSS available for compute and determine the group and 59 * instance IDs that should be used to steer MCR accesses toward this DSS. 60 * @dss: DSS ID to obtain steering for 61 * @gt: GT structure 62 * @group: steering group ID, data type: u16 63 * @instance: steering instance ID, data type: u16 64 */ 65 #define for_each_compute_dss(dss, gt, group, instance) \ 66 for_each_dss_steering(dss, gt, group, instance) \ 67 if (xe_gt_has_compute_dss(gt, dss)) 68 69 #endif /* _XE_GT_MCR_H_ */ 70