r600g: Respect PB_USAGE_UNSYNCHRONIZED in radeon_bo_pb_map_internal().
authorHenri Verbeet <hverbeet@gmail.com>
Sun, 19 Sep 2010 20:58:42 +0000 (22:58 +0200)
committerHenri Verbeet <hverbeet@gmail.com>
Sun, 19 Sep 2010 21:03:03 +0000 (23:03 +0200)
src/gallium/winsys/r600/drm/radeon_bo_pb.c

index b8744b00eb4e2302872e3f4e101a968fa5148ff8..93dc927aba45e2d19d2b97a6892dee469306f694 100644 (file)
@@ -54,6 +54,14 @@ radeon_bo_pb_map_internal(struct pb_buffer *_buf,
 {
        struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
 
+       if (flags & PB_USAGE_UNSYNCHRONIZED) {
+               if (!buf->bo->data && radeon_bo_map(buf->mgr->radeon, buf->bo)) {
+                       return NULL;
+               }
+               LIST_DELINIT(&buf->maplist);
+               return buf->bo->data;
+       }
+
        if (p_atomic_read(&buf->bo->reference.count) > 1) {
                if (flags & PB_USAGE_DONTBLOCK) {
                        return NULL;