From: Kenneth Graunke Date: Sat, 28 Apr 2018 23:55:54 +0000 (-0700) Subject: iris: blorp bug fixes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7167c6d508bb1102990e021a21130711fbb66cc5;p=mesa.git iris: blorp bug fixes I wrote this earlier, but it got lost somehow... --- diff --git a/src/gallium/drivers/iris/iris_blorp.c b/src/gallium/drivers/iris/iris_blorp.c index bee2e95a9cf..6b75d5f1eb8 100644 --- a/src/gallium/drivers/iris/iris_blorp.c +++ b/src/gallium/drivers/iris/iris_blorp.c @@ -26,9 +26,11 @@ #include "iris_resource.h" #include "iris_context.h" +#include "util/u_upload_mgr.h" #include "intel/common/gen_l3_config.h" + +#define BLORP_USE_SOFTPIN #include "blorp/blorp_genX_exec.h" -#include "util/u_upload_mgr.h" static uint32_t * stream_state(struct iris_batch *batch, @@ -36,8 +38,7 @@ stream_state(struct iris_batch *batch, unsigned size, unsigned alignment, uint32_t *out_offset, - struct iris_bo **out_bo, - bool relative_to_base) + struct iris_bo **out_bo) { struct pipe_resource *res = NULL; void *ptr = NULL; @@ -47,9 +48,14 @@ stream_state(struct iris_batch *batch, struct iris_bo *bo = iris_resource_bo(res); iris_use_pinned_bo(batch, bo, false); - *out_bo = bo; - *out_offset += relative_to_base ? iris_bo_offset_from_base_address(bo) - : bo->gtt_offset; + /* If the caller has asked for a BO, we leave them the responsibility of + * adding bo->gtt_offset (say, by handing an address to genxml). If not, + * we assume they want the offset from a base address. + */ + if (out_bo) + *out_bo = bo; + else + *out_offset += iris_bo_offset_from_base_address(bo); pipe_resource_reference(&res, NULL); @@ -111,10 +117,9 @@ blorp_alloc_dynamic_state(struct blorp_batch *blorp_batch, { struct iris_context *ice = blorp_batch->blorp->driver_ctx; struct iris_batch *batch = blorp_batch->driver_batch; - struct iris_bo *bo; return stream_state(batch, ice->state.dynamic_uploader, - size, alignment, offset, &bo, true); + size, alignment, offset, NULL); } static void @@ -128,7 +133,6 @@ blorp_alloc_binding_table(struct blorp_batch *blorp_batch, { struct iris_context *ice = blorp_batch->blorp->driver_ctx; struct iris_batch *batch = blorp_batch->driver_batch; - struct iris_bo *bo; uint32_t *bt_map = iris_binder_reserve(&ice->state.binder, num_entries * sizeof(uint32_t), @@ -138,7 +142,7 @@ blorp_alloc_binding_table(struct blorp_batch *blorp_batch, for (unsigned i = 0; i < num_entries; i++) { surface_maps[i] = stream_state(batch, ice->state.surface_uploader, state_size, state_alignment, - &surface_offsets[i], &bo, true); + &surface_offsets[i], NULL); bt_map[i] = surface_offsets[i]; } } @@ -154,7 +158,7 @@ blorp_alloc_vertex_buffer(struct blorp_batch *blorp_batch, uint32_t offset; void *map = stream_state(batch, ice->ctx.stream_uploader, size, 64, - &offset, &bo, false); + &offset, &bo); *addr = (struct blorp_address) { .buffer = bo,