62 lines · c
1/* SPDX-License-Identifier: MIT */2/*3 * Copyright © 2023 Intel Corporation4 */5 6#ifndef _XE_PAT_H_7#define _XE_PAT_H_8 9#include <linux/types.h>10 11struct drm_printer;12struct xe_device;13struct xe_gt;14 15/**16 * struct xe_pat_table_entry - The pat_index encoding and other meta information.17 */18struct xe_pat_table_entry {19 /**20 * @value: The platform specific value encoding the various memory21 * attributes (this maps to some fixed pat_index). So things like22 * caching, coherency, compression etc can be encoded here.23 */24 u32 value;25 26 /**27 * @coh_mode: The GPU coherency mode that @value maps to.28 */29#define XE_COH_NONE 130#define XE_COH_AT_LEAST_1WAY 231 u16 coh_mode;32};33 34/**35 * xe_pat_init_early - SW initialization, setting up data based on device36 * @xe: xe device37 */38void xe_pat_init_early(struct xe_device *xe);39 40/**41 * xe_pat_init - Program HW PAT table42 * @gt: GT structure43 */44void xe_pat_init(struct xe_gt *gt);45 46/**47 * xe_pat_dump - Dump PAT table48 * @gt: GT structure49 * @p: Printer to dump info to50 */51void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);52 53/**54 * xe_pat_index_get_coh_mode - Extract the coherency mode for the given55 * pat_index.56 * @xe: xe device57 * @pat_index: The pat_index to query58 */59u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index);60 61#endif62