1 #ifndef __NV50_QUERY_H__ 2 #define __NV50_QUERY_H__ 3 4 #include "pipe/p_context.h" 5 6 #include "nouveau_context.h" 7 8 struct nv50_context; 9 struct nv50_query; 10 11 struct nv50_query_funcs { 12 void (*destroy_query)(struct nv50_context *, struct nv50_query *); 13 boolean (*begin_query)(struct nv50_context *, struct nv50_query *); 14 void (*end_query)(struct nv50_context *, struct nv50_query *); 15 boolean (*get_query_result)(struct nv50_context *, struct nv50_query *, 16 boolean, union pipe_query_result *); 17 }; 18 19 struct nv50_query { 20 const struct nv50_query_funcs *funcs; 21 uint16_t type; 22 uint16_t index; 23 }; 24 25 static inline struct nv50_query * nv50_query(struct pipe_query * pipe)26nv50_query(struct pipe_query *pipe) 27 { 28 return (struct nv50_query *)pipe; 29 } 30 31 /* 32 * Driver queries groups: 33 */ 34 #define NV50_HW_SM_QUERY_GROUP 0 35 #define NV50_HW_METRIC_QUERY_GROUP 1 36 37 void nv50_init_query_functions(struct nv50_context *); 38 39 #endif 40