projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
437c748
)
r300g: avoid mapping the same buffer twice
author
Marek Olšák
<maraeo@gmail.com>
Sun, 3 Apr 2011 17:17:19 +0000
(19:17 +0200)
committer
Marek Olšák
<maraeo@gmail.com>
Sun, 3 Apr 2011 17:32:27 +0000
(19:32 +0200)
Shouldn't happen, but you never know.
src/gallium/winsys/radeon/drm/radeon_drm_bo.c
patch
|
blob
|
history
diff --git
a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index eb7225b8738a5e388ad47ee77606e646cf63ec30..4fd822014187f61f6d34c5e8c0ae754df005d6bb 100644
(file)
--- a/
src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/
src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@
-191,6
+191,11
@@
static void *radeon_bo_map_internal(struct pb_buffer *_buf,
/* Map the buffer. */
pipe_mutex_lock(bo->map_mutex);
+ /* Return the pointer if it's already mapped (in case of a race). */
+ if (bo->ptr) {
+ pipe_mutex_unlock(bo->map_mutex);
+ return bo->ptr;
+ }
args.handle = bo->handle;
args.offset = 0;
args.size = (uint64_t)bo->size;