1 #ifndef __NVC0_QUERY_HW_H__
2 #define __NVC0_QUERY_HW_H__
4 #include "nouveau_fence.h"
5 #include "nouveau_mm.h"
7 #include "nvc0_query.h"
9 #define NVC0_HW_QUERY_STATE_READY 0
10 #define NVC0_HW_QUERY_STATE_ACTIVE 1
11 #define NVC0_HW_QUERY_STATE_ENDED 2
12 #define NVC0_HW_QUERY_STATE_FLUSHED 3
14 #define NVC0_HW_QUERY_TFB_BUFFER_OFFSET (PIPE_QUERY_TYPES + 0)
18 struct nvc0_hw_query_funcs
{
19 void (*destroy_query
)(struct nvc0_context
*, struct nvc0_hw_query
*);
20 bool (*begin_query
)(struct nvc0_context
*, struct nvc0_hw_query
*);
21 void (*end_query
)(struct nvc0_context
*, struct nvc0_hw_query
*);
22 bool (*get_query_result
)(struct nvc0_context
*, struct nvc0_hw_query
*,
23 bool, union pipe_query_result
*);
26 struct nvc0_hw_query
{
27 struct nvc0_query base
;
28 const struct nvc0_hw_query_funcs
*funcs
;
31 struct nouveau_bo
*bo
;
33 uint32_t offset
; /* base_offset + i * rotate */
37 struct nouveau_mm_allocation
*mm
;
38 struct nouveau_fence
*fence
;
41 static inline struct nvc0_hw_query
*
42 nvc0_hw_query(struct nvc0_query
*q
)
44 return (struct nvc0_hw_query
*)q
;
48 nvc0_hw_create_query(struct nvc0_context
*, unsigned, unsigned);
50 nvc0_hw_get_driver_query_info(struct nvc0_screen
*, unsigned,
51 struct pipe_driver_query_info
*);
53 nvc0_hw_query_allocate(struct nvc0_context
*, struct nvc0_query
*, int);
55 nvc0_hw_query_pushbuf_submit(struct nouveau_pushbuf
*, struct nvc0_query
*,
58 nvc0_hw_query_fifo_wait(struct nvc0_context
*, struct nvc0_query
*);