Return-Path: X-Original-To: mika.kuoppala@linux.intel.com Delivered-To: mika.kuoppala@linux.intel.com Received: from linux.jf.intel.com [10.23.219.25] by gaia with IMAP (fetchmail-6.3.21) for (single-drop); Mon, 17 Jun 2013 14:27:26 +0300 (EEST) Received: from fmsmga001.fm.intel.com (fmsmga001.fm.intel.com [10.253.24.23]) by linux.intel.com (Postfix) with ESMTP id 6D68B6A4093 for ; Mon, 17 Jun 2013 04:26:23 -0700 (PDT) Received: from fmsmga102.fm.intel.com ([10.1.193.69]) by fmsmga001-1.fm.intel.com with ESMTP; 17 Jun 2013 04:27:08 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMBAA/xvlGD/NKxlGdsb2JhbABagzrALRYOAQEBAQkLCQkUBCSCJQIEAQEkEwwKHg4DAQIGAkAEBAgDASMBSAWICQQIuDSOD4UfA5R8g26Ea44/gWc X-IronPort-AV: E=Sophos;i="4.87,880,1363158000"; d="scan'208";a="1346863003" Received: from gabe.freedesktop.org ([131.252.210.177]) by mtab.intel.com with ESMTP; 17 Jun 2013 04:27:27 -0700 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D015FE5FA9 for ; Mon, 17 Jun 2013 04:26:32 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (s16502780.onlinehome-server.info [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id DE69DE5DDB for ; Mon, 17 Jun 2013 04:26:05 -0700 (PDT) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.73.22; Received: from arrandale.alporthouse.com (unverified [78.156.73.22]) by fireflyinternet.com (Firefly Internet (M2)) with ESMTP id 8375185-1500048 for multiple; Mon, 17 Jun 2013 12:27:53 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 17 Jun 2013 12:25:50 +0100 Message-Id: <1371468352-32655-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: 78.156.73.22 Subject: [Intel-gfx] [PATCH 1/3] drm/i915: Fix retrieval of hangcheck stats 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: intel-gfx-bounces+mika.kuoppala=linux.intel.com@lists.freedesktop.org Errors-To: intel-gfx-bounces+mika.kuoppala=linux.intel.com@lists.freedesktop.org The default context is always supported (as it contains the global hangcheck stats) and the contexts for hangcheck are not limited to any ring. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65845 Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem_context.c | 23 ++++++++--------------- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 3 +-- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5be8856..c0d1af2 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1864,7 +1864,7 @@ static inline void i915_gem_context_unreference(struct i915_hw_context *ctx) } struct i915_ctx_hang_stats * __must_check -i915_gem_context_get_hang_stats(struct intel_ring_buffer *ring, +i915_gem_context_get_hang_stats(struct drm_device *dev, struct drm_file *file, u32 id); int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index b46f850..8cd675f 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -305,31 +305,24 @@ static int context_idr_cleanup(int id, void *p, void *data) } struct i915_ctx_hang_stats * -i915_gem_context_get_hang_stats(struct intel_ring_buffer *ring, +i915_gem_context_get_hang_stats(struct drm_device *dev, struct drm_file *file, u32 id) { - struct drm_i915_private *dev_priv = ring->dev->dev_private; + struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_file_private *file_priv = file->driver_priv; - struct i915_hw_context *to; - - if (dev_priv->hw_contexts_disabled) - return ERR_PTR(-ENOENT); - - if (ring->id != RCS) - return ERR_PTR(-EINVAL); - - if (file == NULL) - return ERR_PTR(-EINVAL); + struct i915_hw_context *ctx; if (id == DEFAULT_CONTEXT_ID) return &file_priv->hang_stats; - to = i915_gem_context_get(file->driver_priv, id); - if (to == NULL) + ctx = NULL; + if (!dev_priv->hw_contexts_disabled) + ctx = i915_gem_context_get(file->driver_priv, id); + if (ctx == NULL) return ERR_PTR(-ENOENT); - return &to->hang_stats; + return &ctx->hang_stats; } void i915_gem_context_close(struct drm_device *dev, struct drm_file *file) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index a465a3b..da3dfd7 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1040,8 +1040,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, if (ret) goto err; - hs = i915_gem_context_get_hang_stats(&dev_priv->ring[RCS], - file, ctx_id); + hs = i915_gem_context_get_hang_stats(dev, file, ctx_id); if (IS_ERR(hs)) { ret = PTR_ERR(hs); goto err; -- 1.8.3.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx