From 5c60340ff0aeb43d0fa6818443ada0c5868d5dec Mon Sep 17 00:00:00 2001 From: Zbigniew Kempczyński Date: Thu, 4 Jun 2020 12:03:50 +0200 Subject: lib/intel_bufops: add fields for keeping offset and context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid relocations when intel_buf is used we need to keep previous offset and context. Add addr structure with offset and ctx fields. Signed-off-by: Zbigniew Kempczyński Cc: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson --- lib/gpu_cmds.c | 6 +++--- lib/intel_bufops.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c index 8c284eb1..417253a7 100644 --- a/lib/gpu_cmds.c +++ b/lib/gpu_cmds.c @@ -109,7 +109,7 @@ gen7_fill_surface_state(struct intel_bb *ibb, address = intel_bb_offset_reloc(ibb, buf->handle, read_domain, write_domain, - offset + 4, 0x0); + offset + 4, buf->addr.offset); igt_assert(address >> 32 == 0); ss->ss1.base_addr = address; @@ -161,7 +161,7 @@ gen8_fill_surface_state(struct intel_bb *ibb, address = intel_bb_offset_reloc(ibb, buf->handle, read_domain, write_domain, - offset + 4 * 8, 0x0); + offset + 4 * 8, buf->addr.offset); ss->ss8.base_addr = (uint32_t) address; ss->ss9.base_addr_hi = address >> 32; @@ -218,7 +218,7 @@ gen11_fill_surface_state(struct intel_bb *ibb, address = intel_bb_offset_reloc(ibb, buf->handle, read_domain, write_domain, - offset + 4 * 8, 0x0); + offset + 4 * 8, buf->addr.offset); ss->ss8.base_addr = (uint32_t) address; ss->ss9.base_addr_hi = address >> 32; diff --git a/lib/intel_bufops.h b/lib/intel_bufops.h index 3a4fae4e..95217cfe 100644 --- a/lib/intel_bufops.h +++ b/lib/intel_bufops.h @@ -18,6 +18,10 @@ struct intel_buf { uint32_t offset; uint32_t stride; } aux; + struct { + uint64_t offset; + uint32_t ctx; + } addr; }; static inline unsigned int intel_buf_width(const struct intel_buf *buf) -- cgit v1.2.3