nv50: fix dri3 prime buffer creation
authorAxel Davy <axel.davy@ens.fr>
Fri, 27 Jun 2014 00:53:43 +0000 (20:53 -0400)
committerDave Airlie <airlied@gmail.com>
Fri, 27 Jun 2014 03:38:20 +0000 (13:38 +1000)
This is the same fix than
"nvc0: fix dri3 prime buffer creation"

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/nouveau/nv50/nv50_miptree.c

index 4c5517978c01d686937488cf3a8effbe5babbf5e..14e5a0da077fa76e6c322d858429711e6c197f56 100644 (file)
@@ -352,7 +352,12 @@ nv50_miptree_create(struct pipe_screen *pscreen,
    }
    bo_config.nv50.tile_mode = mt->level[0].tile_mode;
 
-   bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_NOSNOOP;
+   if (!bo_config.nv50.memtype && (pt->bind & PIPE_BIND_SHARED))
+      mt->base.domain = NOUVEAU_BO_GART;
+   else
+      mt->base.domain = NOUVEAU_BO_VRAM;
+
+   bo_flags = mt->base.domain | NOUVEAU_BO_NOSNOOP;
    if (mt->base.base.bind & (PIPE_BIND_CURSOR | PIPE_BIND_DISPLAY_TARGET))
       bo_flags |= NOUVEAU_BO_CONTIG;
 
@@ -362,7 +367,6 @@ nv50_miptree_create(struct pipe_screen *pscreen,
       FREE(mt);
       return NULL;
    }
-   mt->base.domain = NOUVEAU_BO_VRAM;
    mt->base.address = mt->base.bo->offset;
 
    return pt;