summaryrefslogtreecommitdiff
path: root/tools/null_state_gen/intel_batchbuffer.c
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@intel.com>2014-09-08 10:41:38 +0300
committerMika Kuoppala <mika.kuoppala@intel.com>2014-10-09 19:47:47 +0300
commitb69659c3f5ed285bd218350deeff52761aec3d10 (patch)
treeb4e1443ffb9451cc577175a7e71cb9fecf62dd3b /tools/null_state_gen/intel_batchbuffer.c
parenta1f847cba91b9e542e37bb80895d8f8909319dd3 (diff)
tools/null_state_gen: Add macro to emit commands with null state
In null/golden context there are multiple state commands where the actual state is always zero. For more compact batch representation add a macro which just emits command and the rest of the state as zero. v2: - Be more verbose about length bias (Bradley Volkin) - strip out unrelated state_offset declaration (Bradley Volkin) Cc: Volkin, Bradley D <bradley.d.volkin@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'tools/null_state_gen/intel_batchbuffer.c')
-rw-r--r--tools/null_state_gen/intel_batchbuffer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/null_state_gen/intel_batchbuffer.c b/tools/null_state_gen/intel_batchbuffer.c
index 2a0b3407..a31ea38e 100644
--- a/tools/null_state_gen/intel_batchbuffer.c
+++ b/tools/null_state_gen/intel_batchbuffer.c
@@ -274,3 +274,18 @@ const char *intel_batch_type_as_str(const struct bb_item *item)
return "UNKNOWN";
}
+
+void intel_batch_cmd_emit_null(struct intel_batchbuffer *batch,
+ const int cmd, const int len, const int len_bias,
+ const char *str)
+{
+ int i;
+
+ assert(len > 1);
+ assert((len - len_bias) >= 0);
+
+ bb_area_emit(batch->cmds, (cmd | (len - len_bias)), CMD, str);
+
+ for (i = len_bias-1; i < len; i++)
+ OUT_BATCH(0);
+}