From f257201c11fd1aff9319aaf47556b184141ac7cb Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 9 Jul 2009 11:41:47 +1000 Subject: nouveau: fix pin for buffers created with bo_wrap --- libdrm/nouveau/nouveau_bo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libdrm/nouveau/nouveau_bo.c b/libdrm/nouveau/nouveau_bo.c index e68533b7..fea3a7de 100644 --- a/libdrm/nouveau/nouveau_bo.c +++ b/libdrm/nouveau/nouveau_bo.c @@ -752,11 +752,13 @@ nouveau_bo_pin(struct nouveau_bo *bo, uint32_t flags) return nouveau_bo_pin_nomm(bo, flags); /* Ensure we have a kernel object... */ - if (!nvbo->handle) { + if (!nvbo->flags) { if (!(flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART))) return -EINVAL; nvbo->flags = flags; + } + if (!nvbo->handle) { ret = nouveau_bo_kalloc(nvbo, NULL); if (ret) return ret; -- cgit v1.2.3