diff mbox

[RFC,10/12] drm/i915: Always add BOs to capture list if AubCrash is enabled

Message ID 1509127275-22121-11-git-send-email-oscar.mateo@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

oscar.mateo@intel.com Oct. 27, 2017, 6:01 p.m. UTC
If we want the AUB file to be complete (and, therefore, more useful)
we need to capture all BOs in use, we cannot leave that to the UMD
as before.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Cc: Chris Wilson <chris@chris-wsilon.co.uk>
---
 drivers/gpu/drm/i915/i915_aubcrash.h       | 12 ++++++++++++
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

Comments

Chris Wilson Oct. 27, 2017, 6:26 p.m. UTC | #1
Quoting Oscar Mateo (2017-10-27 19:01:13)
> If we want the AUB file to be complete (and, therefore, more useful)
> we need to capture all BOs in use, we cannot leave that to the UMD
> as before.

There's a very good reason why we don't try to capture the entirety of
mem from within the error capture. So no. There's no way we are selling
that as absolutely necessary use of GFP_ATOMIC and stop_machine.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_aubcrash.h b/drivers/gpu/drm/i915/i915_aubcrash.h
index 2eed388..b42307e 100644
--- a/drivers/gpu/drm/i915/i915_aubcrash.h
+++ b/drivers/gpu/drm/i915/i915_aubcrash.h
@@ -37,6 +37,12 @@  void i915_error_page_walk(struct i915_address_space *vm,
 int i915_error_state_to_aub(struct drm_i915_error_state_buf *m,
                             const struct i915_gpu_state *error);
 
+static inline bool i915_error_state_should_capture(struct i915_vma *vma,
+						   struct i915_vma *batch)
+{
+	return ((INTEL_GEN(vma->vm->i915) >= 8) && (vma != batch));
+}
+
 #else
 
 static inline void i915_error_record_ppgtt(struct i915_gpu_state *error,
@@ -62,6 +68,12 @@  static inline int i915_error_state_to_aub(struct drm_i915_error_state_buf *m,
 	return 0;
 }
 
+static inline bool i915_error_state_should_capture(struct i915_vma *vma,
+						   struct i915_vma *batch)
+{
+	return false;
+}
+
 #endif
 
 #endif
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3d71907..47559a4 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -38,6 +38,7 @@ 
 #include "i915_drv.h"
 #include "i915_gem_clflush.h"
 #include "i915_trace.h"
+#include "i915_aubcrash.h"
 #include "intel_drv.h"
 #include "intel_frontbuffer.h"
 
@@ -1758,7 +1759,8 @@  static int eb_move_to_gpu(struct i915_execbuffer *eb)
 		struct i915_vma *vma = eb->vma[i];
 		struct drm_i915_gem_object *obj = vma->obj;
 
-		if (flags & EXEC_OBJECT_CAPTURE) {
+		if ((flags & EXEC_OBJECT_CAPTURE) ||
+		    i915_error_state_should_capture(vma, eb->batch)) {
 			struct i915_gem_capture_list *capture;
 
 			capture = kmalloc(sizeof(*capture), GFP_KERNEL);