Module: Mesa
Branch: refs/tags/crap-1
Commit: 4aeca8e5cee59a423663226a2225af576d6181af
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4aeca8e5cee59a423663226a2225af576d6181af

Author: Emil Velikov <[email protected]>
Date:   Thu Jun 13 11:14:29 2013 +0100

nouveau: compact/reorder map_offset calc

Signed-off-by: Emil Velikov <[email protected]>

---

 src/gallium/drivers/nouveau/nouveau_buffer.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c 
b/src/gallium/drivers/nouveau/nouveau_buffer.c
index 02bc6f0..f587f2c 100644
--- a/src/gallium/drivers/nouveau/nouveau_buffer.c
+++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
@@ -499,14 +499,13 @@ 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) {
       if (!res->data || (res->status & NOUVEAU_BUFFER_STATUS_GPU_WRITING))
          nouveau_buffer_cache(nv, res);
    }
-   if (res->domain != NOUVEAU_BO_GART)
+   if ((res->domain != NOUVEAU_BO_GART) ||
+       (res->status & NOUVEAU_BUFFER_STATUS_USER_MEMORY))
       return res->data + offset;
 
    if (res->mm) {

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to