Module: Mesa Branch: refs/tags/segfault-fence_emit-3 Commit: a492c1a0fd7b8e54fae80d08c20302303a4efc5f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a492c1a0fd7b8e54fae80d08c20302303a4efc5f
Author: Emil Velikov <[email protected]> Date: Thu Jun 13 11:03:01 2013 +0100 nouveau: decompose resource_map_offset calculation Signed-off-by: Emil Velikov <[email protected]> --- src/gallium/drivers/nouveau/nouveau_buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c index 4709443..925b9d3 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -381,12 +381,14 @@ nouveau_resource_map_offset(struct nouveau_context *nv, struct nv04_resource *res, uint32_t offset, uint32_t flags) { + if (unlikely(res->status & NOUVEAU_BUFFER_STATUS_USER_MEMORY)) + return res->data + offset; + if ((res->domain == NOUVEAU_BO_VRAM) && (res->status & NOUVEAU_BUFFER_STATUS_GPU_WRITING)) nouveau_buffer_download(nv, res, 0, res->base.width0); - if ((res->domain != NOUVEAU_BO_GART) || - (res->status & NOUVEAU_BUFFER_STATUS_USER_MEMORY)) + if (res->domain != NOUVEAU_BO_GART) return res->data + offset; if (res->mm) { _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
