summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-30 15:11:34 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-30 15:39:30 +0000
commitd53d93ffa6e133f46c39595294ecf8e2182b5a68 (patch)
tree97443b1d6e711fd967f80793d9de7fb3e397d12d
parent6f99555b6b64a0e1baad1853569f7bf521c327c3 (diff)
sna: Update the partial buffer allocation size when reusing an old mapping
Whilst the old mapping is guaranteed to be larger than the requested allocation size, keep track of the actual size allows for better packing of future buffers. And the code also performs a sanity check that the buffer is the size we claim it to be... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index d97a6ac2..5ab5c83f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3365,6 +3365,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
if (old) {
DBG(("%s: reusing cpu map handle=%d for buffer\n",
__FUNCTION__, old->handle));
+ alloc = num_pages(old);
memcpy(&bo->base, old, sizeof(*old));
if (old->rq)