From dbb495c3aeef34eab2aabfdfaafb81facdea4100 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Jan 2012 10:34:08 +0000 Subject: [PATCH] sna: Attach to the pixmap for source counting when deferring uploads If we decide to defer the upload for this instance of the source pixmap, mark it so. Then if we do use it again we will upload it to a GPU bo and hopefully reuse those pixels. Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index f633daa1..8355d409 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -323,7 +323,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) pixmap->drawable.width, pixmap->drawable.height, pixmap->drawable.bitsPerPixel) == I915_TILING_NONE) { - priv = sna_pixmap(pixmap); + priv = sna_pixmap_attach(pixmap); upload = priv && priv->source_count++ > SOURCE_BIAS; } @@ -340,7 +340,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) return FALSE; count = SOURCE_BIAS; - priv = sna_pixmap(pixmap); + priv = sna_pixmap_attach(pixmap); if (priv) count = priv->source_count++;