diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-29 19:27:46 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-29 19:27:46 +0000 |
commit | ecd6cca617ac29cf2b1b2a4d33fca19b84fea2a9 (patch) | |
tree | 5bd669feaa7731da515342bb5e1f572ea9d2bdf5 | |
parent | d8f2e87473eae81e07922271b5f608fdceb4ae5e (diff) |
sna/gen5: Handle cpu-bo for render targets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen5_render.c | 21 | ||||
-rw-r--r-- | src/sna/gen6_render.c | 5 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index d4870b5f..8b683a83 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1856,20 +1856,29 @@ gen5_composite_set_target(PicturePtr dst, struct sna_composite_op *op) } op->dst.pixmap = get_drawable_pixmap(dst->pDrawable); + priv = sna_pixmap(op->dst.pixmap); + op->dst.width = op->dst.pixmap->drawable.width; op->dst.height = op->dst.pixmap->drawable.height; op->dst.format = dst->format; - priv = sna_pixmap_force_to_gpu(op->dst.pixmap); - if (priv == NULL) - return FALSE; DBG(("%s: pixmap=%p, format=%08x\n", __FUNCTION__, op->dst.pixmap, (unsigned int)op->dst.format)); + op->dst.bo = NULL; + if (priv && priv->gpu_bo == NULL) { + op->dst.bo = priv->cpu_bo; + op->damage = &priv->cpu_damage; + } + if (op->dst.bo == NULL) { + priv = sna_pixmap_force_to_gpu(op->dst.pixmap); + if (priv == NULL) + return FALSE; - op->dst.bo = priv->gpu_bo; - op->damage = &priv->gpu_damage; - if (sna_damage_is_all(&priv->gpu_damage, op->dst.width, op->dst.height)) + op->dst.bo = priv->gpu_bo; + op->damage = &priv->gpu_damage; + } + if (sna_damage_is_all(op->damage, op->dst.width, op->dst.height)) op->damage = NULL; DBG(("%s: bo=%p, damage=%p\n", __FUNCTION__, op->dst.bo, op->damage)); diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index de6ede94..5a889e75 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2048,10 +2048,9 @@ gen6_composite_set_target(struct sna_composite_op *op, PicturePtr dst) op->dst.bo = priv->gpu_bo; op->damage = &priv->gpu_damage; - if (sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = NULL; } + if (sna_damage_is_all(op->damage, op->dst.width, op->dst.height)) + op->damage = NULL; get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); |