aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2015-10-13 22:16:23 +0200
committerSamuel Pitoiset <[email protected]>2015-10-16 21:57:44 +0200
commitec5001d25b281455869149bff5fa9d8c497b0cd4 (patch)
tree43dc7fce79ead657752c2a0ef7a3a6148231c3b1 /src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c
parent00d61869a5e8e8ecdb5613f1b2aab5019d71d77e (diff)
nvc0: move SW/HW queries info to their respective files
This will help for handling HW SM queries variants on Fermi. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c
index 5f33b1e019a..cd24618d564 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_sw.c
@@ -25,6 +25,45 @@
#include "nvc0_query_sw.h"
+/* === DRIVER STATISTICS === */
+
+#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
+
+static const char *nvc0_sw_query_drv_stat_names[] =
+{
+ "drv-tex_obj_current_count",
+ "drv-tex_obj_current_bytes",
+ "drv-buf_obj_current_count",
+ "drv-buf_obj_current_bytes_vid",
+ "drv-buf_obj_current_bytes_sys",
+ "drv-tex_transfers_rd",
+ "drv-tex_transfers_wr",
+ "drv-tex_copy_count",
+ "drv-tex_blit_count",
+ "drv-tex_cache_flush_count",
+ "drv-buf_transfers_rd",
+ "drv-buf_transfers_wr",
+ "drv-buf_read_bytes_staging_vid",
+ "drv-buf_write_bytes_direct",
+ "drv-buf_write_bytes_staging_vid",
+ "drv-buf_write_bytes_staging_sys",
+ "drv-buf_copy_bytes",
+ "drv-buf_non_kernel_fence_sync_count",
+ "drv-any_non_kernel_fence_sync_count",
+ "drv-query_sync_count",
+ "drv-gpu_serialize_count",
+ "drv-draw_calls_array",
+ "drv-draw_calls_indexed",
+ "drv-draw_calls_fallback_count",
+ "drv-user_buffer_upload_bytes",
+ "drv-constbuf_upload_count",
+ "drv-constbuf_upload_bytes",
+ "drv-pushbuf_count",
+ "drv-resource_validate_count"
+};
+
+#endif /* NOUVEAU_ENABLE_DRIVER_STATISTICS */
+
static void
nvc0_sw_destroy_query(struct nvc0_context *nvc0, struct nvc0_query *q)
{
@@ -96,3 +135,28 @@ nvc0_sw_create_query(struct nvc0_context *nvcO, unsigned type, unsigned index)
return q;
}
+
+int
+nvc0_sw_get_driver_query_info(struct nvc0_screen *screen, unsigned id,
+ struct pipe_driver_query_info *info)
+{
+ int count = 0;
+
+ count += NVC0_SW_QUERY_DRV_STAT_COUNT;
+ if (!info)
+ return count;
+
+#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
+ if (id < count) {
+ info->name = nvc0_sw_query_drv_stat_names[id];
+ info->query_type = NVC0_SW_QUERY_DRV_STAT(id);
+ info->type = PIPE_DRIVER_QUERY_TYPE_UINT64;
+ info->max_value.u64 = 0;
+ if (strstr(info->name, "bytes"))
+ info->type = PIPE_DRIVER_QUERY_TYPE_BYTES;
+ info->group_id = NVC0_SW_QUERY_DRV_STAT_GROUP;
+ return 1;
+ }
+#endif
+ return 0;
+}