[Intel-gfx] [PATCH 6/9] drm/i915: Use only the default context for ILK

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 5 15:18:38 CEST 2013


From: Ben Widawsky <ben at bwidawsk.net>

The ILK renderctx predates the generic i915 context code. With the
patches before this, I believe I have properly eased the transition to
simply using the regular default context instead of the special
renderctx.

This untangles the weirdness from the last commit, and finishes the
transition.

The powerctx is still needed since that is a special ILK only thing. VLV
has a similar funkiness, so we could probably try to join those two, but
I see no point.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Tested-by: Chris Wilson <chris at chris-wilson.co.uk> # X still works!
---
 drivers/gpu/drm/i915/i915_debugfs.c     |    6 -----
 drivers/gpu/drm/i915/i915_drv.h         |    2 --
 drivers/gpu/drm/i915/i915_gem_context.c |    5 ----
 drivers/gpu/drm/i915/intel_pm.c         |   40 -------------------------------
 4 files changed, 53 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 76da70f..691ea94 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1454,12 +1454,6 @@ static int i915_context_status(struct seq_file *m, void *unused)
 		seq_putc(m, '\n');
 	}
 
-	if (dev_priv->ips.renderctx.obj) {
-		seq_puts(m, "render context ");
-		describe_obj(m, dev_priv->ips.renderctx.obj);
-		seq_putc(m, '\n');
-	}
-
 	for_each_ring(ring, dev_priv, i) {
 		if (ring->default_context) {
 			seq_printf(m, "HW default context %s ring ", ring->name);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6e3a9a8..b039ffb 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -873,7 +873,6 @@ struct intel_ilk_power_mgmt {
 	int r_t;
 
 	struct drm_i915_gem_object *pwrctx;
-	struct i915_hw_context renderctx;
 };
 
 /* Power well structure for haswell */
@@ -2063,7 +2062,6 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
 				  struct drm_file *file);
 int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
 				   struct drm_file *file);
-int ironlake_setup_rc6_hw_context(struct drm_i915_private *dev_priv);
 
 /* i915_gem_gtt.c */
 void i915_gem_cleanup_aliasing_ppgtt(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index aeb2012..12b66cf 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -581,8 +581,3 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
 	DRM_DEBUG_DRIVER("HW context %d destroyed\n", args->ctx_id);
 	return 0;
 }
-
-int ironlake_setup_rc6_hw_context(struct drm_i915_private *dev_priv)
-{
-	return do_switch(&dev_priv->ips.renderctx);
-}
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index e68fdb4..2dc8f3c 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3877,12 +3877,6 @@ void ironlake_teardown_rc6(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	if (dev_priv->ips.renderctx.obj) {
-		i915_gem_object_unpin(dev_priv->ips.renderctx.obj);
-		drm_gem_object_unreference(&dev_priv->ips.renderctx.obj->base);
-		dev_priv->ips.renderctx.obj = NULL;
-	}
-
 	if (dev_priv->ips.pwrctx) {
 		i915_gem_object_unpin(dev_priv->ips.pwrctx);
 		drm_gem_object_unreference(&dev_priv->ips.pwrctx->base);
@@ -3912,15 +3906,6 @@ static int ironlake_setup_rc6(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	if (dev_priv->ips.renderctx.obj == NULL)
-		dev_priv->ips.renderctx.obj = intel_alloc_context_page(dev);
-	if (!dev_priv->ips.renderctx.obj)
-		return -ENOMEM;
-	else {
-		dev_priv->ips.renderctx.id = DEFAULT_CONTEXT_ID;
-		dev_priv->ips.renderctx.ring = &dev_priv->ring[RCS];
-	}
-
 	if (dev_priv->ips.pwrctx == NULL)
 		dev_priv->ips.pwrctx = intel_alloc_context_page(dev);
 	if (!dev_priv->ips.pwrctx) {
@@ -3934,8 +3919,6 @@ static int ironlake_setup_rc6(struct drm_device *dev)
 static void ironlake_enable_rc6(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
-	bool was_interruptible;
 	int ret;
 
 	/* rc6 disabled by default due to repeated reports of hanging during
@@ -3950,29 +3933,6 @@ static void ironlake_enable_rc6(struct drm_device *dev)
 	if (ret)
 		return;
 
-	was_interruptible = dev_priv->mm.interruptible;
-	dev_priv->mm.interruptible = false;
-
-	ret = ironlake_setup_rc6_hw_context(dev_priv);
-	if (ret) {
-		ironlake_teardown_rc6(dev);
-		dev_priv->mm.interruptible = was_interruptible;
-		return;
-	}
-
-	/*
-	 * Wait for the command parser to advance past MI_SET_CONTEXT. The HW
-	 * does an implicit flush, combined with MI_FLUSH above, it should be
-	 * safe to assume that renderctx is valid
-	 */
-	ret = intel_ring_idle(ring);
-	dev_priv->mm.interruptible = was_interruptible;
-	if (ret) {
-		DRM_ERROR("failed to enable ironlake power savings\n");
-		ironlake_teardown_rc6(dev);
-		return;
-	}
-
 	I915_WRITE(PWRCTXA, i915_gem_obj_ggtt_offset(dev_priv->ips.pwrctx) | PWRCTX_EN);
 	I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT);
 }
-- 
1.7.9.5




More information about the Intel-gfx mailing list