iris_cache_sets_clear(batch);
+ /* Always add the workaround BO, it contains a driver identifier at the
+ * beginning quite helpful to debug error states.
+ */
+ iris_use_pinned_bo(batch, screen->workaround_bo, false);
+
iris_batch_maybe_noop(batch);
}
screen->kernel_features |= KERNEL_HAS_WAIT_FOR_SUBMIT;
}
+static bool
+iris_init_identifier_bo(struct iris_screen *screen)
+{
+ void *bo_map;
+
+ bo_map = iris_bo_map(NULL, screen->workaround_bo, MAP_READ | MAP_WRITE);
+ if (!bo_map)
+ return false;
+
+ screen->workaround_bo->kflags |= EXEC_OBJECT_CAPTURE;
+ screen->workaround_address = (struct iris_address) {
+ .bo = screen->workaround_bo,
+ .offset = ALIGN(
+ intel_debug_write_identifiers(bo_map, 4096, "Iris") + 8, 8),
+ };
+
+ iris_bo_unmap(screen->workaround_bo);
+
+ return true;
+}
+
struct pipe_screen *
iris_screen_create(int fd, const struct pipe_screen_config *config)
{
if (!screen->workaround_bo)
return NULL;
- screen->workaround_address = (struct iris_address) {
- .bo = screen->workaround_bo,
- .offset = 0,
- };
+ if (!iris_init_identifier_bo(screen))
+ return NULL;
brw_process_intel_debug_variable();
const struct gen_l3_config *l3_config_cs;
/**
- * A buffer containing nothing useful, for hardware workarounds that
- * require scratch writes or reads from some unimportant memory.
+ * A buffer containing a marker + description of the driver. This buffer is
+ * added to all execbufs syscalls so that we can identify the driver that
+ * generated a hang by looking at the content of the buffer in the error
+ * state. It is also used for hardware workarounds that require scratch
+ * writes or reads from some unimportant memory. To avoid overriding the
+ * debug data, use the workaround_address field for workarounds.
*/
struct iris_bo *workaround_bo;
struct iris_address workaround_address;