summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-09-15 20:58:14 +1000
committerMarek Olšák <[email protected]>2010-09-15 13:26:04 +0200
commit09ef8e9283f17e5dc9fa4a86c659048acda833cb (patch)
treef7f6369f14e330cf785a35d0e9fe7dfd09925006 /src/gallium/winsys/radeon
parentcad87ebc3a9c176a44f5193af7e16d6ecad4e03f (diff)
r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb03e5134d9a41786178100109e80c5a test run glxgears, resize.
Diffstat (limited to 'src/gallium/winsys/radeon')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_buffer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
index 46e8df76067..cf665241c48 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
@@ -56,15 +56,18 @@ static void
radeon_drm_buffer_destroy(struct pb_buffer *_buf)
{
struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf);
+ int name;
if (buf->bo->ptr != NULL) {
remove_from_list(buf);
radeon_bo_unmap(buf->bo);
buf->bo->ptr = NULL;
}
-
- util_hash_table_remove(buf->mgr->buffer_handles,
- (void*)(uintptr_t)buf->bo->handle);
+ name = radeon_gem_name_bo(buf->bo);
+ if (name) {
+ util_hash_table_remove(buf->mgr->buffer_handles,
+ (void*)(uintptr_t)name);
+ }
radeon_bo_unref(buf->bo);
FREE(buf);