From 3e76ed4e256dd7964deaf37b89220c775fd2891e Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 19 Nov 2010 13:34:22 -0500 Subject: r600g: All EVENT_WRITE packets need the EVENT_INDEX field 6xx-evergreen --- src/gallium/winsys/r600/drm/r600_hw_context.c | 16 ++++------------ src/gallium/winsys/r600/drm/r600d.h | 10 +++++++++- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gallium/winsys/r600') diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index b70dffabd7..71a531f535 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -1062,7 +1062,7 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw) ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_draw_initiator; } ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 0); - ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_CACHE_FLUSH_AND_INV_EVENT; + ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_EVENT) | EVENT_INDEX(0); /* flush color buffer */ for (int i = 0; i < 8; i++) { @@ -1099,7 +1099,7 @@ void r600_context_flush(struct r600_context *ctx) /* emit fence */ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE_EOP, 4); - ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT | (5 << 8); + ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT) | EVENT_INDEX(5); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = (1 << 29) | (0 << 24); ctx->pm4[ctx->pm4_cdwords++] = ctx->fence; @@ -1279,11 +1279,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query) /* emit begin query */ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2); - if (ctx->radeon->chip_class == EVERGREEN) { - ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE | EG_EVENT_INDEX(1); - } else { - ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE; - } + ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1); ctx->pm4[ctx->pm4_cdwords++] = query->num_results + r600_bo_offset(query->buffer); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0); @@ -1299,11 +1295,7 @@ void r600_query_end(struct r600_context *ctx, struct r600_query *query) { /* emit begin query */ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2); - if (ctx->radeon->chip_class == EVERGREEN) { - ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE | EG_EVENT_INDEX(1); - } else { - ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE; - } + ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE) | EVENT_INDEX(1); ctx->pm4[ctx->pm4_cdwords++] = query->num_results + 8 + r600_bo_offset(query->buffer); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0); diff --git a/src/gallium/winsys/r600/drm/r600d.h b/src/gallium/winsys/r600/drm/r600d.h index 3c39b3fa8b..4a08d504aa 100644 --- a/src/gallium/winsys/r600/drm/r600d.h +++ b/src/gallium/winsys/r600/drm/r600d.h @@ -94,7 +94,15 @@ #define EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT 0x14 #define EVENT_TYPE_ZPASS_DONE 0x15 #define EVENT_TYPE_CACHE_FLUSH_AND_INV_EVENT 0x16 -#define EG_EVENT_INDEX(x) ((x) << 8) +#define EVENT_TYPE(x) ((x) << 0) +#define EVENT_INDEX(x) ((x) << 8) + /* 0 - any non-TS event + * 1 - ZPASS_DONE + * 2 - SAMPLE_PIPELINESTAT + * 3 - SAMPLE_STREAMOUTSTAT* + * 4 - *S_PARTIAL_FLUSH + * 5 - TS events + */ #define PKT_TYPE_S(x) (((x) & 0x3) << 30) #define PKT_TYPE_G(x) (((x) >> 30) & 0x3) -- cgit v1.2.3