diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-09-23 13:59:42 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-09-24 02:29:04 +0200 |
commit | 206d92912cfd1ac73233d9c027fa590b60270cb8 (patch) | |
tree | f93e503b60939e759e7b4ac467592965c5a24e75 | |
parent | 68afbe89c72d085dcbbf2b264f0201ab73fe339e (diff) |
r300g: fixup long-lived BO maps being incorrectly unmapped when flushing
Based on commit 3ddc714b20ac4e28b80c6f88d1993445fff2262c by Dave Airlie.
NOTE: This is a candidate for the 7.9 branch.
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_buffer.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c index cf665241c4..075ab5cb32 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c @@ -118,8 +118,10 @@ radeon_drm_buffer_map_internal(struct pb_buffer *_buf, return NULL; } - if (buf->bo->ptr != NULL) + if (buf->bo->ptr != NULL) { + remove_from_list(buf); return buf->bo->ptr; + } if (flags & PB_USAGE_DONTBLOCK) { uint32_t domain; @@ -142,14 +144,18 @@ radeon_drm_buffer_map_internal(struct pb_buffer *_buf, if (radeon_bo_map(buf->bo, write)) { return NULL; } - insert_at_tail(&buf->mgr->buffer_map_list, buf); + + remove_from_list(buf); return buf->bo->ptr; } static void radeon_drm_buffer_unmap_internal(struct pb_buffer *_buf) { - (void)_buf; + struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); + if (is_empty_list(buf)) { /* = is not inserted... */ + insert_at_tail(&buf->mgr->buffer_map_list, buf); + } } static void @@ -163,7 +169,7 @@ radeon_drm_buffer_get_base_buffer(struct pb_buffer *buf, static enum pipe_error -radeon_drm_buffer_validate(struct pb_buffer *_buf, +radeon_drm_buffer_validate(struct pb_buffer *_buf, struct pb_validate *vl, unsigned flags) { |