i965g: Fixup buffer creation function
authorJakob Bornecrantz <jakob@vmware.com>
Fri, 6 Nov 2009 20:44:09 +0000 (20:44 +0000)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 6 Nov 2009 20:45:40 +0000 (20:45 +0000)
First tri!

src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c

index 725140fbabea6b21721791520d8f1286416ab045..1f3f19ab725bec67e9cbe8b09bd7a306a11f337f 100644 (file)
@@ -33,14 +33,23 @@ i965_libdrm_bo_alloc(struct brw_winsys_screen *sws,
 
    switch (type) {
    case BRW_BUFFER_TYPE_TEXTURE:
-      break;
+/* case BRW_BUFFER_TYPE_SCANOUT:*/
    case BRW_BUFFER_TYPE_VERTEX:
-      buf->map_gtt = TRUE;
+   case BRW_BUFFER_TYPE_CURBE:
+   case BRW_BUFFER_TYPE_QUERY:
+   case BRW_BUFFER_TYPE_SHADER_CONSTANTS:
+   case BRW_BUFFER_TYPE_SHADER_SCRATCH:
+   case BRW_BUFFER_TYPE_BATCH:
+   case BRW_BUFFER_TYPE_GENERAL_STATE:
+   case BRW_BUFFER_TYPE_SURFACE_STATE:
+   case BRW_BUFFER_TYPE_PIXEL:
+   case BRW_BUFFER_TYPE_GENERIC:
       break;
    case BRW_BUFFER_TYPE_SCANOUT:
       buf->map_gtt = TRUE;
       break;
    default:
+      assert(0);
       break;
    }
 
@@ -52,6 +61,7 @@ i965_libdrm_bo_alloc(struct brw_winsys_screen *sws,
    if (!buf->bo)
       goto err;
 
+   pipe_reference_init(&buf->base.reference, 1);
    buf->base.size = size;
    buf->base.sws = sws;