[PATCH 3/4] drm/i915: Enable GGTT blitting in MTL

Nirmoy Das nirmoy.das at intel.com
Sat Aug 12 08:47:54 UTC 2023


MTL can hang because of a HW bug while parallel reading/writing
from/to LMEM/GTTMMADR BAR so try to reduce GGTT update
related pci transactions with blitter command as recommended
for Wa_22018444074.

Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 4 ++++
 drivers/gpu/drm/i915/i915_vma.c       | 9 +++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 5a942af0a14e..6448d187941a 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -280,6 +280,9 @@ int intel_gt_resume(struct intel_gt *gt)
 out_fw:
 	intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_ALL);
 	intel_gt_pm_put(gt);
+	if (!err)
+		intel_engine_blitter_context_set_ready(gt, true);
+
 	return err;
 
 err_wedged:
@@ -306,6 +309,7 @@ static void wait_for_suspend(struct intel_gt *gt)
 
 void intel_gt_suspend_prepare(struct intel_gt *gt)
 {
+	intel_engine_blitter_context_set_ready(gt, false);
 	user_forcewake(gt, true);
 	wait_for_suspend(gt);
 }
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index e52089564d79..08789f7b59dd 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -35,6 +35,7 @@
 #include "gt/intel_gt.h"
 #include "gt/intel_gt_requests.h"
 #include "gt/intel_tlb.h"
+#include "gt/intel_engine_pm.h"
 
 #include "i915_drv.h"
 #include "i915_gem_evict.h"
@@ -1423,8 +1424,10 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,
 	if (err)
 		return err;
 
-	if (flags & PIN_GLOBAL)
+	if (flags & PIN_GLOBAL) {
 		wakeref = intel_runtime_pm_get(&vma->vm->i915->runtime_pm);
+		intel_engine_pm_get(to_gt(vma->vm->i915)->engine[BCS0]);
+	}
 
 	if (flags & vma->vm->bind_async_flags) {
 		/* lock VM */
@@ -1560,8 +1563,10 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,
 	if (work)
 		dma_fence_work_commit_imm(&work->base);
 err_rpm:
-	if (wakeref)
+	if (wakeref) {
+		intel_engine_pm_put(to_gt(vma->vm->i915)->engine[BCS0]);
 		intel_runtime_pm_put(&vma->vm->i915->runtime_pm, wakeref);
+	}
 
 	if (moving)
 		dma_fence_put(moving);
-- 
2.39.0



More information about the Intel-gfx-trybot mailing list