[igt-dev] [PATCH i-g-t 2/2] lib/igt_draw: Add MOCS values for MTL
Jeevan B
jeevan.b at intel.com
Fri Jan 13 06:22:33 UTC 2023
On MTL, we want the table entry labelled "UC (GO:Mem)"
which has index 5. This means that the MOCS value is 10.
Signed-off-by: Jeevan B <jeevan.b at intel.com>
---
lib/i915/intel_mocs.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/i915/intel_mocs.c b/lib/i915/intel_mocs.c
index df541ab0..95f0fbde 100644
--- a/lib/i915/intel_mocs.c
+++ b/lib/i915/intel_mocs.c
@@ -11,6 +11,8 @@
#define DG1_MOCS_WB_IDX 5
#define DG2_MOCS_UC_IDX 1
#define DG2_MOCS_WB_IDX 3
+#define MTL_MOCS_UC_IDX 5
+#define MTL_MOCS_WB_IDX 10
#define GEN12_MOCS_UC_IDX 3
#define GEN12_MOCS_WB_IDX 2
#define XY_BLOCK_COPY_BLT_MOCS_SHIFT 21
@@ -32,13 +34,15 @@ static void get_mocs_index(int fd, struct drm_i915_mocs_index *mocs)
* This helper function is providing current UC as well
* as WB MOCS index based on platform.
*/
- if (IS_DG1(devid)) {
- mocs->uc_index = DG1_MOCS_UC_IDX;
- mocs->wb_index = DG1_MOCS_WB_IDX;
+ if (IS_METEORLAKE(devid)) {
+ mocs->uc_index = MTL_MOCS_UC_IDX;
+ mocs->wb_index = MTL_MOCS_WB_IDX;
} else if (IS_DG2(devid)) {
mocs->uc_index = DG2_MOCS_UC_IDX;
mocs->wb_index = DG2_MOCS_WB_IDX;
-
+ } else if (IS_DG1(devid)) {
+ mocs->uc_index = DG1_MOCS_UC_IDX;
+ mocs->wb_index = DG1_MOCS_WB_IDX;
} else if (IS_GEN12(devid)) {
mocs->uc_index = GEN12_MOCS_UC_IDX;
mocs->wb_index = GEN12_MOCS_WB_IDX;
--
2.19.1
More information about the igt-dev
mailing list