From: Kenneth Graunke Date: Sun, 21 Jan 2018 20:20:30 +0000 (-0800) Subject: iris: try and have an iris address X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d900a235b1cfd3aab9615d40779be30f6519e9f6;p=mesa.git iris: try and have an iris address --- diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 1dafc91ee7a..2b0be476991 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -45,14 +45,18 @@ #include "iris_pipe.h" #include "iris_resource.h" -#define __gen_address_type unsigned -#define __gen_user_data void +#define __gen_address_type struct iris_address +#define __gen_user_data struct iris_batch static uint64_t -__gen_combine_address(void *user_data, void *location, - unsigned address, uint32_t delta) +__gen_combine_address(struct iris_batch *batch, void *location, + struct iris_address addr, uint32_t delta) { - return delta; + if (addr.bo == NULL) + return addr.offset + delta; + + return iris_batch_reloc(batch, location - batch->cmdbuf.map, addr.bo, + addr.offset + delta, addr.reloc_flags); } #define __genxml_cmd_length(cmd) cmd ## _length @@ -249,7 +253,7 @@ translate_fill_mode(unsigned pipe_polymode) } static struct iris_address -ro_bo(struct brw_bo *bo, uint32_t offset) +ro_bo(struct iris_bo *bo, uint32_t offset) { return (struct iris_address) { .bo = bo, .offset = offset }; }