[Intel-xe] [PATCH v2 1/2] drm/xe: Always invalidate GGTT on map during driver load

Matthew Brost matthew.brost at intel.com
Wed Apr 5 02:40:35 UTC 2023


Coalescing GGTT invalidations should work but it creating an issue where
the driver sporadically fails to load. For now just disable coalescing
during load.

Should fix:
https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/232

Signed-off-by: Matthew Brost <matthew.brost at intel.com>
---
 drivers/gpu/drm/xe/xe_ggtt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index a430d1568890..55d0c2554f7b 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -263,6 +263,7 @@ int xe_ggtt_insert_special_node(struct xe_ggtt *ggtt, struct drm_mm_node *node,
 
 void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
 {
+	struct xe_gt *gt = ggtt->gt;
 	u64 start = bo->ggtt_node.start;
 	u64 offset, pte;
 
@@ -278,8 +279,12 @@ void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_bo *bo)
 		xe_ggtt_set_pte(ggtt, start + bo->size, pte);
 	}
 
-	if (ggtt->invalidate) {
-		xe_ggtt_invalidate(ggtt->gt);
+	/*
+	 * XXX: Unsure why without invalidation on every map during driver load
+	 * we can fail the driver load.
+	 */
+	if (ggtt->invalidate || !gt->uc.guc.submission_state.enabled) {
+		xe_ggtt_invalidate(gt);
 		ggtt->invalidate = false;
 	}
 }
-- 
2.34.1



More information about the Intel-xe mailing list