Mesa (master): r600g, radeonsi: implement PIPE_QUERY_TIMESTAMP_DISJOINT

Marek Olšák mareko at kemper.freedesktop.org
Tue Jun 10 11:25:22 UTC 2014


Module: Mesa
Branch: master
Commit: b0fd54900c89e2a994209d5a0007230e35dec3c6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0fd54900c89e2a994209d5a0007230e35dec3c6

Author: David Heidelberger <david.heidelberger at ixit.cz>
Date:   Sun Jun  1 05:02:44 2014 +0200

r600g,radeonsi: implement PIPE_QUERY_TIMESTAMP_DISJOINT

v2 Marek: set the query result correctly

Signed-off-by: David Heidelberger <david.heidelberger at ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/radeon/r600_query.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index a356aad..c439441 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -116,6 +116,7 @@ static struct r600_resource *r600_new_query_buffer(struct r600_common_context *c
 	case PIPE_QUERY_GPU_FINISHED:
 	case PIPE_QUERY_TIME_ELAPSED:
 	case PIPE_QUERY_TIMESTAMP:
+	case PIPE_QUERY_TIMESTAMP_DISJOINT:
 		break;
 	case PIPE_QUERY_PRIMITIVES_EMITTED:
 	case PIPE_QUERY_PRIMITIVES_GENERATED:
@@ -209,6 +210,8 @@ static void r600_emit_query_begin(struct r600_common_context *ctx, struct r600_q
 		radeon_emit(cs, va);
 		radeon_emit(cs, (va >> 32UL) & 0xFF);
 		break;
+	case PIPE_QUERY_TIMESTAMP_DISJOINT:
+		break;
 	default:
 		assert(0);
 	}
@@ -276,6 +279,7 @@ static void r600_emit_query_end(struct r600_common_context *ctx, struct r600_que
 		radeon_emit(cs, (va >> 32UL) & 0xFF);
 		break;
         case PIPE_QUERY_GPU_FINISHED:
+        case PIPE_QUERY_TIMESTAMP_DISJOINT:
 		break;
 	default:
 		assert(0);
@@ -371,6 +375,8 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q
 		query->result_size = 8;
 		query->num_cs_dw = 8;
 		break;
+	case PIPE_QUERY_TIMESTAMP_DISJOINT:
+		break;
 	case PIPE_QUERY_PRIMITIVES_EMITTED:
 	case PIPE_QUERY_PRIMITIVES_GENERATED:
 	case PIPE_QUERY_SO_STATISTICS:
@@ -606,6 +612,12 @@ static boolean r600_get_query_buffer_result(struct r600_common_context *ctx,
 			      (uint64_t)current_result[1] << 32;
 		break;
 	}
+	case PIPE_QUERY_TIMESTAMP_DISJOINT:
+		/* Convert from cycles per millisecond to cycles per second (Hz). */
+		result->timestamp_disjoint.frequency =
+			(uint64_t)ctx->screen->info.r600_clock_crystal_freq * 1000;
+		result->timestamp_disjoint.disjoint = FALSE;
+		break;
 	case PIPE_QUERY_PRIMITIVES_EMITTED:
 		/* SAMPLE_STREAMOUTSTATS stores this structure:
 		 * {




More information about the mesa-commit mailing list