[2/9] radeonsi: rename rquery -> squery

Submitted by Marek Olšák on Jan. 19, 2019, 12:40 a.m.

Details

Message ID 20190119004022.6950-2-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák Jan. 19, 2019, 12:40 a.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 src/gallium/drivers/radeonsi/si_perfcounter.c | 34 +++----
 src/gallium/drivers/radeonsi/si_query.c       | 94 +++++++++----------
 src/gallium/drivers/radeonsi/si_query.h       |  8 +-
 3 files changed, 68 insertions(+), 68 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeonsi/si_perfcounter.c b/src/gallium/drivers/radeonsi/si_perfcounter.c
index 949724ca720..2da14f8868f 100644
--- a/src/gallium/drivers/radeonsi/si_perfcounter.c
+++ b/src/gallium/drivers/radeonsi/si_perfcounter.c
@@ -750,42 +750,42 @@  static void si_pc_emit_read(struct si_context *sctx,
 			radeon_emit(cs, 0); /* immediate */
 			radeon_emit(cs, 0);
 			radeon_emit(cs, va);
 			radeon_emit(cs, va >> 32);
 			va += sizeof(uint64_t);
 		}
 	}
 }
 
 static void si_pc_query_destroy(struct si_screen *sscreen,
-				struct si_query *rquery)
+				struct si_query *squery)
 {
-	struct si_query_pc *query = (struct si_query_pc *)rquery;
+	struct si_query_pc *query = (struct si_query_pc *)squery;
 
 	while (query->groups) {
 		struct si_query_group *group = query->groups;
 		query->groups = group->next;
 		FREE(group);
 	}
 
 	FREE(query->counters);
 
 	si_query_buffer_destroy(sscreen, &query->buffer);
 	FREE(query);
 }
 
-static void si_pc_query_resume(struct si_context *sctx, struct si_query *rquery)
+static void si_pc_query_resume(struct si_context *sctx, struct si_query *squery)
 /*
 				   struct si_query_hw *hwquery,
 				   struct si_resource *buffer, uint64_t va)*/
 {
-	struct si_query_pc *query = (struct si_query_pc *)rquery;
+	struct si_query_pc *query = (struct si_query_pc *)squery;
 	int current_se = -1;
 	int current_instance = -1;
 
 	if (!si_query_buffer_alloc(sctx, &query->buffer, NULL, query->result_size))
 		return;
 	si_need_gfx_cs_space(sctx);
 
 	if (query->shaders)
 		si_pc_emit_shaders(sctx, query->shaders);
 
@@ -801,23 +801,23 @@  static void si_pc_query_resume(struct si_context *sctx, struct si_query *rquery)
 		si_pc_emit_select(sctx, block, group->num_counters, group->selectors);
 	}
 
 	if (current_se != -1 || current_instance != -1)
 		si_pc_emit_instance(sctx, -1, -1);
 
 	uint64_t va = query->buffer.buf->gpu_address + query->buffer.results_end;
 	si_pc_emit_start(sctx, query->buffer.buf, va);
 }
 
-static void si_pc_query_suspend(struct si_context *sctx, struct si_query *rquery)
+static void si_pc_query_suspend(struct si_context *sctx, struct si_query *squery)
 {
-	struct si_query_pc *query = (struct si_query_pc *)rquery;
+	struct si_query_pc *query = (struct si_query_pc *)squery;
 
 	if (!query->buffer.buf)
 		return;
 
 	uint64_t va = query->buffer.buf->gpu_address + query->buffer.results_end;
 	query->buffer.results_end += query->result_size;
 
 	si_pc_emit_stop(sctx, query->buffer.buf, va);
 
 	for (struct si_query_group *group = query->groups; group; group = group->next) {
@@ -835,42 +835,42 @@  static void si_pc_query_suspend(struct si_context *sctx, struct si_query *rquery
 				si_pc_emit_instance(sctx, se, instance);
 				si_pc_emit_read(sctx, block, group->num_counters, va);
 				va += sizeof(uint64_t) * group->num_counters;
 			} while (group->instance < 0 && ++instance < block->num_instances);
 		} while (++se < se_end);
 	}
 
 	si_pc_emit_instance(sctx, -1, -1);
 }
 
-static bool si_pc_query_begin(struct si_context *ctx, struct si_query *rquery)
+static bool si_pc_query_begin(struct si_context *ctx, struct si_query *squery)
 {
-	struct si_query_pc *query = (struct si_query_pc *)rquery;
+	struct si_query_pc *query = (struct si_query_pc *)squery;
 
 	si_query_buffer_reset(ctx, &query->buffer);
 
 	LIST_ADDTAIL(&query->b.active_list, &ctx->active_queries);
 	ctx->num_cs_dw_queries_suspend += query->b.num_cs_dw_suspend;
 
-	si_pc_query_resume(ctx, rquery);
+	si_pc_query_resume(ctx, squery);
 
 	return true;
 }
 
-static bool si_pc_query_end(struct si_context *ctx, struct si_query *rquery)
+static bool si_pc_query_end(struct si_context *ctx, struct si_query *squery)
 {
-	struct si_query_pc *query = (struct si_query_pc *)rquery;
+	struct si_query_pc *query = (struct si_query_pc *)squery;
 
-	si_pc_query_suspend(ctx, rquery);
+	si_pc_query_suspend(ctx, squery);
 
-	LIST_DEL(&rquery->active_list);
-	ctx->num_cs_dw_queries_suspend -= rquery->num_cs_dw_suspend;
+	LIST_DEL(&squery->active_list);
+	ctx->num_cs_dw_queries_suspend -= squery->num_cs_dw_suspend;
 
 	return query->buffer.buf != NULL;
 }
 
 static void si_pc_query_add_result(struct si_query_pc *query,
 				   void *buffer,
 				   union pipe_query_result *result)
 {
 	uint64_t *results = buffer;
 	unsigned i, j;
@@ -878,34 +878,34 @@  static void si_pc_query_add_result(struct si_query_pc *query,
 	for (i = 0; i < query->num_counters; ++i) {
 		struct si_query_counter *counter = &query->counters[i];
 
 		for (j = 0; j < counter->qwords; ++j) {
 			uint32_t value = results[counter->base + j * counter->stride];
 			result->batch[i].u64 += value;
 		}
 	}
 }
 
-static bool si_pc_query_get_result(struct si_context *sctx, struct si_query *rquery,
+static bool si_pc_query_get_result(struct si_context *sctx, struct si_query *squery,
 				   bool wait, union pipe_query_result *result)
 {
-	struct si_query_pc *query = (struct si_query_pc *)rquery;
+	struct si_query_pc *query = (struct si_query_pc *)squery;
 
 	memset(result, 0, sizeof(result->batch[0]) * query->num_counters);
 
 	for (struct si_query_buffer *qbuf = &query->buffer; qbuf; qbuf = qbuf->previous) {
 		unsigned usage = PIPE_TRANSFER_READ |
 				 (wait ? 0 : PIPE_TRANSFER_DONTBLOCK);
 		unsigned results_base = 0;
 		void *map;
 
-		if (rquery->b.flushed)
+		if (squery->b.flushed)
 			map = sctx->ws->buffer_map(qbuf->buf->buf, NULL, usage);
 		else
 			map = si_buffer_map_sync_with_rings(sctx, qbuf->buf, usage);
 
 		if (!map)
 			return false;
 
 		while (results_base != qbuf->results_end) {
 			si_pc_query_add_result(query, map + results_base, result);
 			results_base += query->result_size;
diff --git a/src/gallium/drivers/radeonsi/si_query.c b/src/gallium/drivers/radeonsi/si_query.c
index b35a64727e3..266b9d3ce84 100644
--- a/src/gallium/drivers/radeonsi/si_query.c
+++ b/src/gallium/drivers/radeonsi/si_query.c
@@ -52,23 +52,23 @@  struct si_query_sw {
 	uint64_t end_result;
 
 	uint64_t begin_time;
 	uint64_t end_time;
 
 	/* Fence for GPU_FINISHED. */
 	struct pipe_fence_handle *fence;
 };
 
 static void si_query_sw_destroy(struct si_screen *sscreen,
-				struct si_query *rquery)
+				struct si_query *squery)
 {
-	struct si_query_sw *query = (struct si_query_sw *)rquery;
+	struct si_query_sw *query = (struct si_query_sw *)squery;
 
 	sscreen->b.fence_reference(&sscreen->b, &query->fence, NULL);
 	FREE(query);
 }
 
 static enum radeon_value_id winsys_id_from_type(unsigned type)
 {
 	switch (type) {
 	case SI_QUERY_REQUESTED_VRAM: return RADEON_REQUESTED_VRAM_MEMORY;
 	case SI_QUERY_REQUESTED_GTT: return RADEON_REQUESTED_GTT_MEMORY;
@@ -101,23 +101,23 @@  static int64_t si_finish_dma_get_cpu_time(struct si_context *sctx)
 	si_flush_dma_cs(sctx, 0, &fence);
 	if (fence) {
 		sctx->ws->fence_wait(sctx->ws, fence, PIPE_TIMEOUT_INFINITE);
 		sctx->ws->fence_reference(&fence, NULL);
 	}
 
 	return os_time_get_nano();
 }
 
 static bool si_query_sw_begin(struct si_context *sctx,
-			      struct si_query *rquery)
+			      struct si_query *squery)
 {
-	struct si_query_sw *query = (struct si_query_sw *)rquery;
+	struct si_query_sw *query = (struct si_query_sw *)squery;
 	enum radeon_value_id ws_id;
 
 	switch(query->b.type) {
 	case PIPE_QUERY_TIMESTAMP_DISJOINT:
 	case PIPE_QUERY_GPU_FINISHED:
 		break;
 	case SI_QUERY_TIME_ELAPSED_SDMA_SI:
 		query->begin_result = si_finish_dma_get_cpu_time(sctx);
 		break;
 	case SI_QUERY_DRAW_CALLS:
@@ -262,23 +262,23 @@  static bool si_query_sw_begin(struct si_context *sctx,
 	case SI_QUERY_GPIN_NUM_SE:
 		break;
 	default:
 		unreachable("si_query_sw_begin: bad query type");
 	}
 
 	return true;
 }
 
 static bool si_query_sw_end(struct si_context *sctx,
-			    struct si_query *rquery)
+			    struct si_query *squery)
 {
-	struct si_query_sw *query = (struct si_query_sw *)rquery;
+	struct si_query_sw *query = (struct si_query_sw *)squery;
 	enum radeon_value_id ws_id;
 
 	switch(query->b.type) {
 	case PIPE_QUERY_TIMESTAMP_DISJOINT:
 		break;
 	case PIPE_QUERY_GPU_FINISHED:
 		sctx->b.flush(&sctx->b, &query->fence, PIPE_FLUSH_DEFERRED);
 		break;
 	case SI_QUERY_TIME_ELAPSED_SDMA_SI:
 		query->end_result = si_finish_dma_get_cpu_time(sctx);
@@ -427,36 +427,36 @@  static bool si_query_sw_end(struct si_context *sctx,
 	case SI_QUERY_GPIN_NUM_SE:
 		break;
 	default:
 		unreachable("si_query_sw_end: bad query type");
 	}
 
 	return true;
 }
 
 static bool si_query_sw_get_result(struct si_context *sctx,
-				   struct si_query *rquery,
+				   struct si_query *squery,
 				   bool wait,
 				   union pipe_query_result *result)
 {
-	struct si_query_sw *query = (struct si_query_sw *)rquery;
+	struct si_query_sw *query = (struct si_query_sw *)squery;
 
 	switch (query->b.type) {
 	case PIPE_QUERY_TIMESTAMP_DISJOINT:
 		/* Convert from cycles per millisecond to cycles per second (Hz). */
 		result->timestamp_disjoint.frequency =
 			(uint64_t)sctx->screen->info.clock_crystal_freq * 1000;
 		result->timestamp_disjoint.disjoint = false;
 		return true;
 	case PIPE_QUERY_GPU_FINISHED: {
 		struct pipe_screen *screen = sctx->b.screen;
-		struct pipe_context *ctx = rquery->b.flushed ? NULL : &sctx->b;
+		struct pipe_context *ctx = squery->b.flushed ? NULL : &sctx->b;
 
 		result->b = screen->fence_finish(screen, ctx, query->fence,
 						 wait ? PIPE_TIMEOUT_INFINITE : 0);
 		return result->b;
 	}
 
 	case SI_QUERY_GFX_BO_LIST_SIZE:
 		result->u64 = (query->end_result - query->begin_result) /
 			      (query->end_time - query->begin_time);
 		return true;
@@ -588,27 +588,27 @@  bool si_query_buffer_alloc(struct si_context *sctx, struct si_query_buffer *buff
 			si_resource_reference(&buffer->buf, NULL);
 			return false;
 		}
 	}
 
 	return true;
 }
 
 
 void si_query_hw_destroy(struct si_screen *sscreen,
-			 struct si_query *rquery)
+			 struct si_query *squery)
 {
-	struct si_query_hw *query = (struct si_query_hw *)rquery;
+	struct si_query_hw *query = (struct si_query_hw *)squery;
 
 	si_query_buffer_destroy(sscreen, &query->buffer);
 	si_resource_reference(&query->workaround_buf, NULL);
-	FREE(rquery);
+	FREE(squery);
 }
 
 static bool si_query_hw_prepare_buffer(struct si_context *sctx,
 				       struct si_query_buffer *qbuf)
 {
 	static const struct si_query_hw si_query_hw_s;
 	struct si_query_hw *query = container_of(qbuf, &si_query_hw_s, buffer);
 	struct si_screen *screen = sctx->screen;
 
 	/* The caller ensures that the buffer is currently unused by the GPU. */
@@ -638,21 +638,21 @@  static bool si_query_hw_prepare_buffer(struct si_context *sctx,
 				}
 			}
 			results += 4 * max_rbs;
 		}
 	}
 
 	return true;
 }
 
 static void si_query_hw_get_result_resource(struct si_context *sctx,
-					    struct si_query *rquery,
+					    struct si_query *squery,
 					    bool wait,
 					    enum pipe_query_value_type result_type,
 					    int index,
 					    struct pipe_resource *resource,
 					    unsigned offset);
 
 static void si_query_hw_do_emit_start(struct si_context *sctx,
 				      struct si_query_hw *query,
 				      struct si_resource *buffer,
 				      uint64_t va);
@@ -1060,38 +1060,38 @@  static struct pipe_query *si_create_query(struct pipe_context *ctx, unsigned que
 	    (query_type >= PIPE_QUERY_DRIVER_SPECIFIC &&
 	     query_type != SI_QUERY_TIME_ELAPSED_SDMA))
 		return si_query_sw_create(query_type);
 
 	return si_query_hw_create(sscreen, query_type, index);
 }
 
 static void si_destroy_query(struct pipe_context *ctx, struct pipe_query *query)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_query *rquery = (struct si_query *)query;
+	struct si_query *squery = (struct si_query *)query;
 
-	rquery->ops->destroy(sctx->screen, rquery);
+	squery->ops->destroy(sctx->screen, squery);
 }
 
 static boolean si_begin_query(struct pipe_context *ctx,
                                 struct pipe_query *query)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_query *rquery = (struct si_query *)query;
+	struct si_query *squery = (struct si_query *)query;
 
-	return rquery->ops->begin(sctx, rquery);
+	return squery->ops->begin(sctx, squery);
 }
 
 bool si_query_hw_begin(struct si_context *sctx,
-		       struct si_query *rquery)
+		       struct si_query *squery)
 {
-	struct si_query_hw *query = (struct si_query_hw *)rquery;
+	struct si_query_hw *query = (struct si_query_hw *)squery;
 
 	if (query->flags & SI_QUERY_HW_FLAG_NO_START) {
 		assert(0);
 		return false;
 	}
 
 	if (!(query->flags & SI_QUERY_HW_FLAG_BEGIN_RESUMES))
 		si_query_buffer_reset(sctx, &query->buffer);
 
 	si_resource_reference(&query->workaround_buf, NULL);
@@ -1101,56 +1101,56 @@  bool si_query_hw_begin(struct si_context *sctx,
 		return false;
 
 	LIST_ADDTAIL(&query->b.active_list, &sctx->active_queries);
 	sctx->num_cs_dw_queries_suspend += query->b.num_cs_dw_suspend;
 	return true;
 }
 
 static bool si_end_query(struct pipe_context *ctx, struct pipe_query *query)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_query *rquery = (struct si_query *)query;
+	struct si_query *squery = (struct si_query *)query;
 
-	return rquery->ops->end(sctx, rquery);
+	return squery->ops->end(sctx, squery);
 }
 
 bool si_query_hw_end(struct si_context *sctx,
-		     struct si_query *rquery)
+		     struct si_query *squery)
 {
-	struct si_query_hw *query = (struct si_query_hw *)rquery;
+	struct si_query_hw *query = (struct si_query_hw *)squery;
 
 	if (query->flags & SI_QUERY_HW_FLAG_NO_START)
 		si_query_buffer_reset(sctx, &query->buffer);
 
 	si_query_hw_emit_stop(sctx, query);
 
 	if (!(query->flags & SI_QUERY_HW_FLAG_NO_START)) {
 		LIST_DELINIT(&query->b.active_list);
 		sctx->num_cs_dw_queries_suspend -= query->b.num_cs_dw_suspend;
 	}
 
 	if (!query->buffer.buf)
 		return false;
 
 	return true;
 }
 
 static void si_get_hw_query_params(struct si_context *sctx,
-				   struct si_query_hw *rquery, int index,
+				   struct si_query_hw *squery, int index,
 				   struct si_hw_query_params *params)
 {
 	unsigned max_rbs = sctx->screen->info.num_render_backends;
 
 	params->pair_stride = 0;
 	params->pair_count = 1;
 
-	switch (rquery->b.type) {
+	switch (squery->b.type) {
 	case PIPE_QUERY_OCCLUSION_COUNTER:
 	case PIPE_QUERY_OCCLUSION_PREDICATE:
 	case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
 		params->start_offset = 0;
 		params->end_offset = 8;
 		params->fence_offset = max_rbs * 16;
 		params->pair_stride = 16;
 		params->pair_count = max_rbs;
 		break;
 	case PIPE_QUERY_TIME_ELAPSED:
@@ -1182,21 +1182,21 @@  static void si_get_hw_query_params(struct si_context *sctx,
 		params->pair_count = SI_MAX_STREAMS;
 		params->pair_stride = 32;
 	case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
 		params->start_offset = 0;
 		params->end_offset = 16;
 
 		/* We can re-use the high dword of the last 64-bit value as a
 		 * fence: it is initialized as 0, and the high bit is set by
 		 * the write of the streamout stats event.
 		 */
-		params->fence_offset = rquery->result_size - 4;
+		params->fence_offset = squery->result_size - 4;
 		break;
 	case PIPE_QUERY_PIPELINE_STATISTICS:
 	{
 		static const unsigned offsets[] = {56, 48, 24, 32, 40, 16, 8, 0, 64, 72, 80};
 		params->start_offset = offsets[index];
 		params->end_offset = 88 + offsets[index];
 		params->fence_offset = 2 * 88;
 		break;
 	}
 	default:
@@ -1352,108 +1352,108 @@  static const struct si_query_ops query_hw_ops = {
 
 	.suspend = si_query_hw_suspend,
 	.resume = si_query_hw_resume,
 };
 
 static boolean si_get_query_result(struct pipe_context *ctx,
 				   struct pipe_query *query, boolean wait,
 				   union pipe_query_result *result)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_query *rquery = (struct si_query *)query;
+	struct si_query *squery = (struct si_query *)query;
 
-	return rquery->ops->get_result(sctx, rquery, wait, result);
+	return squery->ops->get_result(sctx, squery, wait, result);
 }
 
 static void si_get_query_result_resource(struct pipe_context *ctx,
 					 struct pipe_query *query,
 					 boolean wait,
 					 enum pipe_query_value_type result_type,
 					 int index,
 					 struct pipe_resource *resource,
 					 unsigned offset)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_query *rquery = (struct si_query *)query;
+	struct si_query *squery = (struct si_query *)query;
 
-	rquery->ops->get_result_resource(sctx, rquery, wait, result_type, index,
+	squery->ops->get_result_resource(sctx, squery, wait, result_type, index,
 	                                 resource, offset);
 }
 
 static void si_query_hw_clear_result(struct si_query_hw *query,
 				       union pipe_query_result *result)
 {
 	util_query_clear_result(result, query->b.type);
 }
 
 bool si_query_hw_get_result(struct si_context *sctx,
-			    struct si_query *rquery,
+			    struct si_query *squery,
 			    bool wait, union pipe_query_result *result)
 {
 	struct si_screen *sscreen = sctx->screen;
-	struct si_query_hw *query = (struct si_query_hw *)rquery;
+	struct si_query_hw *query = (struct si_query_hw *)squery;
 	struct si_query_buffer *qbuf;
 
 	query->ops->clear_result(query, result);
 
 	for (qbuf = &query->buffer; qbuf; qbuf = qbuf->previous) {
 		unsigned usage = PIPE_TRANSFER_READ |
 				 (wait ? 0 : PIPE_TRANSFER_DONTBLOCK);
 		unsigned results_base = 0;
 		void *map;
 
-		if (rquery->b.flushed)
+		if (squery->b.flushed)
 			map = sctx->ws->buffer_map(qbuf->buf->buf, NULL, usage);
 		else
 			map = si_buffer_map_sync_with_rings(sctx, qbuf->buf, usage);
 
 		if (!map)
 			return false;
 
 		while (results_base != qbuf->results_end) {
 			query->ops->add_result(sscreen, query, map + results_base,
 					       result);
 			results_base += query->result_size;
 		}
 	}
 
 	/* Convert the time to expected units. */
-	if (rquery->type == PIPE_QUERY_TIME_ELAPSED ||
-	    rquery->type == SI_QUERY_TIME_ELAPSED_SDMA ||
-	    rquery->type == PIPE_QUERY_TIMESTAMP) {
+	if (squery->type == PIPE_QUERY_TIME_ELAPSED ||
+	    squery->type == SI_QUERY_TIME_ELAPSED_SDMA ||
+	    squery->type == PIPE_QUERY_TIMESTAMP) {
 		result->u64 = (1000000 * result->u64) / sscreen->info.clock_crystal_freq;
 	}
 	return true;
 }
 
 static void si_restore_qbo_state(struct si_context *sctx,
 				 struct si_qbo_state *st)
 {
 	sctx->b.bind_compute_state(&sctx->b, st->saved_compute);
 
 	sctx->b.set_constant_buffer(&sctx->b, PIPE_SHADER_COMPUTE, 0, &st->saved_const0);
 	pipe_resource_reference(&st->saved_const0.buffer, NULL);
 
 	sctx->b.set_shader_buffers(&sctx->b, PIPE_SHADER_COMPUTE, 0, 3, st->saved_ssbo);
 	for (unsigned i = 0; i < 3; ++i)
 		pipe_resource_reference(&st->saved_ssbo[i].buffer, NULL);
 }
 
 static void si_query_hw_get_result_resource(struct si_context *sctx,
-                                              struct si_query *rquery,
+                                              struct si_query *squery,
                                               bool wait,
                                               enum pipe_query_value_type result_type,
                                               int index,
                                               struct pipe_resource *resource,
                                               unsigned offset)
 {
-	struct si_query_hw *query = (struct si_query_hw *)rquery;
+	struct si_query_hw *query = (struct si_query_hw *)squery;
 	struct si_query_buffer *qbuf;
 	struct si_query_buffer *qbuf_prev;
 	struct pipe_resource *tmp_buffer = NULL;
 	unsigned tmp_buffer_offset = 0;
 	struct si_qbo_state saved_state = {};
 	struct pipe_grid_info grid = {};
 	struct pipe_constant_buffer constant_buffer = {};
 	struct pipe_shader_buffer ssbo[3];
 	struct si_hw_query_params params;
 	struct {
@@ -1587,57 +1587,57 @@  static void si_query_hw_get_result_resource(struct si_context *sctx,
 	si_restore_qbo_state(sctx, &saved_state);
 	pipe_resource_reference(&tmp_buffer, NULL);
 }
 
 static void si_render_condition(struct pipe_context *ctx,
 				struct pipe_query *query,
 				boolean condition,
 				enum pipe_render_cond_flag mode)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_query_hw *rquery = (struct si_query_hw *)query;
+	struct si_query_hw *squery = (struct si_query_hw *)query;
 	struct si_atom *atom = &sctx->atoms.s.render_cond;
 
 	if (query) {
 		bool needs_workaround = false;
 
 		/* There was a firmware regression in VI which causes successive
 		 * SET_PREDICATION packets to give the wrong answer for
 		 * non-inverted stream overflow predication.
 		 */
 		if (((sctx->chip_class == VI && sctx->screen->info.pfp_fw_feature < 49) ||
 		     (sctx->chip_class == GFX9 && sctx->screen->info.pfp_fw_feature < 38)) &&
 		    !condition &&
-		    (rquery->b.type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE ||
-		     (rquery->b.type == PIPE_QUERY_SO_OVERFLOW_PREDICATE &&
-		      (rquery->buffer.previous ||
-		       rquery->buffer.results_end > rquery->result_size)))) {
+		    (squery->b.type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE ||
+		     (squery->b.type == PIPE_QUERY_SO_OVERFLOW_PREDICATE &&
+		      (squery->buffer.previous ||
+		       squery->buffer.results_end > squery->result_size)))) {
 			needs_workaround = true;
 		}
 
-		if (needs_workaround && !rquery->workaround_buf) {
+		if (needs_workaround && !squery->workaround_buf) {
 			bool old_force_off = sctx->render_cond_force_off;
 			sctx->render_cond_force_off = true;
 
 			u_suballocator_alloc(
 				sctx->allocator_zeroed_memory, 8, 8,
-				&rquery->workaround_offset,
-				(struct pipe_resource **)&rquery->workaround_buf);
+				&squery->workaround_offset,
+				(struct pipe_resource **)&squery->workaround_buf);
 
 			/* Reset to NULL to avoid a redundant SET_PREDICATION
 			 * from launching the compute grid.
 			 */
 			sctx->render_cond = NULL;
 
 			ctx->get_query_result_resource(
 				ctx, query, true, PIPE_QUERY_TYPE_U64, 0,
-				&rquery->workaround_buf->b.b, rquery->workaround_offset);
+				&squery->workaround_buf->b.b, squery->workaround_offset);
 
 			/* Settings this in the render cond atom is too late,
 			 * so set it here. */
 			sctx->flags |= sctx->screen->barrier_flags.L2_to_cp |
 				       SI_CONTEXT_FLUSH_FOR_RENDER_COND;
 
 			sctx->render_cond_force_off = old_force_off;
 		}
 	}
 
diff --git a/src/gallium/drivers/radeonsi/si_query.h b/src/gallium/drivers/radeonsi/si_query.h
index 9ce45d0f5cd..aaf0bd03aca 100644
--- a/src/gallium/drivers/radeonsi/si_query.h
+++ b/src/gallium/drivers/radeonsi/si_query.h
@@ -204,27 +204,27 @@  struct si_query_hw {
 	unsigned result_size;
 	/* For transform feedback: which stream the query is for */
 	unsigned stream;
 
 	/* Workaround via compute shader */
 	struct si_resource *workaround_buf;
 	unsigned workaround_offset;
 };
 
 void si_query_hw_destroy(struct si_screen *sscreen,
-			 struct si_query *rquery);
+			 struct si_query *squery);
 bool si_query_hw_begin(struct si_context *sctx,
-		       struct si_query *rquery);
+		       struct si_query *squery);
 bool si_query_hw_end(struct si_context *sctx,
-		     struct si_query *rquery);
+		     struct si_query *squery);
 bool si_query_hw_get_result(struct si_context *sctx,
-			    struct si_query *rquery,
+			    struct si_query *squery,
 			    bool wait,
 			    union pipe_query_result *result);
 void si_query_hw_suspend(struct si_context *sctx, struct si_query *query);
 void si_query_hw_resume(struct si_context *sctx, struct si_query *query);
 
 
 /* Performance counters */
 struct si_perfcounters {
 	unsigned num_groups;
 	unsigned num_blocks;