summaryrefslogtreecommitdiff
path: root/src/sna/sna_blt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-02-28 19:15:34 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-01 21:19:22 +0000
commita438e4ac9ba162e870fb22bc54024d35daa2121e (patch)
tree1a4e914947976e4f09c98f350a2d6a50d4834dcd /src/sna/sna_blt.c
parent272f5d9f8407d8084846b429c1722bddb3e861e9 (diff)
sna: Revamp vmap support
Dust off the kernel patches and update to reflect the changes made to support LLC CPU bo, in particular to support the unsynchronized shadow buffers. However, due to the forced synchronisation required for strict client coherency we prefer not to use the vmap for shared pixmaps unless we are already busy (i.e. sync afterwards rather than before in the hope that we can squash a few operations into one). Being able to block the reply to the client until the request is actually complete and so avoid the sync remains a dream. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_blt.c')
-rw-r--r--src/sna/sna_blt.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index a9ec8998..8c51a77c 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -907,7 +907,7 @@ prepare_blt_clear(struct sna *sna,
{
DBG(("%s\n", __FUNCTION__));
- op->blt = blt_composite_fill;
+ op->blt = blt_composite_fill;
if (op->dst.x|op->dst.y) {
op->box = blt_composite_fill_box;
op->boxes = blt_composite_fill_boxes;
@@ -915,7 +915,7 @@ prepare_blt_clear(struct sna *sna,
op->box = blt_composite_fill_box_no_offset;
op->boxes = blt_composite_fill_boxes_no_offset;
}
- op->done = nop_done;
+ op->done = nop_done;
return sna_blt_fill_init(sna, &op->u.blt,
op->dst.bo,
@@ -930,7 +930,7 @@ prepare_blt_fill(struct sna *sna,
{
DBG(("%s\n", __FUNCTION__));
- op->blt = blt_composite_fill;
+ op->blt = blt_composite_fill;
if (op->dst.x|op->dst.y) {
op->box = blt_composite_fill_box;
op->boxes = blt_composite_fill_boxes;
@@ -938,7 +938,7 @@ prepare_blt_fill(struct sna *sna,
op->box = blt_composite_fill_box_no_offset;
op->boxes = blt_composite_fill_boxes_no_offset;
}
- op->done = nop_done;
+ op->done = nop_done;
return sna_blt_fill_init(sna, &op->u.blt, op->dst.bo,
op->dst.pixmap->drawable.bitsPerPixel,
@@ -1126,9 +1126,9 @@ prepare_blt_copy(struct sna *sna,
DBG(("%s\n", __FUNCTION__));
if (sna->kgem.gen >= 60)
- op->done = gen6_blt_copy_done;
+ op->done = gen6_blt_copy_done;
else
- op->done = nop_done;
+ op->done = nop_done;
if (alpha_fixup) {
op->blt = blt_composite_copy_with_alpha;
@@ -1153,14 +1153,6 @@ prepare_blt_copy(struct sna *sna,
}
}
-static void blt_vmap_done(struct sna *sna, const struct sna_composite_op *op)
-{
- struct kgem_bo *bo = (struct kgem_bo *)op->u.blt.src_pixmap;
-
- if (bo)
- kgem_bo_destroy(&sna->kgem, bo);
-}
-
fastcall static void
blt_put_composite(struct sna *sna,
const struct sna_composite_op *op,
@@ -1395,26 +1387,18 @@ prepare_blt_put(struct sna *sna,
uint32_t alpha_fixup)
{
PixmapPtr src = op->u.blt.src_pixmap;
- struct sna_pixmap *priv = sna_pixmap_attach(src);
- struct kgem_bo *src_bo = NULL;
- struct kgem_bo *free_bo = NULL;
+ struct sna_pixmap *priv;
+ struct kgem_bo *src_bo;
DBG(("%s\n", __FUNCTION__));
- if (priv) {
+ op->done = nop_done;
+
+ src_bo = NULL;
+ priv = _sna_pixmap_attach(src);
+ if (priv)
src_bo = priv->cpu_bo;
- } else {
- src_bo = kgem_create_map(&sna->kgem,
- src->devPrivate.ptr,
- pixmap_size(src),
- 0);
- free_bo = src_bo;
- }
if (src_bo) {
- op->u.blt.src_pixmap = (void *)free_bo;
- op->done = blt_vmap_done;
-
- src_bo->pitch = src->devKind;
if (alpha_fixup) {
op->blt = blt_composite_copy_with_alpha;
op->box = blt_composite_copy_box_with_alpha;
@@ -1435,12 +1419,15 @@ prepare_blt_put(struct sna *sna,
GXcopy);
}
} else {
- if (alpha_fixup)
- return FALSE; /* XXX */
-
if (!sna_pixmap_move_to_cpu(src, MOVE_READ))
return FALSE;
+ assert(src->devKind);
+ assert(src->devPrivate.ptr);
+
+ if (alpha_fixup)
+ return FALSE; /* XXX */
+
if (alpha_fixup) {
op->u.blt.pixel = alpha_fixup;
op->blt = blt_put_composite_with_alpha;
@@ -1451,7 +1438,6 @@ prepare_blt_put(struct sna *sna,
op->box = blt_put_composite_box;
op->boxes = blt_put_composite_boxes;
}
- op->done = nop_done;
}
return TRUE;