summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nv50/nv50_query.h
blob: bd4c0a386f6bde1b2412c2b37a690328eef9ef58 (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 __NV50_QUERY_H__
#define __NV50_QUERY_H__

#include "pipe/p_context.h"

#include "nouveau_context.h"

struct nv50_context;
struct nv50_query;

struct nv50_query_funcs {
   void (*destroy_query)(struct nv50_context *, struct nv50_query *);
   boolean (*begin_query)(struct nv50_context *, struct nv50_query *);
   void (*end_query)(struct nv50_context *, struct nv50_query *);
   boolean (*get_query_result)(struct nv50_context *, struct nv50_query *,
                               boolean, union pipe_query_result *);
};

struct nv50_query {
   const struct nv50_query_funcs *funcs;
   uint16_t type;
   uint16_t index;
};

static inline struct nv50_query *
nv50_query(struct pipe_query *pipe)
{
   return (struct nv50_query *)pipe;
}

/*
 * Driver queries groups:
 */
#define NV50_HW_SM_QUERY_GROUP       0
#define NV50_HW_METRIC_QUERY_GROUP   1

void nv50_init_query_functions(struct nv50_context *);

#endif