summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-12 20:25:50 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-12 20:25:50 +0000
commit7bde1f55a1075eefab0f083833508265fc0e91e7 (patch)
tree67946bd17f6538a641e355f72a2fe9284fce8b12
parent2ee7de1f1711d1058e5812c6aa0d94ecf9af7d8d (diff)
sna: After move-to-gpu signals yes, force the GPU bo creation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_render.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index d1e35000..11549b45 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -591,22 +591,16 @@ sna_render_pixmap_bo(struct sna *sna,
if (bo) {
bo = kgem_bo_reference(bo);
} else {
- if (texture_is_cpu(pixmap, &box) && !move_to_gpu(pixmap, &box)) {
+ if (!texture_is_cpu(pixmap, &box) || move_to_gpu(pixmap, &box)) {
+ priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ);
+ if (priv)
+ bo = kgem_bo_reference(priv->gpu_bo);
+ }
+ if (bo == NULL) {
DBG(("%s: uploading CPU box (%d, %d), (%d, %d)\n",
__FUNCTION__, box.x1, box.y1, box.x2, box.y2));
bo = upload(sna, channel, pixmap, &box);
}
-
- if (bo == NULL) {
- priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ);
- if (priv) {
- bo = kgem_bo_reference(priv->gpu_bo);
- } else {
- DBG(("%s: failed to upload pixmap to gpu, uploading CPU box (%d, %d), (%d, %d) instead\n",
- __FUNCTION__, box.x1, box.y1, box.x2, box.y2));
- bo = upload(sna, channel, pixmap, &box);
- }
- }
}
channel->bo = bo;
@@ -1148,7 +1142,7 @@ sna_render_picture_extract(struct sna *sna,
move_to_gpu(pixmap, &box)) {
struct sna_pixmap *priv;
- priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ);
+ priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ);
if (priv) {
src_bo = priv->gpu_bo;
upload = false;