r600g,radeonsi: implement PIPE_QUERY_TIMESTAMP_DISJOINT
authorDavid Heidelberger <david.heidelberger@ixit.cz>
Sun, 1 Jun 2014 03:02:44 +0000 (05:02 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 10 Jun 2014 11:20:13 +0000 (13:20 +0200)
v2 Marek: set the query result correctly

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeon/r600_query.c

index a356aad5b32792701fcf8b7ea84ea474dcaceeb9..c43944160039aa8a9cd55a97424adf56930abfe6 100644 (file)
@@ -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:
                 * {