r300g: fix occlusion query hangs.
authorDave Airlie <airlied@redhat.com>
Sun, 21 Mar 2010 09:36:15 +0000 (19:36 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 21 Mar 2010 09:39:28 +0000 (19:39 +1000)
Okay need to revist the whole OQ stuff anyways, glean test asserts
which is never good.

I'm liking the cached bufmgr restrictions less and less, I think I'll
probably play with the fence and/or busy stuff ASAP and try and clean it up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r300/r300_context.c
src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c

index a55d2db039f3e04b432e61ff25f19aaede0191ed..60b441176d957009d1d62ce20372b87abef2291c 100644 (file)
@@ -200,7 +200,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
     /* Open up the OQ BO. */
     r300->oqbo = screen->buffer_create(screen, 4096,
-            PIPE_BUFFER_USAGE_VERTEX, 4096);
+            PIPE_BUFFER_USAGE_PIXEL, 4096);
     make_empty_list(&r300->query_list);
 
     r300_init_flush_functions(r300);
index 1d29b0b727adc35179b30dc89dc001f0990644ed..a8a7c45a96f3adc0b558ee8f855184380deafefb 100644 (file)
@@ -73,8 +73,10 @@ radeon_drm_buffer_map(struct pb_buffer *_buf,
     int write;
 
     if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) {
-       if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs))
-           return NULL;
+       if ((_buf->base.usage & PIPE_BUFFER_USAGE_VERTEX) ||
+           (_buf->base.usage & PIPE_BUFFER_USAGE_INDEX))
+           if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs))
+               return NULL;
     }
 
     if (buf->bo->ptr != NULL)