From cb6a3dc2edf3cd612f833bc9a4656166735ee856 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 19 Apr 2012 10:34:23 +0100 Subject: sna: Discard proxy upload buffer if we choose to render to it Even if we try to avoid treating an upload buffer as a real GPU target, we may still choose to migrate the buffer to the GPU in order to keep other buffers on the GPU. In that case, we do want to create a real GPU bo. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 1c43fb76..06bd2c00 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2288,6 +2288,13 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags) goto active; } + if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) { + DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + assert(priv->gpu_bo->proxy->rq); + kgem_bo_destroy(&sna->kgem, priv->gpu_bo); + priv->gpu_bo = NULL; + } + if ((flags & MOVE_READ) == 0) sna_damage_destroy(&priv->cpu_damage); -- cgit v1.2.3