i965: Use old_bo->align when growing batch/state buffer instead of 4096.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 28 Nov 2017 16:30:50 +0000 (08:30 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 30 Nov 2017 01:30:35 +0000 (17:30 -0800)
The intention here is make the new BO use the same alignment as the old
BO.  This isn't strictly necessary, but we would have to update the
'alignment' field in the validation list when swapping it out, and we
don't bother today.

The batch and state buffers use an alignment of 4096, so this should be
equivalent - it's just clearer than cut and pasting a magic constant.

Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush."
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/intel_batchbuffer.c

index 10e33bb8c7b2987c4e9d4e63df22502c7cdac4a3..658f7ea69890502db938948c3c9a8ad8c8bd1039 100644 (file)
@@ -293,7 +293,8 @@ grow_buffer(struct brw_context *brw,
    uint32_t *old_map = *map_ptr;
    struct brw_bo *old_bo = *bo_ptr;
 
-   struct brw_bo *new_bo = brw_bo_alloc(bufmgr, old_bo->name, new_size, 4096);
+   struct brw_bo *new_bo =
+      brw_bo_alloc(bufmgr, old_bo->name, new_size, old_bo->align);
    uint32_t *new_map;
 
    perf_debug("Growing %s - ran out of space\n", old_bo->name);