@@ -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;