Path: blob/21.2-virgl/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.h
4574 views
#ifndef __NVC0_QUERY_HW_H__1#define __NVC0_QUERY_HW_H__23#include "nouveau_fence.h"4#include "nouveau_mm.h"56#include "nvc0_query.h"78#define NVC0_HW_QUERY_STATE_READY 09#define NVC0_HW_QUERY_STATE_ACTIVE 110#define NVC0_HW_QUERY_STATE_ENDED 211#define NVC0_HW_QUERY_STATE_FLUSHED 31213#define NVC0_HW_QUERY_TFB_BUFFER_OFFSET (PIPE_QUERY_TYPES + 0)1415struct nvc0_hw_query;1617struct nvc0_hw_query_funcs {18void (*destroy_query)(struct nvc0_context *, struct nvc0_hw_query *);19bool (*begin_query)(struct nvc0_context *, struct nvc0_hw_query *);20void (*end_query)(struct nvc0_context *, struct nvc0_hw_query *);21bool (*get_query_result)(struct nvc0_context *, struct nvc0_hw_query *,22bool, union pipe_query_result *);23};2425struct nvc0_hw_query {26struct nvc0_query base;27const struct nvc0_hw_query_funcs *funcs;28uint32_t *data;29uint32_t sequence;30struct nouveau_bo *bo;31uint32_t base_offset;32uint32_t offset; /* base_offset + i * rotate */33uint8_t state;34bool is64bit;35uint8_t rotate;36struct nouveau_mm_allocation *mm;37struct nouveau_fence *fence;38};3940static inline struct nvc0_hw_query *41nvc0_hw_query(struct nvc0_query *q)42{43return (struct nvc0_hw_query *)q;44}4546struct nvc0_query *47nvc0_hw_create_query(struct nvc0_context *, unsigned, unsigned);48int49nvc0_hw_get_driver_query_info(struct nvc0_screen *, unsigned,50struct pipe_driver_query_info *);51bool52nvc0_hw_query_allocate(struct nvc0_context *, struct nvc0_query *, int);53void54nvc0_hw_query_pushbuf_submit(struct nouveau_pushbuf *, struct nvc0_query *,55unsigned);56void57nvc0_hw_query_fifo_wait(struct nvc0_context *, struct nvc0_query *);5859#endif606162