Mesa (master): radeon-gallium: Oh, look, we *do* already support DONTBLOCK.

Corbin Simpson csimpson at kemper.freedesktop.org
Wed Aug 19 04:29:00 UTC 2009


Module: Mesa
Branch: master
Commit: c0bc070ff5334db173df6f774257ae4c5c6e394e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c0bc070ff5334db173df6f774257ae4c5c6e394e

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Tue Aug 18 18:11:46 2009 -0700

radeon-gallium: Oh, look, we *do* already support DONTBLOCK.

Well, okay, the kernel doesn't, but that's no excuse for us! :3

---

 src/gallium/winsys/drm/radeon/core/radeon_buffer.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
index 775bda8..07551e7 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
@@ -134,18 +134,17 @@ static void *radeon_buffer_map(struct pipe_winsys *ws,
         (struct radeon_pipe_buffer*)buffer;
     int write = 0;
 
-    if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) {
-       /* XXX Remove this when radeon_bo_map supports DONTBLOCK */
-       return NULL;
+    if (!(flags & PIPE_BUFFER_USAGE_DONTBLOCK)) {
+        radeon_bo_wait(radeon_buffer->bo);
     }
     if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) {
         write = 1;
     }
 
-    radeon_bo_wait(radeon_buffer->bo);
-
-    if (radeon_bo_map(radeon_buffer->bo, write))
+    if (radeon_bo_map(radeon_buffer->bo, write)) {
         return NULL;
+    }
+
     return radeon_buffer->bo->ptr;
 }
 




More information about the mesa-commit mailing list