nvc0: add a header file for nvc0_query
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 17 May 2015 14:46:54 +0000 (16:46 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 9 Oct 2015 12:09:57 +0000 (14:09 +0200)
This will allow to split SW and HW queries in an upcoming patch.

While we are at it, make use of nvc0_query struct instead of pipe_query.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/Makefile.sources
src/gallium/drivers/nouveau/nvc0/nvc0_context.h
src/gallium/drivers/nouveau/nvc0/nvc0_query.c
src/gallium/drivers/nouveau/nvc0/nvc0_query.h [new file with mode: 0644]
src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c
src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c

index 9346ea3204dccf9fab8ea2232d04f9fdc18d824c..350837cd6946f1aa6561c18ff8fc61890c01c809 100644 (file)
@@ -151,6 +151,7 @@ NVC0_C_SOURCES := \
        nvc0/nvc0_program.c \
        nvc0/nvc0_program.h \
        nvc0/nvc0_query.c \
+       nvc0/nvc0_query.h \
        nvc0/nvc0_resource.c \
        nvc0/nvc0_resource.h \
        nvc0/nvc0_screen.c \
index 30bee3a0f8c5fbf742a2af5191153ca0e7c5246a..4af83c532248c98dd7ca640ea06ced8ba96dad5a 100644 (file)
@@ -15,6 +15,7 @@
 #include "nvc0/nvc0_screen.h"
 #include "nvc0/nvc0_program.h"
 #include "nvc0/nvc0_resource.h"
+#include "nvc0/nvc0_query.h"
 
 #include "nv50/nv50_transfer.h"
 
@@ -231,17 +232,6 @@ uint32_t nvc0_program_symbol_offset(const struct nvc0_program *,
                                     uint32_t label);
 void nvc0_program_init_tcp_empty(struct nvc0_context *);
 
-/* nvc0_query.c */
-void nvc0_init_query_functions(struct nvc0_context *);
-void nvc0_query_pushbuf_submit(struct nouveau_pushbuf *,
-                               struct pipe_query *, unsigned result_offset);
-void nvc0_query_fifo_wait(struct nouveau_pushbuf *, struct pipe_query *);
-void nvc0_so_target_save_offset(struct pipe_context *,
-                                struct pipe_stream_output_target *, unsigned i,
-                                bool *serialize);
-
-#define NVC0_QUERY_TFB_BUFFER_OFFSET (PIPE_QUERY_TYPES + 0)
-
 /* nvc0_shader_state.c */
 void nvc0_vertprog_validate(struct nvc0_context *);
 void nvc0_tctlprog_validate(struct nvc0_context *);
index b13df6a9485e93b9261722b932f4dd9a103ef94b..793425b7b02011dfe7f2ea643ddf78a78fb4676e 100644 (file)
@@ -25,6 +25,8 @@
 #define NVC0_PUSH_EXPLICIT_SPACE_CHECKING
 
 #include "nvc0/nvc0_context.h"
+#include "nvc0/nvc0_query.h"
+
 #include "nv_object.xml.h"
 #include "nvc0/nve4_compute.xml.h"
 #include "nvc0/nvc0_compute.xml.h"
 #define NVC0_QUERY_STATE_ENDED   2
 #define NVC0_QUERY_STATE_FLUSHED 3
 
-struct nvc0_query {
-   uint32_t *data;
-   uint16_t type;
-   uint16_t index;
-   int8_t ctr[4];
-   uint32_t sequence;
-   struct nouveau_bo *bo;
-   uint32_t base;
-   uint32_t offset; /* base + i * rotate */
-   uint8_t state;
-   bool is64bit;
-   uint8_t rotate;
-   int nesting; /* only used for occlusion queries */
-   union {
-      struct nouveau_mm_allocation *mm;
-      uint64_t value;
-   } u;
-   struct nouveau_fence *fence;
-};
-
 #define NVC0_QUERY_ALLOC_SPACE 256
 
 static boolean nvc0_hw_sm_query_begin(struct nvc0_context *,
@@ -62,12 +44,6 @@ static void nvc0_hw_sm_query_end(struct nvc0_context *, struct nvc0_query *);
 static boolean nvc0_hw_sm_query_result(struct nvc0_context *,
                                        struct nvc0_query *, void *, boolean);
 
-static inline struct nvc0_query *
-nvc0_query(struct pipe_query *pipe)
-{
-   return (struct nvc0_query *)pipe;
-}
-
 static bool
 nvc0_query_allocate(struct nvc0_context *nvc0, struct nvc0_query *q, int size)
 {
@@ -523,9 +499,8 @@ nvc0_query_result(struct pipe_context *pipe, struct pipe_query *pq,
 }
 
 void
-nvc0_query_fifo_wait(struct nouveau_pushbuf *push, struct pipe_query *pq)
+nvc0_query_fifo_wait(struct nouveau_pushbuf *push, struct nvc0_query *q)
 {
-   struct nvc0_query *q = nvc0_query(pq);
    unsigned offset = q->offset;
 
    if (q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE) offset += 0x20;
@@ -596,7 +571,7 @@ nvc0_render_condition(struct pipe_context *pipe,
    }
 
    if (wait)
-      nvc0_query_fifo_wait(push, pq);
+      nvc0_query_fifo_wait(push, q);
 
    PUSH_SPACE(push, 7);
    PUSH_REFN (push, q->bo, NOUVEAU_BO_GART | NOUVEAU_BO_RD);
@@ -611,10 +586,8 @@ nvc0_render_condition(struct pipe_context *pipe,
 
 void
 nvc0_query_pushbuf_submit(struct nouveau_pushbuf *push,
-                          struct pipe_query *pq, unsigned result_offset)
+                          struct nvc0_query *q, unsigned result_offset)
 {
-   struct nvc0_query *q = nvc0_query(pq);
-
 #define NVC0_IB_ENTRY_1_NO_PREFETCH (1 << (31 - 8))
 
    PUSH_REFN(push, q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_GART);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.h b/src/gallium/drivers/nouveau/nvc0/nvc0_query.h
new file mode 100644 (file)
index 0000000..f3e8946
--- /dev/null
@@ -0,0 +1,191 @@
+#ifndef __NVC0_QUERY_H__
+#define __NVC0_QUERY_H__
+
+#include "pipe/p_context.h"
+
+#include "nouveau_context.h"
+#include "nouveau_mm.h"
+
+#define NVC0_QUERY_TFB_BUFFER_OFFSET (PIPE_QUERY_TYPES + 0)
+
+struct nvc0_context;
+
+struct nvc0_query {
+   uint32_t *data;
+   uint16_t type;
+   uint16_t index;
+   int8_t ctr[4];
+   uint32_t sequence;
+   struct nouveau_bo *bo;
+   uint32_t base;
+   uint32_t offset; /* base + i * rotate */
+   uint8_t state;
+   boolean is64bit;
+   uint8_t rotate;
+   int nesting; /* only used for occlusion queries */
+   union {
+      struct nouveau_mm_allocation *mm;
+      uint64_t value;
+   } u;
+   struct nouveau_fence *fence;
+};
+
+static inline struct nvc0_query *
+nvc0_query(struct pipe_query *pipe)
+{
+   return (struct nvc0_query *)pipe;
+}
+
+/*
+ * Driver queries groups:
+ */
+#define NVC0_QUERY_MP_COUNTER_GROUP 0
+#define NVC0_QUERY_DRV_STAT_GROUP   1
+
+/*
+ * Performance counter queries:
+ */
+#define NVE4_HW_SM_QUERY(i)    (PIPE_QUERY_DRIVER_SPECIFIC + (i))
+#define NVE4_HW_SM_QUERY_LAST   NVE4_HW_SM_QUERY(NVE4_HW_SM_QUERY_COUNT - 1)
+enum nve4_pm_queries
+{
+   NVE4_HW_SM_QUERY_ACTIVE_CYCLES = 0,
+   NVE4_HW_SM_QUERY_ACTIVE_WARPS,
+   NVE4_HW_SM_QUERY_ATOM_COUNT,
+   NVE4_HW_SM_QUERY_BRANCH,
+   NVE4_HW_SM_QUERY_DIVERGENT_BRANCH,
+   NVE4_HW_SM_QUERY_GLD_REQUEST,
+   NVE4_HW_SM_QUERY_GLD_MEM_DIV_REPLAY,
+   NVE4_HW_SM_QUERY_GST_TRANSACTIONS,
+   NVE4_HW_SM_QUERY_GST_MEM_DIV_REPLAY,
+   NVE4_HW_SM_QUERY_GRED_COUNT,
+   NVE4_HW_SM_QUERY_GST_REQUEST,
+   NVE4_HW_SM_QUERY_INST_EXECUTED,
+   NVE4_HW_SM_QUERY_INST_ISSUED,
+   NVE4_HW_SM_QUERY_INST_ISSUED1,
+   NVE4_HW_SM_QUERY_INST_ISSUED2,
+   NVE4_HW_SM_QUERY_L1_GLD_HIT,
+   NVE4_HW_SM_QUERY_L1_GLD_MISS,
+   NVE4_HW_SM_QUERY_L1_LOCAL_LD_HIT,
+   NVE4_HW_SM_QUERY_L1_LOCAL_LD_MISS,
+   NVE4_HW_SM_QUERY_L1_LOCAL_ST_HIT,
+   NVE4_HW_SM_QUERY_L1_LOCAL_ST_MISS,
+   NVE4_HW_SM_QUERY_L1_SHARED_LD_TRANSACTIONS,
+   NVE4_HW_SM_QUERY_L1_SHARED_ST_TRANSACTIONS,
+   NVE4_HW_SM_QUERY_LOCAL_LD,
+   NVE4_HW_SM_QUERY_LOCAL_LD_TRANSACTIONS,
+   NVE4_HW_SM_QUERY_LOCAL_ST,
+   NVE4_HW_SM_QUERY_LOCAL_ST_TRANSACTIONS,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_0,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_1,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_2,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_3,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_4,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_5,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_6,
+   NVE4_HW_SM_QUERY_PROF_TRIGGER_7,
+   NVE4_HW_SM_QUERY_SHARED_LD,
+   NVE4_HW_SM_QUERY_SHARED_LD_REPLAY,
+   NVE4_HW_SM_QUERY_SHARED_ST,
+   NVE4_HW_SM_QUERY_SHARED_ST_REPLAY,
+   NVE4_HW_SM_QUERY_SM_CTA_LAUNCHED,
+   NVE4_HW_SM_QUERY_THREADS_LAUNCHED,
+   NVE4_HW_SM_QUERY_UNCACHED_GLD_TRANSACTIONS,
+   NVE4_HW_SM_QUERY_WARPS_LAUNCHED,
+   NVE4_HW_SM_QUERY_METRIC_IPC,
+   NVE4_HW_SM_QUERY_METRIC_IPAC,
+   NVE4_HW_SM_QUERY_METRIC_IPEC,
+   NVE4_HW_SM_QUERY_METRIC_MP_OCCUPANCY,
+   NVE4_HW_SM_QUERY_METRIC_MP_EFFICIENCY,
+   NVE4_HW_SM_QUERY_METRIC_INST_REPLAY_OHEAD,
+   NVE4_HW_SM_QUERY_COUNT
+};
+
+#define NVC0_HW_SM_QUERY(i)    (PIPE_QUERY_DRIVER_SPECIFIC + 2048 + (i))
+#define NVC0_HW_SM_QUERY_LAST   NVC0_HW_SM_QUERY(NVC0_HW_SM_QUERY_COUNT - 1)
+enum nvc0_pm_queries
+{
+   NVC0_HW_SM_QUERY_ACTIVE_CYCLES = 0,
+   NVC0_HW_SM_QUERY_ACTIVE_WARPS,
+   NVC0_HW_SM_QUERY_ATOM_COUNT,
+   NVC0_HW_SM_QUERY_BRANCH,
+   NVC0_HW_SM_QUERY_DIVERGENT_BRANCH,
+   NVC0_HW_SM_QUERY_GLD_REQUEST,
+   NVC0_HW_SM_QUERY_GRED_COUNT,
+   NVC0_HW_SM_QUERY_GST_REQUEST,
+   NVC0_HW_SM_QUERY_INST_EXECUTED,
+   NVC0_HW_SM_QUERY_INST_ISSUED1_0,
+   NVC0_HW_SM_QUERY_INST_ISSUED1_1,
+   NVC0_HW_SM_QUERY_INST_ISSUED2_0,
+   NVC0_HW_SM_QUERY_INST_ISSUED2_1,
+   NVC0_HW_SM_QUERY_LOCAL_LD,
+   NVC0_HW_SM_QUERY_LOCAL_ST,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_0,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_1,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_2,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_3,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_4,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_5,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_6,
+   NVC0_HW_SM_QUERY_PROF_TRIGGER_7,
+   NVC0_HW_SM_QUERY_SHARED_LD,
+   NVC0_HW_SM_QUERY_SHARED_ST,
+   NVC0_HW_SM_QUERY_THREADS_LAUNCHED,
+   NVC0_HW_SM_QUERY_TH_INST_EXECUTED_0,
+   NVC0_HW_SM_QUERY_TH_INST_EXECUTED_1,
+   NVC0_HW_SM_QUERY_TH_INST_EXECUTED_2,
+   NVC0_HW_SM_QUERY_TH_INST_EXECUTED_3,
+   NVC0_HW_SM_QUERY_WARPS_LAUNCHED,
+   NVC0_HW_SM_QUERY_COUNT
+};
+
+/*
+ * Driver statistics queries:
+ */
+#define NVC0_QUERY_DRV_STAT(i)    (PIPE_QUERY_DRIVER_SPECIFIC + 1024 + (i))
+#define NVC0_QUERY_DRV_STAT_LAST   NVC0_QUERY_DRV_STAT(NVC0_QUERY_DRV_STAT_COUNT - 1)
+enum nvc0_drv_stats_queries
+{
+#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
+   NVC0_QUERY_DRV_STAT_TEX_OBJECT_CURRENT_COUNT = 0,
+   NVC0_QUERY_DRV_STAT_TEX_OBJECT_CURRENT_BYTES,
+   NVC0_QUERY_DRV_STAT_BUF_OBJECT_CURRENT_COUNT,
+   NVC0_QUERY_DRV_STAT_BUF_OBJECT_CURRENT_BYTES_VID,
+   NVC0_QUERY_DRV_STAT_BUF_OBJECT_CURRENT_BYTES_SYS,
+   NVC0_QUERY_DRV_STAT_TEX_TRANSFERS_READ,
+   NVC0_QUERY_DRV_STAT_TEX_TRANSFERS_WRITE,
+   NVC0_QUERY_DRV_STAT_TEX_COPY_COUNT,
+   NVC0_QUERY_DRV_STAT_TEX_BLIT_COUNT,
+   NVC0_QUERY_DRV_STAT_TEX_CACHE_FLUSH_COUNT,
+   NVC0_QUERY_DRV_STAT_BUF_TRANSFERS_READ,
+   NVC0_QUERY_DRV_STAT_BUF_TRANSFERS_WRITE,
+   NVC0_QUERY_DRV_STAT_BUF_READ_BYTES_STAGING_VID,
+   NVC0_QUERY_DRV_STAT_BUF_WRITE_BYTES_DIRECT,
+   NVC0_QUERY_DRV_STAT_BUF_WRITE_BYTES_STAGING_VID,
+   NVC0_QUERY_DRV_STAT_BUF_WRITE_BYTES_STAGING_SYS,
+   NVC0_QUERY_DRV_STAT_BUF_COPY_BYTES,
+   NVC0_QUERY_DRV_STAT_BUF_NON_KERNEL_FENCE_SYNC_COUNT,
+   NVC0_QUERY_DRV_STAT_ANY_NON_KERNEL_FENCE_SYNC_COUNT,
+   NVC0_QUERY_DRV_STAT_QUERY_SYNC_COUNT,
+   NVC0_QUERY_DRV_STAT_GPU_SERIALIZE_COUNT,
+   NVC0_QUERY_DRV_STAT_DRAW_CALLS_ARRAY,
+   NVC0_QUERY_DRV_STAT_DRAW_CALLS_INDEXED,
+   NVC0_QUERY_DRV_STAT_DRAW_CALLS_FALLBACK_COUNT,
+   NVC0_QUERY_DRV_STAT_USER_BUFFER_UPLOAD_BYTES,
+   NVC0_QUERY_DRV_STAT_CONSTBUF_UPLOAD_COUNT,
+   NVC0_QUERY_DRV_STAT_CONSTBUF_UPLOAD_BYTES,
+   NVC0_QUERY_DRV_STAT_PUSHBUF_COUNT,
+   NVC0_QUERY_DRV_STAT_RESOURCE_VALIDATE_COUNT,
+#endif
+   NVC0_QUERY_DRV_STAT_COUNT
+};
+
+void nvc0_init_query_functions(struct nvc0_context *);
+void nvc0_query_pushbuf_submit(struct nouveau_pushbuf *, struct nvc0_query *,
+                               unsigned);
+void nvc0_query_fifo_wait(struct nouveau_pushbuf *, struct nvc0_query *);
+void nvc0_so_target_save_offset(struct pipe_context *,
+                                struct pipe_stream_output_target *, unsigned,
+                                bool *);
+
+#endif
index f57a316f01ea84148b98c5b6ca632548dd3e1fe1..fa4f8645ffe79335b0af71c72e0260d0fcf7ee0e 100644 (file)
@@ -112,148 +112,6 @@ nvc0_screen(struct pipe_screen *screen)
    return (struct nvc0_screen *)screen;
 }
 
-/*
- * Performance counters groups:
- */
-#define NVC0_QUERY_MP_COUNTER_GROUP 0
-#define NVC0_QUERY_DRV_STAT_GROUP   1
-
-/* Performance counter queries:
- */
-#define NVE4_HW_SM_QUERY(i)    (PIPE_QUERY_DRIVER_SPECIFIC + (i))
-#define NVE4_HW_SM_QUERY_LAST   NVE4_HW_SM_QUERY(NVE4_HW_SM_QUERY_COUNT - 1)
-enum nve4_pm_queries
-{
-    NVE4_HW_SM_QUERY_ACTIVE_CYCLES = 0,
-    NVE4_HW_SM_QUERY_ACTIVE_WARPS,
-    NVE4_HW_SM_QUERY_ATOM_COUNT,
-    NVE4_HW_SM_QUERY_BRANCH,
-    NVE4_HW_SM_QUERY_DIVERGENT_BRANCH,
-    NVE4_HW_SM_QUERY_GLD_REQUEST,
-    NVE4_HW_SM_QUERY_GLD_MEM_DIV_REPLAY,
-    NVE4_HW_SM_QUERY_GST_TRANSACTIONS,
-    NVE4_HW_SM_QUERY_GST_MEM_DIV_REPLAY,
-    NVE4_HW_SM_QUERY_GRED_COUNT,
-    NVE4_HW_SM_QUERY_GST_REQUEST,
-    NVE4_HW_SM_QUERY_INST_EXECUTED,
-    NVE4_HW_SM_QUERY_INST_ISSUED,
-    NVE4_HW_SM_QUERY_INST_ISSUED1,
-    NVE4_HW_SM_QUERY_INST_ISSUED2,
-    NVE4_HW_SM_QUERY_L1_GLD_HIT,
-    NVE4_HW_SM_QUERY_L1_GLD_MISS,
-    NVE4_HW_SM_QUERY_L1_LOCAL_LD_HIT,
-    NVE4_HW_SM_QUERY_L1_LOCAL_LD_MISS,
-    NVE4_HW_SM_QUERY_L1_LOCAL_ST_HIT,
-    NVE4_HW_SM_QUERY_L1_LOCAL_ST_MISS,
-    NVE4_HW_SM_QUERY_L1_SHARED_LD_TRANSACTIONS,
-    NVE4_HW_SM_QUERY_L1_SHARED_ST_TRANSACTIONS,
-    NVE4_HW_SM_QUERY_LOCAL_LD,
-    NVE4_HW_SM_QUERY_LOCAL_LD_TRANSACTIONS,
-    NVE4_HW_SM_QUERY_LOCAL_ST,
-    NVE4_HW_SM_QUERY_LOCAL_ST_TRANSACTIONS,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_0,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_1,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_2,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_3,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_4,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_5,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_6,
-    NVE4_HW_SM_QUERY_PROF_TRIGGER_7,
-    NVE4_HW_SM_QUERY_SHARED_LD,
-    NVE4_HW_SM_QUERY_SHARED_LD_REPLAY,
-    NVE4_HW_SM_QUERY_SHARED_ST,
-    NVE4_HW_SM_QUERY_SHARED_ST_REPLAY,
-    NVE4_HW_SM_QUERY_SM_CTA_LAUNCHED,
-    NVE4_HW_SM_QUERY_THREADS_LAUNCHED,
-    NVE4_HW_SM_QUERY_UNCACHED_GLD_TRANSACTIONS,
-    NVE4_HW_SM_QUERY_WARPS_LAUNCHED,
-    NVE4_HW_SM_QUERY_METRIC_IPC,
-    NVE4_HW_SM_QUERY_METRIC_IPAC,
-    NVE4_HW_SM_QUERY_METRIC_IPEC,
-    NVE4_HW_SM_QUERY_METRIC_MP_OCCUPANCY,
-    NVE4_HW_SM_QUERY_METRIC_MP_EFFICIENCY,
-    NVE4_HW_SM_QUERY_METRIC_INST_REPLAY_OHEAD,
-    NVE4_HW_SM_QUERY_COUNT
-};
-
-#define NVC0_HW_SM_QUERY(i)    (PIPE_QUERY_DRIVER_SPECIFIC + 2048 + (i))
-#define NVC0_HW_SM_QUERY_LAST   NVC0_HW_SM_QUERY(NVC0_HW_SM_QUERY_COUNT - 1)
-enum nvc0_pm_queries
-{
-    NVC0_HW_SM_QUERY_ACTIVE_CYCLES = 0,
-    NVC0_HW_SM_QUERY_ACTIVE_WARPS,
-    NVC0_HW_SM_QUERY_ATOM_COUNT,
-    NVC0_HW_SM_QUERY_BRANCH,
-    NVC0_HW_SM_QUERY_DIVERGENT_BRANCH,
-    NVC0_HW_SM_QUERY_GLD_REQUEST,
-    NVC0_HW_SM_QUERY_GRED_COUNT,
-    NVC0_HW_SM_QUERY_GST_REQUEST,
-    NVC0_HW_SM_QUERY_INST_EXECUTED,
-    NVC0_HW_SM_QUERY_INST_ISSUED1_0,
-    NVC0_HW_SM_QUERY_INST_ISSUED1_1,
-    NVC0_HW_SM_QUERY_INST_ISSUED2_0,
-    NVC0_HW_SM_QUERY_INST_ISSUED2_1,
-    NVC0_HW_SM_QUERY_LOCAL_LD,
-    NVC0_HW_SM_QUERY_LOCAL_ST,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_0,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_1,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_2,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_3,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_4,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_5,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_6,
-    NVC0_HW_SM_QUERY_PROF_TRIGGER_7,
-    NVC0_HW_SM_QUERY_SHARED_LD,
-    NVC0_HW_SM_QUERY_SHARED_ST,
-    NVC0_HW_SM_QUERY_THREADS_LAUNCHED,
-    NVC0_HW_SM_QUERY_TH_INST_EXECUTED_0,
-    NVC0_HW_SM_QUERY_TH_INST_EXECUTED_1,
-    NVC0_HW_SM_QUERY_TH_INST_EXECUTED_2,
-    NVC0_HW_SM_QUERY_TH_INST_EXECUTED_3,
-    NVC0_HW_SM_QUERY_WARPS_LAUNCHED,
-    NVC0_HW_SM_QUERY_COUNT
-};
-
-/* Driver statistics queries:
- */
-#define NVC0_QUERY_DRV_STAT(i)    (PIPE_QUERY_DRIVER_SPECIFIC + 1024 + (i))
-#define NVC0_QUERY_DRV_STAT_LAST   NVC0_QUERY_DRV_STAT(NVC0_QUERY_DRV_STAT_COUNT - 1)
-enum nvc0_drv_stats_queries
-{
-#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
-    NVC0_QUERY_DRV_STAT_TEX_OBJECT_CURRENT_COUNT = 0,
-    NVC0_QUERY_DRV_STAT_TEX_OBJECT_CURRENT_BYTES,
-    NVC0_QUERY_DRV_STAT_BUF_OBJECT_CURRENT_COUNT,
-    NVC0_QUERY_DRV_STAT_BUF_OBJECT_CURRENT_BYTES_VID,
-    NVC0_QUERY_DRV_STAT_BUF_OBJECT_CURRENT_BYTES_SYS,
-    NVC0_QUERY_DRV_STAT_TEX_TRANSFERS_READ,
-    NVC0_QUERY_DRV_STAT_TEX_TRANSFERS_WRITE,
-    NVC0_QUERY_DRV_STAT_TEX_COPY_COUNT,
-    NVC0_QUERY_DRV_STAT_TEX_BLIT_COUNT,
-    NVC0_QUERY_DRV_STAT_TEX_CACHE_FLUSH_COUNT,
-    NVC0_QUERY_DRV_STAT_BUF_TRANSFERS_READ,
-    NVC0_QUERY_DRV_STAT_BUF_TRANSFERS_WRITE,
-    NVC0_QUERY_DRV_STAT_BUF_READ_BYTES_STAGING_VID,
-    NVC0_QUERY_DRV_STAT_BUF_WRITE_BYTES_DIRECT,
-    NVC0_QUERY_DRV_STAT_BUF_WRITE_BYTES_STAGING_VID,
-    NVC0_QUERY_DRV_STAT_BUF_WRITE_BYTES_STAGING_SYS,
-    NVC0_QUERY_DRV_STAT_BUF_COPY_BYTES,
-    NVC0_QUERY_DRV_STAT_BUF_NON_KERNEL_FENCE_SYNC_COUNT,
-    NVC0_QUERY_DRV_STAT_ANY_NON_KERNEL_FENCE_SYNC_COUNT,
-    NVC0_QUERY_DRV_STAT_QUERY_SYNC_COUNT,
-    NVC0_QUERY_DRV_STAT_GPU_SERIALIZE_COUNT,
-    NVC0_QUERY_DRV_STAT_DRAW_CALLS_ARRAY,
-    NVC0_QUERY_DRV_STAT_DRAW_CALLS_INDEXED,
-    NVC0_QUERY_DRV_STAT_DRAW_CALLS_FALLBACK_COUNT,
-    NVC0_QUERY_DRV_STAT_USER_BUFFER_UPLOAD_BYTES,
-    NVC0_QUERY_DRV_STAT_CONSTBUF_UPLOAD_COUNT,
-    NVC0_QUERY_DRV_STAT_CONSTBUF_UPLOAD_BYTES,
-    NVC0_QUERY_DRV_STAT_PUSHBUF_COUNT,
-    NVC0_QUERY_DRV_STAT_RESOURCE_VALIDATE_COUNT,
-#endif
-    NVC0_QUERY_DRV_STAT_COUNT
-};
-
 int nvc0_screen_get_driver_query_info(struct pipe_screen *, unsigned,
                                       struct pipe_driver_query_info *);
 
index 8f8ac2d34b97eb803b5de228cc9f85943be6b903..2fade982b839257ac70f2e4b5dcc896d1b43268a 100644 (file)
@@ -272,14 +272,14 @@ nvc0_tfb_validate(struct nvc0_context *nvc0)
          continue;
 
       if (!targ->clean)
-         nvc0_query_fifo_wait(push, targ->pq);
+         nvc0_query_fifo_wait(push, nvc0_query(targ->pq));
       BEGIN_NVC0(push, NVC0_3D(TFB_BUFFER_ENABLE(b)), 5);
       PUSH_DATA (push, 1);
       PUSH_DATAh(push, buf->address + targ->pipe.buffer_offset);
       PUSH_DATA (push, buf->address + targ->pipe.buffer_offset);
       PUSH_DATA (push, targ->pipe.buffer_size);
       if (!targ->clean) {
-         nvc0_query_pushbuf_submit(push, targ->pq, 0x4);
+         nvc0_query_pushbuf_submit(push, nvc0_query(targ->pq), 0x4);
       } else {
          PUSH_DATA(push, 0); /* TFB_BUFFER_OFFSET */
          targ->clean = false;
index 188c7d7cdc83000019ce948cd10200679c126d96..9be25cfe66e70715be5562cdbb52386266e8f714 100644 (file)
@@ -775,7 +775,7 @@ nvc0_draw_stream_output(struct nvc0_context *nvc0,
       res->status &= ~NOUVEAU_BUFFER_STATUS_GPU_WRITING;
       PUSH_SPACE(push, 2);
       IMMED_NVC0(push, NVC0_3D(SERIALIZE), 0);
-      nvc0_query_fifo_wait(push, so->pq);
+      nvc0_query_fifo_wait(push, nvc0_query(so->pq));
       if (nvc0->screen->eng3d->oclass < GM107_3D_CLASS)
          IMMED_NVC0(push, NVC0_3D(VERTEX_ARRAY_FLUSH), 0);
 
@@ -791,7 +791,7 @@ nvc0_draw_stream_output(struct nvc0_context *nvc0,
       BEGIN_NVC0(push, NVC0_3D(DRAW_TFB_STRIDE), 1);
       PUSH_DATA (push, so->stride);
       BEGIN_NVC0(push, NVC0_3D(DRAW_TFB_BYTES), 1);
-      nvc0_query_pushbuf_submit(push, so->pq, 0x4);
+      nvc0_query_pushbuf_submit(push, nvc0_query(so->pq), 0x4);
       IMMED_NVC0(push, NVC0_3D(VERTEX_END_GL), 0);
 
       mode |= NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT;