From patchwork Sun Jul 14 16:22:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2827229 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 149FDC0AB2 for ; Sun, 14 Jul 2013 16:20:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E81A20124 for ; Sun, 14 Jul 2013 16:20:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 14AF620117 for ; Sun, 14 Jul 2013 16:20:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 003D0E6A67 for ; Sun, 14 Jul 2013 09:20:40 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 86AA7E6227 for ; Sun, 14 Jul 2013 09:19:39 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 99) id 2EE188867F; Sun, 14 Jul 2013 16:19:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lundgren.kumite (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by shiva.localdomain (Postfix) with ESMTPSA id A87EB8864E; Sun, 14 Jul 2013 16:19:37 +0000 (UTC) From: Ben Widawsky To: Intel GFX Date: Sun, 14 Jul 2013 09:22:46 -0700 Message-Id: <1373818974-23102-3-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1373818974-23102-1-git-send-email-ben@bwidawsk.net> References: <1373818974-23102-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 2/9] drm/i915: Convert renderctx to a regular context X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Virus-Scanned: ClamAV using ClamSMTP The medium term plan is to just use the existing context code on ILK as well. The conversion just assists. Therefore, this is somewhat transient as I plan to kill renderctx quite soon. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++-- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 18 +++++++++++------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 8637979..5e88ef6 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1347,9 +1347,9 @@ static int i915_context_status(struct seq_file *m, void *unused) seq_putc(m, '\n'); } - if (dev_priv->ips.renderctx) { + if (dev_priv->ips.renderctx.obj) { seq_puts(m, "render context "); - describe_obj(m, dev_priv->ips.renderctx); + describe_obj(m, dev_priv->ips.renderctx.obj); seq_putc(m, '\n'); } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 03ab05c..64c6ae0 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -789,7 +789,7 @@ struct intel_ilk_power_mgmt { int r_t; struct drm_i915_gem_object *pwrctx; - struct drm_i915_gem_object *renderctx; + struct i915_hw_context renderctx; }; /* Power well structure for haswell */ diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index ab72c72..2c25006 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -589,7 +589,7 @@ int ironlake_setup_rc6_hw_context(struct drm_i915_private *dev_priv) intel_ring_emit(ring, MI_SUSPEND_FLUSH | MI_SUSPEND_FLUSH_EN); intel_ring_emit(ring, MI_SET_CONTEXT); - intel_ring_emit(ring, i915_gem_obj_ggtt_offset(dev_priv->ips.renderctx) | + intel_ring_emit(ring, i915_gem_obj_ggtt_offset(dev_priv->ips.renderctx.obj) | MI_MM_SPACE_GTT | MI_SAVE_EXT_STATE_EN | MI_RESTORE_EXT_STATE_EN | diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 2673602..10f8f7cd 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3615,10 +3615,10 @@ void ironlake_teardown_rc6(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; - if (dev_priv->ips.renderctx) { - i915_gem_object_unpin(dev_priv->ips.renderctx); - drm_gem_object_unreference(&dev_priv->ips.renderctx->base); - dev_priv->ips.renderctx = NULL; + 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) { @@ -3650,10 +3650,14 @@ static int ironlake_setup_rc6(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; - if (dev_priv->ips.renderctx == NULL) - dev_priv->ips.renderctx = intel_alloc_context_page(dev); - if (!dev_priv->ips.renderctx) + 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);