nvc0: upload small buffers through the command buffer
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 15 Jan 2011 11:17:00 +0000 (12:17 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 15 Jan 2011 11:17:00 +0000 (12:17 +0100)
src/gallium/drivers/nvc0/nvc0_buffer.c

index f5ac6557fe9bd9d94a90408e1a8016e3f765975c..dad69e17ef71a479025356a0879687ac9e1c21cd 100644 (file)
@@ -116,6 +116,12 @@ nvc0_buffer_upload(struct nvc0_context *nvc0, struct nvc0_resource *buf,
    struct nouveau_bo *bounce = NULL;
    uint32_t offset;
 
+   if (size <= 192) {
+      nvc0_m2mf_push_linear(nvc0, buf->bo, buf->domain, buf->offset + start,
+                            size, buf->data + start);
+      return TRUE;
+   }
+
    mm = nvc0_mm_allocate(nvc0->screen->mm_GART, size, &bounce, &offset);
    if (!bounce)
       return FALSE;