[Intel-gfx] [PATCH] drm/i915: Fix execlist cleanup bug

Dave Gordon david.s.gordon at intel.com
Thu Oct 30 16:30:03 CET 2014


From: John Harrison <John.C.Harrison at Intel.com>

Check whether each engine exists before trying to clean up the
corresponding logical ring.

Change-Id: I31b1ed941824db2d6bd7233360dbce05671979a8
Signed-off-by: Dave Gordon <david.s.gordon at intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index cd74e5c..7a7d30a 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1444,13 +1444,17 @@ int intel_logical_rings_init(struct drm_device *dev)
 	return 0;
 
 cleanup_bsd2_ring:
-	intel_logical_ring_cleanup(&dev_priv->ring[VCS2]);
+	if (HAS_BSD2(dev))
+		intel_logical_ring_cleanup(&dev_priv->ring[VCS2]);
 cleanup_vebox_ring:
-	intel_logical_ring_cleanup(&dev_priv->ring[VECS]);
+	if (HAS_VEBOX(dev))
+		intel_logical_ring_cleanup(&dev_priv->ring[VECS]);
 cleanup_blt_ring:
-	intel_logical_ring_cleanup(&dev_priv->ring[BCS]);
+	if (HAS_BLT(dev))
+		intel_logical_ring_cleanup(&dev_priv->ring[BCS]);
 cleanup_bsd_ring:
-	intel_logical_ring_cleanup(&dev_priv->ring[VCS]);
+	if (HAS_BSD(dev))
+		intel_logical_ring_cleanup(&dev_priv->ring[VCS]);
 cleanup_render_ring:
 	intel_logical_ring_cleanup(&dev_priv->ring[RCS]);
 
-- 
1.7.9.5




More information about the Intel-gfx mailing list