File: xe_pat.h

package info (click to toggle)
linux 6.17.7-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,734,408 kB
  • sloc: ansic: 26,679,265; asm: 271,207; sh: 147,319; python: 75,916; makefile: 57,295; perl: 36,942; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (61 lines) | stat: -rw-r--r-- 1,316 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2023 Intel Corporation
 */

#ifndef _XE_PAT_H_
#define _XE_PAT_H_

#include <linux/types.h>

struct drm_printer;
struct xe_device;
struct xe_gt;

/**
 * struct xe_pat_table_entry - The pat_index encoding and other meta information.
 */
struct xe_pat_table_entry {
	/**
	 * @value: The platform specific value encoding the various memory
	 * attributes (this maps to some fixed pat_index). So things like
	 * caching, coherency, compression etc can be encoded here.
	 */
	u32 value;

	/**
	 * @coh_mode: The GPU coherency mode that @value maps to.
	 */
#define XE_COH_NONE          1
#define XE_COH_AT_LEAST_1WAY 2
	u16 coh_mode;
};

/**
 * xe_pat_init_early - SW initialization, setting up data based on device
 * @xe: xe device
 */
void xe_pat_init_early(struct xe_device *xe);

/**
 * xe_pat_init - Program HW PAT table
 * @gt: GT structure
 */
void xe_pat_init(struct xe_gt *gt);

/**
 * xe_pat_dump - Dump PAT table
 * @gt: GT structure
 * @p: Printer to dump info to
 */
void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);

/**
 * xe_pat_index_get_coh_mode - Extract the coherency mode for the given
 * pat_index.
 * @xe: xe device
 * @pat_index: The pat_index to query
 */
u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index);

#endif