mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 11:58:10 +02:00
radeonsi: remove si_query_hw_ops table and call func directly
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30052>
This commit is contained in:
parent
a3c4d257a2
commit
068f631814
2 changed files with 6 additions and 28 deletions
|
|
@ -17,7 +17,6 @@
|
|||
#include "util/u_upload_mgr.h"
|
||||
|
||||
static const struct si_query_ops query_hw_ops;
|
||||
static const struct si_query_hw_ops query_hw_default_hw_ops;
|
||||
static const struct si_query_ops sw_query_ops;
|
||||
|
||||
struct si_hw_query_params {
|
||||
|
|
@ -659,7 +658,6 @@ static struct pipe_query *si_query_hw_create(struct si_screen *sscreen, unsigned
|
|||
|
||||
query->b.type = query_type;
|
||||
query->b.ops = &query_hw_ops;
|
||||
query->ops = &query_hw_default_hw_ops;
|
||||
|
||||
switch (query_type) {
|
||||
case PIPE_QUERY_OCCLUSION_COUNTER:
|
||||
|
|
@ -912,7 +910,7 @@ static void si_query_hw_emit_start(struct si_context *sctx, struct si_query_hw *
|
|||
|
||||
/* Don't realloc pipeline_stats_query_buf */
|
||||
if ((!(query->flags & SI_QUERY_EMULATE_GS_COUNTERS) || !sctx->pipeline_stats_query_buf) &&
|
||||
!si_query_buffer_alloc(sctx, &query->buffer, query->ops->prepare_buffer, query->result_size))
|
||||
!si_query_buffer_alloc(sctx, &query->buffer, si_query_hw_prepare_buffer, query->result_size))
|
||||
return;
|
||||
|
||||
if (query->flags & SI_QUERY_EMULATE_GS_COUNTERS)
|
||||
|
|
@ -925,7 +923,7 @@ static void si_query_hw_emit_start(struct si_context *sctx, struct si_query_hw *
|
|||
si_need_gfx_cs_space(sctx, 0);
|
||||
|
||||
va = query->buffer.buf->gpu_address + query->buffer.results_end;
|
||||
query->ops->emit_start(sctx, query, query->buffer.buf, va);
|
||||
si_query_hw_do_emit_start(sctx, query, query->buffer.buf, va);
|
||||
}
|
||||
|
||||
static void si_query_hw_do_emit_stop(struct si_context *sctx, struct si_query_hw *query,
|
||||
|
|
@ -1022,7 +1020,7 @@ static void si_query_hw_emit_stop(struct si_context *sctx, struct si_query_hw *q
|
|||
/* The queries which need begin already called this in begin_query. */
|
||||
if (query->flags & SI_QUERY_HW_FLAG_NO_START) {
|
||||
si_need_gfx_cs_space(sctx, 0);
|
||||
if (!si_query_buffer_alloc(sctx, &query->buffer, query->ops->prepare_buffer,
|
||||
if (!si_query_buffer_alloc(sctx, &query->buffer, si_query_hw_prepare_buffer,
|
||||
query->result_size))
|
||||
return;
|
||||
}
|
||||
|
|
@ -1033,7 +1031,7 @@ static void si_query_hw_emit_stop(struct si_context *sctx, struct si_query_hw *q
|
|||
/* emit end query */
|
||||
va = query->buffer.buf->gpu_address + query->buffer.results_end;
|
||||
|
||||
query->ops->emit_stop(sctx, query, query->buffer.buf, va);
|
||||
si_query_hw_do_emit_stop(sctx, query, query->buffer.buf, va);
|
||||
|
||||
query->buffer.results_end += query->result_size;
|
||||
|
||||
|
|
@ -1489,7 +1487,7 @@ static bool si_query_hw_get_result(struct si_context *sctx, struct si_query *squ
|
|||
struct si_query_hw *query = (struct si_query_hw *)squery;
|
||||
struct si_query_buffer *qbuf;
|
||||
|
||||
query->ops->clear_result(query, result);
|
||||
si_query_hw_clear_result(query, result);
|
||||
|
||||
for (qbuf = &query->buffer; qbuf; qbuf = qbuf->previous) {
|
||||
unsigned usage = PIPE_MAP_READ | (wait ? 0 : PIPE_MAP_DONTBLOCK);
|
||||
|
|
@ -1505,7 +1503,7 @@ static bool si_query_hw_get_result(struct si_context *sctx, struct si_query *squ
|
|||
return false;
|
||||
|
||||
while (results_base != qbuf->results_end) {
|
||||
query->ops->add_result(sscreen, query, map + results_base, result);
|
||||
si_query_hw_add_result(sscreen, query, map + results_base, result);
|
||||
results_base += query->result_size;
|
||||
}
|
||||
}
|
||||
|
|
@ -1954,14 +1952,6 @@ static const struct si_query_ops sw_query_ops = {
|
|||
.get_result_resource = NULL
|
||||
};
|
||||
|
||||
static const struct si_query_hw_ops query_hw_default_hw_ops = {
|
||||
.prepare_buffer = si_query_hw_prepare_buffer,
|
||||
.emit_start = si_query_hw_do_emit_start,
|
||||
.emit_stop = si_query_hw_do_emit_stop,
|
||||
.clear_result = si_query_hw_clear_result,
|
||||
.add_result = si_query_hw_add_result,
|
||||
};
|
||||
|
||||
void si_init_query_functions(struct si_context *sctx)
|
||||
{
|
||||
sctx->b.create_query = si_create_query;
|
||||
|
|
|
|||
|
|
@ -149,17 +149,6 @@ enum
|
|||
SI_QUERY_EMULATE_GS_COUNTERS = (1 << 3),
|
||||
};
|
||||
|
||||
struct si_query_hw_ops {
|
||||
bool (*prepare_buffer)(struct si_context *, struct si_query_buffer *);
|
||||
void (*emit_start)(struct si_context *, struct si_query_hw *, struct si_resource *buffer,
|
||||
uint64_t va);
|
||||
void (*emit_stop)(struct si_context *, struct si_query_hw *, struct si_resource *buffer,
|
||||
uint64_t va);
|
||||
void (*clear_result)(struct si_query_hw *, union pipe_query_result *);
|
||||
void (*add_result)(struct si_screen *screen, struct si_query_hw *, void *buffer,
|
||||
union pipe_query_result *result);
|
||||
};
|
||||
|
||||
struct si_query_buffer {
|
||||
/* The buffer where query results are stored. */
|
||||
struct si_resource *buf;
|
||||
|
|
@ -180,7 +169,6 @@ bool si_query_buffer_alloc(struct si_context *sctx, struct si_query_buffer *buff
|
|||
|
||||
struct si_query_hw {
|
||||
struct si_query b;
|
||||
const struct si_query_hw_ops *ops;
|
||||
unsigned flags;
|
||||
|
||||
/* The query buffer and how many results are in it. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue