intel: hide intel_cmd_reloc
And mark intel_mem in it const.
diff --git a/icd/intel/cmd.h b/icd/intel/cmd.h
index ebbbb25..a2a7427 100644
--- a/icd/intel/cmd.h
+++ b/icd/intel/cmd.h
@@ -38,6 +38,8 @@
struct intel_ds_state;
struct intel_dset;
+struct intel_cmd_reloc;
+
/*
* States bounded to the command buffer. We want to write states directly to
* the command buffer when possible, and reduce this struct.
@@ -84,26 +86,6 @@
} att;
};
-struct intel_cmd_reloc {
- XGL_UINT pos;
-
- uint32_t val;
- struct intel_mem *mem;
-
- /*
- * With application state tracking promised by XGL, we should be able to
- * set
- *
- * I915_EXEC_NO_RELOC
- * I915_EXEC_HANDLE_LUT
- * I915_EXEC_IS_PINNED
- *
- * once we figure them out.
- */
- uint16_t read_domains;
- uint16_t write_domain;
-};
-
struct intel_cmd {
struct intel_obj obj;
diff --git a/icd/intel/cmd_pipeline.c b/icd/intel/cmd_pipeline.c
index f49dbb8..ca3c2db 100644
--- a/icd/intel/cmd_pipeline.c
+++ b/icd/intel/cmd_pipeline.c
@@ -113,7 +113,7 @@
}
static void gen6_3DSTATE_INDEX_BUFFER(struct intel_cmd *cmd,
- struct intel_mem *mem,
+ const struct intel_mem *mem,
XGL_GPU_SIZE offset,
XGL_INDEX_TYPE type,
bool enable_cut_index)
diff --git a/icd/intel/cmd_priv.h b/icd/intel/cmd_priv.h
index e1e22df..c4f2efb 100644
--- a/icd/intel/cmd_priv.h
+++ b/icd/intel/cmd_priv.h
@@ -32,6 +32,26 @@
#define CMD_ASSERT(cmd, min_gen, max_gen) \
INTEL_GPU_ASSERT((cmd)->dev->gpu, (min_gen), (max_gen))
+struct intel_cmd_reloc {
+ XGL_UINT pos;
+
+ uint32_t val;
+ const struct intel_mem *mem;
+
+ /*
+ * With application state tracking promised by XGL, we should be able to
+ * set
+ *
+ * I915_EXEC_NO_RELOC
+ * I915_EXEC_HANDLE_LUT
+ * I915_EXEC_IS_PINNED
+ *
+ * once we figure them out.
+ */
+ uint16_t read_domains;
+ uint16_t write_domain;
+};
+
static inline int cmd_gen(const struct intel_cmd *cmd)
{
return intel_gpu_gen(cmd->dev->gpu);
@@ -62,7 +82,7 @@
* Add a reloc for the value at \p offset.
*/
static inline void cmd_add_reloc(struct intel_cmd *cmd, XGL_INT offset,
- uint32_t val, struct intel_mem *mem,
+ uint32_t val, const struct intel_mem *mem,
uint16_t read_domains, uint16_t write_domain)
{
struct intel_cmd_reloc *reloc = &cmd->relocs[cmd->reloc_used];
@@ -110,7 +130,7 @@
* Write a reloc and advance.
*/
static inline void cmd_write_r(struct intel_cmd *cmd, uint32_t val,
- struct intel_mem *mem,
+ const struct intel_mem *mem,
uint16_t read_domains, uint16_t write_domain)
{
cmd_add_reloc(cmd, 0, val, mem, read_domains, write_domain);