summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-31 16:42:46 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-31 16:42:46 +0000
commitbdb1a62ce21f3eb5e27e411b78f13ad2aea963a4 (patch)
treed633400a14a589bce5135521c1a6c4f36d59e2f5 /src/sna/sna_accel.c
parentf934ee78a000815e14e36bd0caa279cb35d07bfe (diff)
sna: Balance memory accounting for buffer objects
A couple bugs ended up with CPU bo gradually accumulating whilst the overall number of bo vanished. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r--src/sna/sna_accel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index bbb6e2be..c9033858 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3863,6 +3863,10 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
kgem_bo_convert_to_gpu(&sna->kgem, priv->cpu_bo)) {
assert(!priv->mapped);
assert(!IS_STATIC_PTR(priv->ptr));
+#ifdef DEBUG_MEMORY
+ sna->debug_memory.cpu_bo_allocs--;
+ sna->debug_memory.cpu_bo_bytes -= kgem_bo_size(priv->cpu_bo);
+#endif
priv->gpu_bo = priv->cpu_bo;
priv->cpu_bo = NULL;
priv->ptr = NULL;