summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-11-19 11:51:37 -0500
committerJerome Glisse <jglisse@redhat.com>2010-11-19 11:53:01 -0500
commitfab804bdfeb0b8080b7ee52d4d79f0ef0e548d1f (patch)
tree4223b6fcdf6de4c877e48440e72231228cb6ef2f /src/gallium/winsys
parentc05ccc1ebde177646ac09c1bd6d1b4719e745f82 (diff)
r600g: fix occlusion query on evergreen (avoid lockup)
Occlusion query on evergreen need the event index field to be set otherwise we endup locking up the GPU. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c12
-rw-r--r--src/gallium/winsys/r600/drm/r600d.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index b2a11251bc..b70dffabd7 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -1279,7 +1279,11 @@ 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);
- ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE;
+ 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++] = query->num_results + r600_bo_offset(query->buffer);
ctx->pm4[ctx->pm4_cdwords++] = 0;
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0);
@@ -1295,7 +1299,11 @@ 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);
- ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE;
+ 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++] = 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 5ca7456e90..3c39b3fa8b 100644
--- a/src/gallium/winsys/r600/drm/r600d.h
+++ b/src/gallium/winsys/r600/drm/r600d.h
@@ -94,6 +94,7 @@
#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 PKT_TYPE_S(x) (((x) & 0x3) << 30)
#define PKT_TYPE_G(x) (((x) >> 30) & 0x3)