[Mesa-dev] [PATCH] gallium/radeon: fix crash/regression in performance counters

Nicolai Hähnle nhaehnle at gmail.com
Fri Sep 30 10:04:33 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Cc: Michel Dänzer <michel at daenzer.net>
---
 src/gallium/drivers/radeon/r600_perfcounter.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_perfcounter.c b/src/gallium/drivers/radeon/r600_perfcounter.c
index f8dfda0..0c55fc2 100644
--- a/src/gallium/drivers/radeon/r600_perfcounter.c
+++ b/src/gallium/drivers/radeon/r600_perfcounter.c
@@ -108,20 +108,28 @@ static void r600_pc_query_destroy(struct r600_common_context *ctx,
 		struct r600_pc_group *group = query->groups;
 		query->groups = group->next;
 		FREE(group);
 	}
 
 	FREE(query->counters);
 
 	r600_query_hw_destroy(ctx, rquery);
 }
 
+static bool r600_pc_query_prepare_buffer(struct r600_common_context *ctx,
+					 struct r600_query_hw *hwquery,
+					 struct r600_resource *buffer)
+{
+	/* no-op */
+	return true;
+}
+
 static void r600_pc_query_emit_start(struct r600_common_context *ctx,
 				     struct r600_query_hw *hwquery,
 				     struct r600_resource *buffer, uint64_t va)
 {
 	struct r600_perfcounters *pc = ctx->screen->perfcounters;
 	struct r600_query_pc *query = (struct r600_query_pc *)hwquery;
 	struct r600_pc_group *group;
 	int current_se = -1;
 	int current_instance = -1;
 
@@ -208,20 +216,21 @@ static void r600_pc_query_add_result(struct r600_common_context *ctx,
 }
 
 static struct r600_query_ops batch_query_ops = {
 	.destroy = r600_pc_query_destroy,
 	.begin = r600_query_hw_begin,
 	.end = r600_query_hw_end,
 	.get_result = r600_query_hw_get_result
 };
 
 static struct r600_query_hw_ops batch_query_hw_ops = {
+	.prepare_buffer = r600_pc_query_prepare_buffer,
 	.emit_start = r600_pc_query_emit_start,
 	.emit_stop = r600_pc_query_emit_stop,
 	.clear_result = r600_pc_query_clear_result,
 	.add_result = r600_pc_query_add_result,
 };
 
 static struct r600_pc_group *get_group_state(struct r600_common_screen *screen,
 					     struct r600_query_pc *query,
 					     struct r600_perfcounter_block *block,
 					     unsigned sub_gid)
-- 
2.7.4



More information about the mesa-dev mailing list