All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915: Add gpu hw state capture helper
@ 2014-12-09 16:04 Mika Kuoppala
  2014-12-09 16:04 ` [PATCH 2/4] drm/i915: Add i915_gpu_state debugfs entry Mika Kuoppala
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Mika Kuoppala @ 2014-12-09 16:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: miku

In the following commits, we want to capture the hw state
also without any errors. Carve out the helper out from error
capture parts.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 41 +++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index c4536e1..dcea1fa 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1265,28 +1265,17 @@ static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
 	error->suspend_count = dev_priv->suspend_count;
 }
 
-/**
- * i915_capture_error_state - capture an error record for later analysis
- * @dev: drm device
- *
- * Should be called when an error is detected (either a hang or an error
- * interrupt) to capture error state from the time of the error.  Fills
- * out a structure which becomes available in debugfs for user level tools
- * to pick up.
- */
-void i915_capture_error_state(struct drm_device *dev, bool wedged,
-			      const char *error_msg)
+static struct drm_i915_error_state *
+__i915_capture_gpu_state(struct drm_device *dev)
 {
-	static bool warned;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_i915_error_state *error;
-	unsigned long flags;
 
 	/* Account for pipe specific data like PIPE*STAT */
 	error = kzalloc(sizeof(*error), GFP_ATOMIC);
 	if (!error) {
 		DRM_DEBUG_DRIVER("out of memory, not capturing error state\n");
-		return;
+		return NULL;
 	}
 
 	kref_init(&error->ref);
@@ -1302,6 +1291,30 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged,
 	error->overlay = intel_overlay_capture_error_state(dev);
 	error->display = intel_display_capture_error_state(dev);
 
+	return error;
+}
+
+/**
+ * i915_capture_error_state - capture an error record for later analysis
+ * @dev: drm device
+ *
+ * Should be called when an error is detected (either a hang or an error
+ * interrupt) to capture error state from the time of the error.  Fills
+ * out a structure which becomes available in debugfs for user level tools
+ * to pick up.
+ */
+void i915_capture_error_state(struct drm_device *dev, bool wedged,
+			      const char *error_msg)
+{
+	static bool warned;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_i915_error_state *error;
+	unsigned long flags;
+
+	error = __i915_capture_gpu_state(dev);
+	if (error == NULL)
+		return;
+
 	i915_error_capture_msg(dev, error, wedged, error_msg);
 	DRM_INFO("%s\n", error->error_msg);
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-10  8:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 16:04 [PATCH 1/4] drm/i915: Add gpu hw state capture helper Mika Kuoppala
2014-12-09 16:04 ` [PATCH 2/4] drm/i915: Add i915_gpu_state debugfs entry Mika Kuoppala
2014-12-09 16:04 ` [PATCH 3/4] drm/i915: Add i915_gpu_state_unsafe " Mika Kuoppala
2014-12-09 21:00   ` Chris Wilson
2014-12-09 16:04 ` [PATCH 4/4] drm/i915: Rename drm_i915_error_state_buf to intel_strbuf Mika Kuoppala
2014-12-10  1:20   ` shuang.he
2014-12-10  8:37 ` [PATCH 1/4] drm/i915: Add gpu hw state capture helper Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.