summaryrefslogtreecommitdiff
path: root/lib/xe/xe_ggtt.h
diff options
context:
space:
mode:
authorLukasz Laguna <lukasz.laguna@intel.com>2026-07-30 11:38:06 +0200
committerLukasz Laguna <lukasz.laguna@intel.com>2026-08-04 08:13:23 +0200
commitde6fcadec516caa8942775f27d17aef9b12dc358 (patch)
treeaec6664f859e634561ef0217106f99752abfa23e /lib/xe/xe_ggtt.h
parent270bc13954ccab274f11ea80b4a857ad8b9e194b (diff)
lib/xe/xe_ggtt: Extract generic GGTT code into library
Add a shared xe_ggtt library with a common GGTT definitions, including bitfields, bitmasks and helpers. Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Diffstat (limited to 'lib/xe/xe_ggtt.h')
-rw-r--r--lib/xe/xe_ggtt.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/xe/xe_ggtt.h b/lib/xe/xe_ggtt.h
new file mode 100644
index 000000000..5e4038591
--- /dev/null
+++ b/lib/xe/xe_ggtt.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2026 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __XE_GGTT_H__
+#define __XE_GGTT_H__
+
+#include <stdint.h>
+
+#define GGTT_PTE_ADDR_MASK GENMASK_ULL(45, 12)
+#define TGL_GGTT_PTE_ADDR_MASK GENMASK_ULL(38, 12)
+#define GGTT_PTE_ADDR_SHIFT 12
+
+typedef uint64_t xe_ggtt_pte_t;
+typedef uint64_t xe_ggtt_pte_mask_t;
+
+xe_ggtt_pte_mask_t xe_ggtt_get_gpa_mask(int pf_fd);
+uint64_t xe_ggtt_pte_get_gpa(int pf_fd, xe_ggtt_pte_t pte);
+
+#endif /* __XE_GGTT_H__ */