xref: /linux/drivers/gpu/drm/xe/xe_reg_sr_types.h (revision 021bc4b9)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2022 Intel Corporation
4  */
5 
6 #ifndef _XE_REG_SR_TYPES_
7 #define _XE_REG_SR_TYPES_
8 
9 #include <linux/types.h>
10 #include <linux/xarray.h>
11 
12 #include "regs/xe_reg_defs.h"
13 
14 struct xe_reg_sr_entry {
15 	struct xe_reg	reg;
16 	u32		clr_bits;
17 	u32		set_bits;
18 	/* Mask for bits to consider when reading value back */
19 	u32		read_mask;
20 };
21 
22 struct xe_reg_sr {
23 	struct {
24 		struct xe_reg_sr_entry *arr;
25 		unsigned int used;
26 		unsigned int allocated;
27 		unsigned int grow_step;
28 	} pool;
29 	struct xarray xa;
30 	const char *name;
31 
32 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
33 	unsigned int errors;
34 #endif
35 };
36 
37 #endif
38