Linux Audio

Check our new training course

Linux BSP development engineering services

Need help to port Linux and bootloaders to your hardware?
Loading...
Note: File does not exist in v5.4.
 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
12struct drm_printer;
13struct xe_gt;
14
15void xe_gt_mcr_init_early(struct xe_gt *gt);
16void xe_gt_mcr_init(struct xe_gt *gt);
17
18void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt);
19
20u32 xe_gt_mcr_unicast_read(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
21			   int group, int instance);
22u32 xe_gt_mcr_unicast_read_any(struct xe_gt *gt, struct xe_reg_mcr mcr_reg);
23
24void xe_gt_mcr_unicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
25			     u32 value, int group, int instance);
26void xe_gt_mcr_multicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
27			       u32 value);
28
29bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
30					  struct xe_reg_mcr reg_mcr,
31					  u8 *group, u8 *instance);
32
33void xe_gt_mcr_steering_dump(struct xe_gt *gt, struct drm_printer *p);
34void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group, u16 *instance);
35u32 xe_gt_mcr_steering_info_to_dss_id(struct xe_gt *gt, u16 group, u16 instance);
36
37/*
38 * Loop over each DSS and determine the group and instance IDs that
39 * should be used to steer MCR accesses toward this DSS.
40 * @dss: DSS ID to obtain steering for
41 * @gt: GT structure
42 * @group: steering group ID, data type: u16
43 * @instance: steering instance ID, data type: u16
44 */
45#define for_each_dss_steering(dss, gt, group, instance) \
46	for_each_dss((dss), (gt)) \
47		for_each_if((xe_gt_mcr_get_dss_steering((gt), (dss), &(group), &(instance)), true))
48
49/*
50 * Loop over each DSS available for geometry and determine the group and
51 * instance IDs that should be used to steer MCR accesses toward this DSS.
52 * @dss: DSS ID to obtain steering for
53 * @gt: GT structure
54 * @group: steering group ID, data type: u16
55 * @instance: steering instance ID, data type: u16
56 */
57#define for_each_geometry_dss(dss, gt, group, instance) \
58		for_each_dss_steering(dss, gt, group, instance) \
59			if (xe_gt_has_geometry_dss(gt, dss))
60
61/*
62 * Loop over each DSS available for compute and determine the group and
63 * instance IDs that should be used to steer MCR accesses toward this DSS.
64 * @dss: DSS ID to obtain steering for
65 * @gt: GT structure
66 * @group: steering group ID, data type: u16
67 * @instance: steering instance ID, data type: u16
68 */
69#define for_each_compute_dss(dss, gt, group, instance) \
70		for_each_dss_steering(dss, gt, group, instance) \
71			if (xe_gt_has_compute_dss(gt, dss))
72
73#endif /* _XE_GT_MCR_H_ */