freedreno/a5xx: rename query result struct
authorRob Clark <robdclark@gmail.com>
Tue, 30 May 2017 11:30:18 +0000 (07:30 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 31 May 2017 00:40:58 +0000 (20:40 -0400)
Going to want the same thing for timestamp queries.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a5xx/fd5_query.c

index 2dc4b50897a286b6b1afa16d5064b34ca03eb463..9019a030899e5bcce684c9b7650adb2c6f2efcb2 100644 (file)
 #include "fd5_format.h"
 #include "fd5_query.h"
 
-/*
- * Occlusion Query:
- *
- * OCCLUSION_COUNTER and OCCLUSION_PREDICATE differ only in how they
- * interpret results
- */
-
-struct PACKED fd5_samples_passed {
+struct PACKED fd5_query_sample {
        uint64_t start;
        uint64_t result;
        uint64_t stop;
 };
 
-#define samples_passed(aq, field)               \
+#define query_sample(aq, field)                 \
        fd_resource((aq)->prsc)->bo,                \
-       offsetof(struct fd5_samples_passed, field), \
+       offsetof(struct fd5_query_sample, field),   \
        0, 0
 
+/*
+ * Occlusion Query:
+ *
+ * OCCLUSION_COUNTER and OCCLUSION_PREDICATE differ only in how they
+ * interpret results
+ */
+
 static void
 occlusion_resume(struct fd_acc_query *aq, struct fd_batch *batch)
 {
@@ -60,7 +60,7 @@ occlusion_resume(struct fd_acc_query *aq, struct fd_batch *batch)
        OUT_RING(ring, A5XX_RB_SAMPLE_COUNT_CONTROL_COPY);
 
        OUT_PKT4(ring, REG_A5XX_RB_SAMPLE_COUNT_ADDR_LO, 2);
-       OUT_RELOCW(ring, samples_passed(aq, start));
+       OUT_RELOCW(ring, query_sample(aq, start));
 
        OUT_PKT7(ring, CP_EVENT_WRITE, 1);
        OUT_RING(ring, ZPASS_DONE);
@@ -75,7 +75,7 @@ occlusion_pause(struct fd_acc_query *aq, struct fd_batch *batch)
        struct fd_ringbuffer *ring = batch->draw;
 
        OUT_PKT7(ring, CP_MEM_WRITE, 4);
-       OUT_RELOCW(ring, samples_passed(aq, stop));
+       OUT_RELOCW(ring, query_sample(aq, stop));
        OUT_RING(ring, 0xffffffff);
        OUT_RING(ring, 0xffffffff);
 
@@ -85,7 +85,7 @@ occlusion_pause(struct fd_acc_query *aq, struct fd_batch *batch)
        OUT_RING(ring, A5XX_RB_SAMPLE_COUNT_CONTROL_COPY);
 
        OUT_PKT4(ring, REG_A5XX_RB_SAMPLE_COUNT_ADDR_LO, 2);
-       OUT_RELOCW(ring, samples_passed(aq, stop));
+       OUT_RELOCW(ring, query_sample(aq, stop));
 
        OUT_PKT7(ring, CP_EVENT_WRITE, 1);
        OUT_RING(ring, ZPASS_DONE);
@@ -93,7 +93,7 @@ occlusion_pause(struct fd_acc_query *aq, struct fd_batch *batch)
 
        OUT_PKT7(ring, CP_WAIT_REG_MEM, 6);
        OUT_RING(ring, 0x00000014);   // XXX
-       OUT_RELOC(ring, samples_passed(aq, stop));
+       OUT_RELOC(ring, query_sample(aq, stop));
        OUT_RING(ring, 0xffffffff);
        OUT_RING(ring, 0xffffffff);
        OUT_RING(ring, 0x00000010);   // XXX
@@ -102,20 +102,19 @@ occlusion_pause(struct fd_acc_query *aq, struct fd_batch *batch)
        OUT_PKT7(ring, CP_MEM_TO_MEM, 9);
        OUT_RING(ring, CP_MEM_TO_MEM_0_DOUBLE |
                        CP_MEM_TO_MEM_0_NEG_C);
-       OUT_RELOCW(ring, samples_passed(aq, result));     /* dst */
-       OUT_RELOC(ring, samples_passed(aq, result));      /* srcA */
-       OUT_RELOC(ring, samples_passed(aq, stop));        /* srcB */
-       OUT_RELOC(ring, samples_passed(aq, start));       /* srcC */
+       OUT_RELOCW(ring, query_sample(aq, result));     /* dst */
+       OUT_RELOC(ring, query_sample(aq, result));      /* srcA */
+       OUT_RELOC(ring, query_sample(aq, stop));        /* srcB */
+       OUT_RELOC(ring, query_sample(aq, start));       /* srcC */
 
        fd5_context(batch->ctx)->samples_passed_queries--;
-
 }
 
 static void
 occlusion_counter_result(struct fd_context *ctx, void *buf,
                union pipe_query_result *result)
 {
-       struct fd5_samples_passed *sp = buf;
+       struct fd5_query_sample *sp = buf;
        result->u64 = sp->result;
 }
 
@@ -123,14 +122,14 @@ static void
 occlusion_predicate_result(struct fd_context *ctx, void *buf,
                union pipe_query_result *result)
 {
-       struct fd5_samples_passed *sp = buf;
+       struct fd5_query_sample *sp = buf;
        result->b = !!sp->result;
 }
 
 static const struct fd_acc_sample_provider occlusion_counter = {
                .query_type = PIPE_QUERY_OCCLUSION_COUNTER,
                .active = FD_STAGE_DRAW,
-               .size = sizeof(struct fd5_samples_passed),
+               .size = sizeof(struct fd5_query_sample),
                .resume = occlusion_resume,
                .pause = occlusion_pause,
                .result = occlusion_counter_result,
@@ -139,7 +138,7 @@ static const struct fd_acc_sample_provider occlusion_counter = {
 static const struct fd_acc_sample_provider occlusion_predicate = {
                .query_type = PIPE_QUERY_OCCLUSION_PREDICATE,
                .active = FD_STAGE_DRAW,
-               .size = sizeof(struct fd5_samples_passed),
+               .size = sizeof(struct fd5_query_sample),
                .resume = occlusion_resume,
                .pause = occlusion_pause,
                .result = occlusion_predicate_result,