summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg/xorg_exa.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2009-08-28 16:56:59 +0200
committerJakob Bornecrantz <jakob@vmware.com>2009-08-28 17:10:58 +0200
commit1e9eb69f835e35116b8ada0fc2f05561fd8956d1 (patch)
treeba6c8df58faac71dadcd840368c3a87841c55fac /src/gallium/state_trackers/xorg/xorg_exa.c
parentd80242c2546f795e37ce88955c823c054fdfe217 (diff)
st/xorg: If migrating from a sw pixmap to a hw pixmap upload old contents
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_exa.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index 1650a06ca6..18afa01dbd 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -496,6 +496,21 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
width, height, pPixData, pPixmap->devKind, 0, 0);
exa->scrn->transfer_unmap(exa->scrn, transfer);
exa->scrn->tex_transfer_destroy(transfer);
+ } else if (priv->tex && pPixmap->devPrivate.ptr) {
+ struct pipe_transfer *transfer;
+
+ if (priv->map_count != 0)
+ FatalError("doing ExaModifyPixmapHeader on mapped buffer\n");
+
+ transfer =
+ exa->scrn->get_tex_transfer(exa->scrn, priv->tex, 0, 0, 0,
+ PIPE_TRANSFER_WRITE,
+ 0, 0, width, height);
+ util_copy_rect(exa->scrn->transfer_map(exa->scrn, transfer),
+ &priv->tex->block, transfer->stride, 0, 0,
+ width, height, pPixmap->devPrivate.ptr, pPixmap->devKind, 0, 0);
+ exa->scrn->transfer_unmap(exa->scrn, transfer);
+ exa->scrn->tex_transfer_destroy(transfer);
}
return TRUE;