xf86-video-intel: src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Apr 19 02:36:28 PDT 2012


 src/sna/sna_accel.c |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit cb6a3dc2edf3cd612f833bc9a4656166735ee856
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 19 10:34:23 2012 +0100

    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 <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 1c43fb7..06bd2c0 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);
 


More information about the xorg-commit mailing list