summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-09-18 13:14:36 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-09-18 13:14:36 +1000
commitb1d8b6c4d986a6526f20e1e89982036f0ba85222 (patch)
tree5ca75a54aff8c5504731fe1e3dead9bbe3b92c44 /src/gallium/winsys
parent6fca18696d0e6a243f6fbb5a30de45100a8e5fa0 (diff)
parenta06d38a74e865a0373a7314aad26b25c27ef8c57 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index 2acbc94fc8..3334af175b 100644
--- a/src/gallium/winsys/xlib/xm_winsys.c
+++ b/src/gallium/winsys/xlib/xm_winsys.c
@@ -349,19 +349,26 @@ xmesa_display_surface_tiled(XMesaBuffer b, const struct pipe_surface *surf)
if (x + w > surf->width)
w = surf->width - x;
- offset *= 4 * TILE_SIZE * TILE_SIZE;
-
- twiddle_tile((uint *) ((char *) xm_buf->data + offset),
- tmpTile);
- ximage->data = (char*) tmpTile;
+ /* offset in pixels */
+ offset *= TILE_SIZE * TILE_SIZE;
if (XSHM_ENABLED(xm_buf)) {
+ ximage->data = (char *) xm_buf->data + 4 * offset;
+ /* make copy of tile data */
+ memcpy(tmpTile, (uint *) ximage->data, sizeof(tmpTile));
+ /* twiddle from temp to ximage in shared memory */
+ twiddle_tile(tmpTile, (uint *) ximage->data);
+ /* display image in shared memory */
#if defined(USE_XSHM) && !defined(XFree86Server)
XShmPutImage(b->xm_visual->display, b->drawable, b->gc,
ximage, 0, 0, x, y, w, h, False);
#endif
}
else {
+ /* twiddel from ximage buffer to temp tile */
+ twiddle_tile((uint *) xm_buf->data + offset, tmpTile);
+ /* display temp tile data */
+ ximage->data = (char *) tmpTile;
XPutImage(b->xm_visual->display, b->drawable, b->gc,
ximage, 0, 0, x, y, w, h);
}