{"draw-calls", R600_QUERY_DRAW_CALLS, 0},
{"requested-VRAM", R600_QUERY_REQUESTED_VRAM, rscreen->info.vram_size, TRUE},
{"requested-GTT", R600_QUERY_REQUESTED_GTT, rscreen->info.gart_size, TRUE},
+ {"buffer-wait-time", R600_QUERY_BUFFER_WAIT_TIME, 0, FALSE}
};
if (!info)
#define R600_QUERY_DRAW_CALLS (PIPE_QUERY_DRIVER_SPECIFIC + 0)
#define R600_QUERY_REQUESTED_VRAM (PIPE_QUERY_DRIVER_SPECIFIC + 1)
#define R600_QUERY_REQUESTED_GTT (PIPE_QUERY_DRIVER_SPECIFIC + 2)
+#define R600_QUERY_BUFFER_WAIT_TIME (PIPE_QUERY_DRIVER_SPECIFIC + 3)
struct r600_context;
struct r600_bytecode;
case R600_QUERY_DRAW_CALLS:
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
+ case R600_QUERY_BUFFER_WAIT_TIME:
return NULL;
}
case R600_QUERY_DRAW_CALLS:
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
+ case R600_QUERY_BUFFER_WAIT_TIME:
skip_allocation = true;
break;
default:
case R600_QUERY_REQUESTED_GTT:
rquery->begin_result = 0;
return;
+ case R600_QUERY_BUFFER_WAIT_TIME:
+ rquery->begin_result = rctx->ws->query_value(rctx->ws, RADEON_BUFFER_WAIT_TIME_NS);
+ return;
}
/* Discard the old query buffers. */
case R600_QUERY_REQUESTED_GTT:
rquery->end_result = rctx->ws->query_value(rctx->ws, RADEON_REQUESTED_GTT_MEMORY);
return;
+ case R600_QUERY_BUFFER_WAIT_TIME:
+ rquery->end_result = rctx->ws->query_value(rctx->ws, RADEON_BUFFER_WAIT_TIME_NS);
+ return;
}
r600_emit_query_end(rctx, rquery);
case R600_QUERY_DRAW_CALLS:
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
+ case R600_QUERY_BUFFER_WAIT_TIME:
result->u64 = query->end_result - query->begin_result;
return TRUE;
}
#include "util/u_double_list.h"
#include "os/os_thread.h"
#include "os/os_mman.h"
+#include "os/os_time.h"
#include "state_tracker/drm_driver.h"
}
}
} else {
+ uint64_t time = os_time_get_nano();
+
if (!(usage & PIPE_TRANSFER_WRITE)) {
/* Mapping for read.
*
radeon_bo_wait((struct pb_buffer*)bo, RADEON_USAGE_READWRITE);
}
+
+ bo->mgr->rws->buffer_wait_time += os_time_get_nano() - time;
}
}
return ws->allocated_vram;
case RADEON_REQUESTED_GTT_MEMORY:
return ws->allocated_gtt;
+ case RADEON_BUFFER_WAIT_TIME_NS:
+ return ws->buffer_wait_time;
}
return 0;
}
int num_cs; /* The number of command streams created. */
uint64_t allocated_vram;
uint64_t allocated_gtt;
+ uint64_t buffer_wait_time; /* time spent in buffer_wait in ns */
enum radeon_generation gen;
struct radeon_info info;
};
enum radeon_value_id {
- RADEON_REQUESTED_VRAM_MEMORY,
- RADEON_REQUESTED_GTT_MEMORY,
+ RADEON_REQUESTED_VRAM_MEMORY,
+ RADEON_REQUESTED_GTT_MEMORY,
+ RADEON_BUFFER_WAIT_TIME_NS
};
struct winsys_handle;