diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2020-06-04 12:03:50 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-06-06 12:47:06 +0100 |
commit | 5c60340ff0aeb43d0fa6818443ada0c5868d5dec (patch) | |
tree | 6461c1618bc8a471895fb06737eef7317f71877d /lib | |
parent | 53e8c878a6fb5708e63c99403691e8960b86ea9c (diff) |
lib/intel_bufops: add fields for keeping offset and context
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 <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gpu_cmds.c | 6 | ||||
-rw-r--r-- | 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 8c284eb14..417253a71 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 3a4fae4e4..95217cfe4 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) |