summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_query.h
blob: c4f0cb0ec6ef776f12452592d6c9450f1109bd05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __NVC0_QUERY_H__
#define __NVC0_QUERY_H__

#include "pipe/p_context.h"

#include "nouveau_context.h"

struct nvc0_context;
struct nvc0_query;

struct nvc0_query_funcs {
   void (*destroy_query)(struct nvc0_context *, struct nvc0_query *);
   boolean (*begin_query)(struct nvc0_context *, struct nvc0_query *);
   void (*end_query)(struct nvc0_context *, struct nvc0_query *);
   boolean (*get_query_result)(struct nvc0_context *, struct nvc0_query *,
                               boolean, union pipe_query_result *);
};

struct nvc0_query {
   const struct nvc0_query_funcs *funcs;
   uint16_t type;
   uint16_t index;
};

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_SW_QUERY_DRV_STAT_GROUP 1

void nvc0_init_query_functions(struct nvc0_context *);

#endif