summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2024-04-24 00:43:16 -0700
committerEric Engestrom <eric@engestrom.ch>2024-04-30 14:23:25 +0200
commit5d0c48b817460da58b57fb64d90294dced772f77 (patch)
tree1d7f48609fe3562e9f76f5bd0a0169443c66caa4
parente1332ee978f70cc080478f72bd6f96f5286bc42d (diff)
isl: Set MOCS to uncached for Gfx12.0 blitter sources/destinations
We were accidentally leaving XY_BLOCK_COPY_BLT's Source and Destination MOCS fields set to 0 (Error: Reserved for Non-Use) on Gfx12.0 systems. This was causing assert fails in debug builds, since we try to ensure that we don't do that. In theory, MOCS 0 is supposed to be equivalent to MOCS 2 (all the caching), but...we probably ought to use MOCS 3 (uncached). Every Gfx12.5+ platform requires it, so although there isn't a note about Gfx12.0 needing that, it's possible that it does. We're currently only using the blitter for DRI PRIME blits on Gfx12.0, anyway, and I think we're flushing all the caches regardless. This bug was somewhat obscure to hit: - You need a hybrid graphics system with Gfx12.0 and some other GPU - You have to be using "reverse PRIME", i.e. rendering on the integrated GPU and displaying on the discrete one. This is not the common case. - You have to be using a debug build. No observable performance delta in GfxBench5 Car Chase (an arbitrary program) when rendering on Alderlake GT1 and displaying on an Arc A770. Fixes: 194afe84163 ("anv/iris/blorp: use the right MOCS values for each engine") Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rohan Garg <rohan.garg@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28894> (cherry picked from commit e6fb3ba03798fc2550bdb5ec6651690a34ac3509)
-rw-r--r--.pick_status.json2
-rw-r--r--src/intel/isl/isl.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 8bc94ebed8f..df4dfd56538 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2514,7 +2514,7 @@
"description": "isl: Set MOCS to uncached for Gfx12.0 blitter sources/destinations",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "194afe841635e43d55c4f71f4122c6048f585450",
"notes": null
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 1e19db1c903..3793ea5d929 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -175,6 +175,8 @@ isl_device_setup_mocs(struct isl_device *dev)
dev->mocs.external = 5 << 1;
/* UC */
dev->mocs.uncached = 1 << 1;
+ dev->mocs.blitter_dst = 1 << 1;
+ dev->mocs.blitter_src = 1 << 1;
} else {
/* TC=1/LLC Only, LeCC=1/UC, LRUM=0, L3CC=3/WB */
dev->mocs.external = 61 << 1;
@@ -185,6 +187,10 @@ isl_device_setup_mocs(struct isl_device *dev)
/* L1 - HDC:L1 + L3 + LLC */
dev->mocs.l1_hdc_l3_llc = 48 << 1;
+
+ /* Uncached */
+ dev->mocs.blitter_dst = 3 << 1;
+ dev->mocs.blitter_src = 3 << 1;
}
/* Protected is just an additional flag. */
dev->mocs.protected_mask = 1 << 0;