From 0148bd68397d66ead0acdb1a4bd4aa590488b50e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 7 Apr 2018 06:59:22 -0700 Subject: [PATCH] iris: decoder fixes --- src/gallium/drivers/iris/iris_batch.c | 8 +++++--- src/gallium/drivers/iris/iris_binder.h | 2 ++ src/gallium/drivers/iris/iris_state.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index c54f23f662e..0c62f1a8abb 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -81,13 +81,15 @@ decode_get_bo(void *v_batch, uint64_t address) for (int i = 0; i < batch->exec_count; i++) { struct iris_bo *bo = batch->exec_bos[i]; - if (address >= bo->gtt_offset && - address < bo->gtt_offset + bo->size) { + /* The decoder zeroes out the top 16 bits, so we need to as well */ + uint64_t bo_address = bo->gtt_offset & (~0ull >> 16); + + if (address >= bo_address && address < bo_address + bo->size) { return (struct gen_batch_decode_bo) { .addr = address, .size = bo->size, .map = iris_bo_map(batch->dbg, bo, MAP_READ) + - (address - bo->gtt_offset), + (address - bo_address), }; } } diff --git a/src/gallium/drivers/iris/iris_binder.h b/src/gallium/drivers/iris/iris_binder.h index 5830288b5c5..7a26602bf48 100644 --- a/src/gallium/drivers/iris/iris_binder.h +++ b/src/gallium/drivers/iris/iris_binder.h @@ -30,6 +30,8 @@ struct iris_bo; struct iris_bufmgr; +#define IRIS_BINDER_ADDRESS (1ull << 32) + struct iris_binder { struct iris_bo *bo; diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 38310cfd6c8..0b0cdc1960a 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2113,8 +2113,8 @@ iris_upload_render_state(struct iris_context *ice, struct iris_resource *res = (void *) view->pipe.texture; *bt_map++ = use_sampler_view(batch, view); } -#if 0 +#if 0 // XXX: not implemented yet assert(prog_data->binding_table.pull_constants_start == 0xd0d0d0d0); assert(prog_data->binding_table.ubo_start == 0xd0d0d0d0); -- 2.30.2