summaryrefslogtreecommitdiff
path: root/tools/null_state_gen
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@intel.com>2014-10-09 18:35:49 +0300
committerMika Kuoppala <mika.kuoppala@intel.com>2014-10-09 19:15:11 +0300
commitb498d81f152760b2a58d53ac3acb5269f44a253d (patch)
tree4de7f4ba688ff28a718b57d92f6adf93bbf2d4bc /tools/null_state_gen
parentc283ead78c4cb5cd56d0a7e74ebc43970ff5741d (diff)
tools/null_state_gen: Add more debug output
Be more verbose about the state size we generate. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'tools/null_state_gen')
-rw-r--r--tools/null_state_gen/intel_null_state_gen.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/tools/null_state_gen/intel_null_state_gen.c b/tools/null_state_gen/intel_null_state_gen.c
index c72796b1..353556ab 100644
--- a/tools/null_state_gen/intel_null_state_gen.c
+++ b/tools/null_state_gen/intel_null_state_gen.c
@@ -32,8 +32,6 @@
#include "intel_batchbuffer.h"
-#define STATE_ALIGN 64
-
extern int gen6_setup_null_render_state(struct intel_batchbuffer *batch);
extern int gen7_setup_null_render_state(struct intel_batchbuffer *batch);
extern int gen8_setup_null_render_state(struct intel_batchbuffer *batch);
@@ -47,36 +45,52 @@ static void print_usage(char *s)
s);
}
+/* Creates the intel_renderstate_genX.c file for the particular
+ * GEN product
+ */
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");
+ /* Relocation offsets. These are byte offsets in the golden context
+ * batch buffer where the BB graphics address will be added to
+ * the indirect state offset already stored in those locations. The
+ * resulting value will inform the GPU where the indirect states are.
+ */
printf("static const u32 gen%d_null_state_relocs[] = {\n", gen);
for (i = 0; i < batch->cmds->num_items; i++) {
if (intel_batch_is_reloc(batch, i))
printf("\t0x%08x,\n", i * 4);
}
- printf("\t%d,\n", -1);
- printf("};\n\n");
+ printf("\t-1,\n};\n\n");
+ /* GPU commands to execute to set up the RCS golden state. This
+ * state will become the default config.
+ */
printf("static const u32 gen%d_null_state_batch[] = {\n", gen);
for (i = 0; i < intel_batch_num_cmds(batch); i++) {
+ const int offset = i * 4;
const struct bb_item *cmd = intel_batch_cmd_get(batch, i);
printf("\t0x%08x,", cmd->data);
if (debug)
- printf("\t /* 0x%08x %s '%s' */", i * 4,
- intel_batch_type_as_str(cmd), cmd->str);
+ printf("\t /* 0x%08x %s '%s' */", offset,
+ intel_batch_type_as_str(cmd), cmd->str);
- if (i * 4 == batch->cmds_end_offset)
+ if (offset == batch->cmds_end_offset) {
+ cmds = i + 1;
printf("\t /* cmds end */");
+ }
if (intel_batch_is_reloc(batch, i))
printf("\t /* reloc */");
- if (i * 4 == batch->state_start_offset)
+ if (offset == batch->state_start_offset)
printf("\t /* state start */");
if (i == intel_batch_num_cmds(batch) - 1)
@@ -87,9 +101,15 @@ static int print_state(int gen, struct intel_batchbuffer *batch)
printf("};\n\nRO_RENDERSTATE(%d);\n", gen);
+ fprintf(stderr, "Commands %lu (%lu bytes)\n", cmds, cmds * 4);
+ fprintf(stderr, "State %lu (%lu bytes)\n", batch->state->num_items, batch->state->num_items * 4);
+ fprintf(stderr, "Total %lu (%lu bytes)\n", batch->cmds->num_items, batch->cmds->num_items * 4);
+ fprintf(stderr, "\n");
+
return 0;
}
+/* Selects generator function for the given product and executes it. */
static int do_generate(int gen)
{
struct intel_batchbuffer *batch;