[Intel-gfx] [RFC PATCH 10/12] drm/i915: Always add BOs to capture list if AubCrash is enabled
Oscar Mateo
oscar.mateo at intel.com
Fri Oct 27 18:01:13 UTC 2017
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 at intel.com>
Cc: Chris Wilson <chris at 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(-)
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);
--
1.9.1
More information about the Intel-gfx
mailing list