summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/kgem.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f68f5f41..35b76d9c 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2872,6 +2872,31 @@ out_16384:
return kgem_create_linear(kgem, size, CREATE_NO_THROTTLE);
}
+#if !NDEBUG
+static void dump_gtt_info(void)
+{
+ int i;
+
+ for (i = 0; i < DRM_MAX_MINOR; i++) {
+ char path[80];
+ FILE *file;
+
+ sprintf(path, "/sys/kernel/debug/dri%d/i915_gem_gtt", i);
+ file = fopen(path, "r");
+ if (file) {
+ size_t len = 0;
+ char *line = NULL;
+
+ while (getline(&line, &len, file) != -1)
+ ErrorF("%s", line);
+ free(line);
+ fclose(file);
+ return;
+ }
+ }
+}
+#endif
+
void _kgem_submit(struct kgem *kgem)
{
struct kgem_request *rq;
@@ -3024,6 +3049,9 @@ void _kgem_submit(struct kgem *kgem)
(long long)aperture.aper_available_size);
}
+ if (ret == ENOSPC)
+ dump_gtt_info();
+
if (DEBUG_SYNC) {
int fd = open("/tmp/batchbuffer", O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd != -1) {