[RFC PATCH 148/162] drm/i915: suspend/resume enable blitter eviction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Venkata Ramana Nayana <venkata.ramana.nayana@xxxxxxxxx>

In suspend mode use blitter eviction before disable the runtime
interrupts and in resume use blitter after the gem resume happens.

Signed-off-by: Venkata Ramana Nayana <venkata.ramana.nayana@xxxxxxxxx>
Cc: Prathap Kumar Valsan <prathap.kumar.valsan@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_drv.c | 36 +++++++++++++--------------------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 7115f4db5043..eb5383e4a30b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1110,13 +1110,6 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)
 	struct intel_memory_region *mem;
 	int id, ret = 0;
 
-	/*
-	 * FIXME: Presently using memcpy,
-	 * will replace with blitter once
-	 * fix the issues.
-	 */
-	i915->params.enable_eviction = 1;
-
 	for_each_memory_region(mem, i915, id) {
 		struct list_head still_in_list;
 		INIT_LIST_HEAD(&still_in_list);
@@ -1173,7 +1166,6 @@ static int intel_dmem_evict_buffers(struct drm_device *dev, bool in_suspend)
 			mutex_unlock(&mem->objects.lock);
 		}
 	}
-	i915->params.enable_eviction = 3;
 	return ret;
 }
 
@@ -1235,6 +1227,18 @@ static int i915_drm_suspend(struct drm_device *dev)
 
 	intel_dp_mst_suspend(dev_priv);
 
+	if (HAS_LMEM(dev_priv))	{
+		ret = intel_dmem_evict_buffers(dev, true);
+		if (ret)
+			return ret;
+
+		i915_teardown_blt_windows(dev_priv);
+
+		ret = i915_gem_suspend_ppgtt_mappings(dev_priv);
+		if (ret)
+			return ret;
+	}
+
 	intel_runtime_pm_disable_interrupts(dev_priv);
 	intel_hpd_cancel_work(dev_priv);
 
@@ -1251,18 +1255,6 @@ static int i915_drm_suspend(struct drm_device *dev)
 
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED, true);
 
-	if (HAS_LMEM(dev_priv))	{
-		ret = intel_dmem_evict_buffers(dev, true);
-		if (ret)
-			return ret;
-
-		i915_teardown_blt_windows(dev_priv);
-
-		ret = i915_gem_suspend_ppgtt_mappings(dev_priv);
-		if (ret)
-			return ret;
-	}
-
 	dev_priv->suspend_count++;
 
 	intel_csr_ucode_suspend(dev_priv);
@@ -1418,6 +1410,8 @@ static int i915_drm_resume(struct drm_device *dev)
 
 	drm_mode_config_reset(dev);
 
+	i915_gem_resume(dev_priv);
+
 	if (HAS_LMEM(dev_priv)) {
 		i915_gem_restore_ppgtt_mappings(dev_priv);
 
@@ -1430,8 +1424,6 @@ static int i915_drm_resume(struct drm_device *dev)
 			DRM_ERROR("i915_resume:i915_gem_object_pin_pages failed with err=%d\n", ret);
 	}
 
-	i915_gem_resume(dev_priv);
-
 	intel_modeset_init_hw(dev_priv);
 	intel_init_clock_gating(dev_priv);
 	intel_hpd_init(dev_priv);
-- 
2.26.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux