intel: intel_bo instead of intel_mem in intel_cmd_reloc
The spec states that
The rules for rebinding memory are different for images and all other object
types. Rebinding of a given non-image object should not occur from the time
of building a command buffer or a descriptor set which references that
object to the time at which the GPU has finished execution of that command
buffer or descriptor set. If a new memory location is bound to a non-image
object while that object is referenced in a command buffer scheduled for
execution on GPU, the execution results are not guaranteed after memory
rebinding.
and
Image memory can be rebound at any time, even during command buffer
construction or descriptor set building. A snapshot of image memory binding
at the time of building a command buffer or descriptor set data is taken and
recorded in command buffer or descriptor set on binding image to state or
referencing image otherwise.
diff --git a/icd/intel/cmd_priv.h b/icd/intel/cmd_priv.h
index 5fce14a..74e70fc 100644
--- a/icd/intel/cmd_priv.h
+++ b/icd/intel/cmd_priv.h
@@ -38,7 +38,7 @@
XGL_UINT pos;
uint32_t val;
- const struct intel_mem *mem;
+ struct intel_bo *bo;
/*
* With application state tracking promised by XGL, we should be able to
@@ -80,7 +80,7 @@
static inline void cmd_writer_add_reloc(struct intel_cmd *cmd,
struct intel_cmd_writer *writer,
XGL_INT offset, uint32_t val,
- const struct intel_mem *mem,
+ struct intel_bo *bo,
uint16_t read_domains,
uint16_t write_domain)
{
@@ -91,7 +91,7 @@
reloc->writer = writer;
reloc->pos = writer->used + offset;
reloc->val = val;
- reloc->mem = mem;
+ reloc->bo = bo;
reloc->read_domains = read_domains;
reloc->write_domain = write_domain;
@@ -151,14 +151,14 @@
* Add a reloc to the hardware command being built. No error checking.
*/
static inline void cmd_batch_reloc(struct intel_cmd *cmd,
- uint32_t val, const struct intel_mem *mem,
+ uint32_t val, struct intel_bo *bo,
uint16_t read_domains,
uint16_t write_domain)
{
struct intel_cmd_writer *writer = &cmd->batch;
cmd_writer_add_reloc(cmd, writer, 0, val,
- mem, read_domains, write_domain);
+ bo, read_domains, write_domain);
writer->used++;
}