summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_mert.h
blob: fc977203692d7b746f5d3ee635d26ff4587dc6d8 (plain)
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
/* SPDX-License-Identifier: MIT */
/*
 * Copyright(c) 2025, Intel Corporation. All rights reserved.
 */

#ifndef _XE_MERT_H_
#define _XE_MERT_H_

#include <linux/completion.h>
#include <linux/spinlock.h>
#include <linux/types.h>

struct xe_device;

/**
 * struct xe_mert - MERT related data
 */
struct xe_mert {
	/** @lock: protects the TLB invalidation status */
	spinlock_t lock;
	/** @tlb_inv_triggered: indicates if TLB invalidation was triggered */
	bool tlb_inv_triggered;
	/** @tlb_inv_done: completion of TLB invalidation */
	struct completion tlb_inv_done;
};

#ifdef CONFIG_PCI_IOV
void xe_mert_init_early(struct xe_device *xe);
int xe_mert_invalidate_lmtt(struct xe_device *xe);
void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl);
#else
static inline void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl) { }
#endif

#endif