From d53d93ffa6e133f46c39595294ecf8e2182b5a68 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Jan 2012 15:11:34 +0000 Subject: [PATCH] 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 --- src/sna/kgem.c | 1 + 1 file changed, 1 insertion(+) 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)