summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/xlib
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-01-22 16:09:03 -0700
committerBrian Paul <[email protected]>2010-01-22 16:09:03 -0700
commit7b5ad23c7f7f9016f725cb1caa3cf8971aeedbc8 (patch)
tree5a31fa4eb2227654eb07ebdce1a954233fe4bc19 /src/gallium/winsys/xlib
parentd88b219cf37c488f57e18850c843078ff918b55d (diff)
parent099e8ec54d4f7b9cd9ae3a481d6a6ae60f4590be (diff)
Merge branch 'mesa_7_7_branch'
Conflicts: src/mesa/shader/prog_execute.c
Diffstat (limited to 'src/gallium/winsys/xlib')
-rw-r--r--src/gallium/winsys/xlib/xlib_softpipe.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c
index 49dbf443ca3..bf78aca6869 100644
--- a/src/gallium/winsys/xlib/xlib_softpipe.c
+++ b/src/gallium/winsys/xlib/xlib_softpipe.c
@@ -63,7 +63,7 @@ struct xm_buffer
XImage *tempImage;
#ifdef USE_XSHM
- int shm;
+ boolean shm; /** Is this a shared memory buffer? */
XShmSegmentInfo shminfo;
#endif
};
@@ -152,7 +152,7 @@ alloc_shm_ximage(struct xm_buffer *b, struct xmesa_buffer *xmb,
&b->shminfo,
width, height);
if (b->tempImage == NULL) {
- b->shm = 0;
+ b->shm = FALSE;
return;
}
@@ -169,12 +169,12 @@ alloc_shm_ximage(struct xm_buffer *b, struct xmesa_buffer *xmb,
mesaXErrorFlag = 0;
XDestroyImage(b->tempImage);
b->tempImage = NULL;
- b->shm = 0;
+ b->shm = FALSE;
(void) XSetErrorHandler(old_handler);
return;
}
- b->shm = 1;
+ b->shm = TRUE;
}
#endif /* USE_XSHM */
@@ -222,12 +222,13 @@ xm_buffer_destroy(struct pipe_buffer *buf)
oldBuf->shminfo.shmaddr = (char *) -1;
}
+ if (oldBuf->shm) {
+ oldBuf->data = NULL;
+ }
+
if (oldBuf->tempImage) {
- if (oldBuf->data == oldBuf->tempImage->data) {
- /* oldBuf->data points at the xshm memory which we'll now free */
- oldBuf->data = NULL;
- }
XDestroyImage(oldBuf->tempImage);
+ oldBuf->tempImage = NULL;
}
#endif
@@ -342,10 +343,8 @@ xm_buffer_create(struct pipe_winsys *pws,
buffer->base.usage = usage;
buffer->base.size = size;
- if (buffer->data == NULL) {
- /* align to 16-byte multiple for Cell */
- buffer->data = align_malloc(size, max(alignment, 16));
- }
+ /* align to 16-byte multiple for Cell */
+ buffer->data = align_malloc(size, max(alignment, 16));
return &buffer->base;
}