From: oscar.mateo@intel.com Subject: [PATCH 34/49] drm/i915/bdw: Fix reset stats ioctl with LR contexts Date: Thu, 27 Mar 2014 18:00:03 +0000 Message-ID: <1395943218-7708-35-git-send-email-oscar.mateo@intel.com> References: <1395943218-7708-1-git-send-email-oscar.mateo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 54D3F6E9E7 for ; Thu, 27 Mar 2014 10:08:25 -0700 (PDT) In-Reply-To: <1395943218-7708-1-git-send-email-oscar.mateo@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: Oscar Mateo Since we cannot tell apart which specific context the user refers too, get stats from all the per-engine cotexts with the same ID. Signed-off-by: Oscar Mateo --- drivers/gpu/drm/i915/intel_uncore.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index c3832d9..4fe3e4a 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -931,6 +931,21 @@ int i915_get_reset_stats_ioctl(struct drm_device *dev, args->batch_active = hs->batch_active; args->batch_pending = hs->batch_pending; + if (dev_priv->lrc_enabled) { + struct i915_hw_context *cursor = NULL; + list_for_each_entry(cursor, &ctx->dependent_contexts, dependent_contexts) { + hs = &cursor->hang_stats; + + if (capable(CAP_SYS_ADMIN)) + args->reset_count += i915_reset_count(&dev_priv->gpu_error); + else + args->reset_count = 0; + + args->batch_active += hs->batch_active; + args->batch_pending += hs->batch_pending; + } + } + mutex_unlock(&dev->struct_mutex); return 0; -- 1.9.0