summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-05-17 13:00:12 -0700
committerMatt Turner <[email protected]>2014-05-24 23:03:23 -0700
commit392cbc2f930b2505520e85b97b407cb6d4e17548 (patch)
tree0416c3440fd74a137a4f0a3fd250fc268e91c5fb
parente32e69cc27471f91093d5ceba0a18b22b4e4f8c0 (diff)
i965: Move next_offset() to brw_eu.h for use elsewhere.
Also perform arithmetic on char* rather than void* since the latter is a GNU C extension not available in C++. Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h12
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c11
2 files changed, 12 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
index 8ce31a1d3b9..3c89365e3a4 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_eu.h
@@ -424,6 +424,18 @@ void brw_debug_compact_uncompact(struct brw_context *brw,
struct brw_instruction *orig,
struct brw_instruction *uncompacted);
+static inline int
+next_offset(void *store, int offset)
+{
+ struct brw_instruction *insn =
+ (struct brw_instruction *)((char *)store + offset);
+
+ if (insn->header.cmpt_control)
+ return offset + 8;
+ else
+ return offset + 16;
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index a357d5d6aab..38d327afc72 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -2383,17 +2383,6 @@ void brw_urb_WRITE(struct brw_compile *p,
}
static int
-next_offset(void *store, int offset)
-{
- struct brw_instruction *insn = (void *)store + offset;
-
- if (insn->header.cmpt_control)
- return offset + 8;
- else
- return offset + 16;
-}
-
-static int
brw_find_next_block_end(struct brw_compile *p, int start_offset)
{
int offset;