@@ -274,3 +274,15 @@ 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 char *str) {
+ int i;
+
+ assert(len > 1);
+
+ bb_area_emit(batch->cmds, (cmd | (len - 2)), CMD, str);
+
+ for (i = 1; i < len; i++)
+ OUT_BATCH(0);
+}
@@ -34,7 +34,7 @@
#include <stdint.h>
#define MAX_RELOCS 64
-#define MAX_ITEMS 4096
+#define MAX_ITEMS 1024
#define MAX_STRLEN 256
#define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) @@ -69,6 +69,7 @@ struct intel_batchbuffer {
struct intel_batchbuffer *intel_batchbuffer_create(void);
+#define OUT_CMD(cmd, len) intel_batch_cmd_emit_null(batch, cmd, len,
+#cmd " " #len)
#define OUT_BATCH(d) bb_area_emit(batch->cmds, d, CMD, #d) #define OUT_BATCH_STATE_OFFSET(d) bb_area_emit(batch->cmds, d, STATE_OFFSET, #d) #define OUT_RELOC(batch, read_domain, write_domain, d) bb_area_emit(batch->cmds, d, RELOC, #d) @@ -81,6 +82,7 @@ uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch, void *d, unsign
const char *name);
uint32_t intel_batch_state_alloc(struct intel_batchbuffer *batch, unsigned bytes, unsigned align,
const char *name);
+uint32_t intel_batch_state_offset(struct intel_batchbuffer *batch,
+unsigned align);
unsigned intel_batch_num_cmds(struct intel_batchbuffer *batch);
@@ -94,4 +96,6 @@ const char *intel_batch_type_as_str(const struct bb_item *item); void bb_area_emit(struct bb_area *a, uint32_t dword, item_type type, const char *str); void bb_area_emit_offset(struct bb_area *a, unsigned i, uint32_t dword, item_type type, const char *str);
+void intel_batch_cmd_emit_null(struct intel_batchbuffer *batch, const
+int cmd, const int len, const char *str);
+
#endif
@@ -23,6 +23,9 @@ static void print_usage(char *s) static int print_state(int gen, struct intel_batchbuffer *batch) {
int i;
+ unsigned long cmds;
+
+ fprintf(stderr, "Generating for gen%d\n", gen);
printf("#include \"intel_renderstate.h\"\n\n");
@@ -43,8 +46,10 @@ static int print_state(int gen, struct intel_batchbuffer *batch)
printf("\t /* 0x%08x %s '%s' */", i * 4,