From 2258a66f611f7a93c4055c040346b037c31c0294 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Mar 2015 16:47:03 +1000 Subject: [PATCH] renderer: drop ctx query handling code also drop active_hw flag --- src/vrend_renderer.c | 57 +------------------------------------------- src/vrend_renderer.h | 1 - 2 files changed, 1 insertion(+), 57 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index bc1ec11..4dcdca3 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -84,7 +84,6 @@ struct vrend_nontimer_hw_query { struct vrend_query { struct list_head waiting_queries; - struct list_head ctx_queries; struct list_head hw_queries; GLuint timer_query_id; @@ -93,7 +92,6 @@ struct vrend_query { int ctx_id; struct vrend_resource *res; uint64_t current_total; - boolean active_hw; }; #define VIRGL_INVALID_RESOURCE 1 @@ -4841,51 +4839,6 @@ void vrend_renderer_check_queries(void) } } -static void vrend_do_end_query(struct vrend_query *q) -{ - glEndQuery(q->gltype); - q->active_hw = FALSE; -} - -static void vrend_ctx_finish_queries(struct vrend_context *ctx) -{ - struct vrend_query *query; - - LIST_FOR_EACH_ENTRY(query, &ctx->active_nontimer_query_list, ctx_queries) { - if (query->active_hw == TRUE) - vrend_do_end_query(query); - } -} - -#if 0 -static void vrend_ctx_restart_queries(struct vrend_context *ctx) -{ - struct vrend_query *query; - struct vrend_nontimer_hw_query *hwq; - - if (ctx->query_on_hw == TRUE) - return; - - ctx->query_on_hw = TRUE; - LIST_FOR_EACH_ENTRY(query, &ctx->active_nontimer_query_list, ctx_queries) { - if (query->active_hw == FALSE) { - hwq = vrend_create_hw_query(query); - glBeginQuery(query->gltype, hwq->id); - query->active_hw = TRUE; - } - } -} -#endif - -/* stop all the nontimer queries running in the current context */ -void vrend_stop_current_queries(void) -{ - if (vrend_state.current_ctx && vrend_state.current_ctx->query_on_hw) { - vrend_ctx_finish_queries(vrend_state.current_ctx); - vrend_state.current_ctx->query_on_hw = FALSE; - } -} - boolean vrend_hw_switch_context(struct vrend_context *ctx, boolean now) { if (ctx == vrend_state.current_ctx && ctx->ctx_switch_pending == FALSE) @@ -4979,7 +4932,6 @@ int vrend_create_query(struct vrend_context *ctx, uint32_t handle, return ENOMEM; list_inithead(&q->waiting_queries); - list_inithead(&q->ctx_queries); list_inithead(&q->hw_queries); q->type = query_type; q->ctx_id = ctx->ctx_id; @@ -5027,7 +4979,6 @@ static void vrend_destroy_query(struct vrend_query *query) struct vrend_nontimer_hw_query *hwq, *stor; vrend_resource_reference(&query->res, NULL); - list_del(&query->ctx_queries); list_del(&query->waiting_queries); if (vrend_is_timer_query(query->gltype)) { glDeleteQueries(1, &query->timer_query_id); @@ -5067,9 +5018,6 @@ void vrend_begin_query(struct vrend_context *ctx, uint32_t handle) /* add to active query list for this context */ glBeginQuery(q->gltype, hwq->id); - - q->active_hw = TRUE; - list_addtail(&q->ctx_queries, &ctx->active_nontimer_query_list); } void vrend_end_query(struct vrend_context *ctx, uint32_t handle) @@ -5088,10 +5036,7 @@ void vrend_end_query(struct vrend_context *ctx, uint32_t handle) return; } - if (q->active_hw) - vrend_do_end_query(q); - - list_delinit(&q->ctx_queries); + glEndQuery(q->gltype); } void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle, diff --git a/src/vrend_renderer.h b/src/vrend_renderer.h index a9cdf03..1700ded 100644 --- a/src/vrend_renderer.h +++ b/src/vrend_renderer.h @@ -288,7 +288,6 @@ int vrend_renderer_create_fence(int client_fence_id, uint32_t ctx_id); void vrend_renderer_check_fences(void); void vrend_renderer_check_queries(void); -void vrend_stop_current_queries(void); boolean vrend_hw_switch_context(struct vrend_context *ctx, boolean now); uint32_t vrend_renderer_object_insert(struct vrend_context *ctx, void *data,