diff options
author | Michel Dänzer <[email protected]> | 2009-09-06 18:12:14 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2009-09-06 18:12:14 +0200 |
commit | 7b8ec0d8e72b4dd0c60db9c9454acd1f1ec75a7e (patch) | |
tree | 719aca9bea6c4afacbcbd193c3206601b5164182 /src/gallium/winsys | |
parent | 23663ae9148b9a976b8a95e48af8404cbda046fe (diff) |
r300g: Handle PIPE_BUFFER_USAGE_DONTBLOCK as intended.
Return NULL if the BO is busy, otherwise just map it.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 07551e7cd16..ee39af9f76a 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -134,8 +134,11 @@ static void *radeon_buffer_map(struct pipe_winsys *ws, (struct radeon_pipe_buffer*)buffer; int write = 0; - if (!(flags & PIPE_BUFFER_USAGE_DONTBLOCK)) { - radeon_bo_wait(radeon_buffer->bo); + if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { + uint32_t domain; + + if (radeon_bo_is_busy(radeon_buffer->bo, &domain)) + return NULL; } if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { write = 1; |