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>
This commit is contained in:
parent
6f99555b6b
commit
d53d93ffa6
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue