{
static const char *writer_names[INTEL_CMD_WRITER_COUNT] = {
[INTEL_CMD_WRITER_BATCH] = "batch",
+ [INTEL_CMD_WRITER_SURFACE] = "surface",
+ [INTEL_CMD_WRITER_STATE] = "state",
[INTEL_CMD_WRITER_INSTRUCTION] = "instruction",
};
divider *= 4;
cmd->writers[INTEL_CMD_WRITER_BATCH].size = size / divider;
- cmd->writers[INTEL_CMD_WRITER_STATE].size = size / divider;
+ cmd->writers[INTEL_CMD_WRITER_SURFACE].size = size / divider / 2;
+ cmd->writers[INTEL_CMD_WRITER_STATE].size = size / divider / 2;
cmd->writers[INTEL_CMD_WRITER_INSTRUCTION].size = 16384 / divider;
}
enum intel_cmd_writer_type {
INTEL_CMD_WRITER_BATCH,
+ INTEL_CMD_WRITER_SURFACE,
INTEL_CMD_WRITER_STATE,
INTEL_CMD_WRITER_INSTRUCTION,
writer->bo, writer->used);
}
break;
+ case INTEL_CMD_WRITER_SURFACE:
+ fprintf(stderr, "decoding surface state buffer: %d states\n",
+ writer->item_used);
+ cmd_writer_decode_items(cmd, which);
+ break;
case INTEL_CMD_WRITER_STATE:
- fprintf(stderr, "decoding state buffer: %d states\n",
+ fprintf(stderr, "decoding dynamic state buffer: %d states\n",
writer->item_used);
cmd_writer_decode_items(cmd, which);
break;
dw[9] = 1;
cmd_reserve_reloc(cmd, 3);
- cmd_batch_reloc_writer(cmd, pos + 2, INTEL_CMD_WRITER_STATE, 1);
+ cmd_batch_reloc_writer(cmd, pos + 2, INTEL_CMD_WRITER_SURFACE, 1);
cmd_batch_reloc_writer(cmd, pos + 3, INTEL_CMD_WRITER_STATE, 1);
cmd_batch_reloc_writer(cmd, pos + 5, INTEL_CMD_WRITER_INSTRUCTION, 1);
}
size_t alignment, uint32_t len,
const uint32_t *dw)
{
+ const enum intel_cmd_writer_type which = INTEL_CMD_WRITER_SURFACE;
+ const XGL_SIZE size = len << 2;
+ const uint32_t offset = cmd_writer_reserve(cmd, which, alignment, size);
+ struct intel_cmd_writer *writer = &cmd->writers[which];
+ uint32_t *dst;
+
assert(item == INTEL_CMD_ITEM_SURFACE ||
item == INTEL_CMD_ITEM_BINDING_TABLE);
- return cmd_state_write(cmd, item, alignment, len, dw);
+ /* all states are at least aligned to 32-bytes */
+ assert(alignment % 32 == 0);
+
+ writer->used = offset + size;
+
+ if (intel_debug & INTEL_DEBUG_BATCH)
+ cmd_writer_record(cmd, which, item, offset, size);
+
+ dst = (uint32_t *) ((char *) writer->ptr + offset);
+ memcpy(dst, dw, size);
+
+ return offset;
}
/**
struct intel_bo *bo,
uint32_t bo_offset, uint32_t reloc_flags)
{
- const enum intel_cmd_writer_type which = INTEL_CMD_WRITER_STATE;
+ const enum intel_cmd_writer_type which = INTEL_CMD_WRITER_SURFACE;
cmd_writer_reloc(cmd, which, offset + (dw_index << 2),
(intptr_t) bo, bo_offset, reloc_flags);
enum intel_cmd_writer_type writer,
uint32_t writer_offset)
{
- const enum intel_cmd_writer_type which = INTEL_CMD_WRITER_STATE;
+ const enum intel_cmd_writer_type which = INTEL_CMD_WRITER_SURFACE;
cmd_writer_reloc(cmd, which, offset + (dw_index << 2),
(intptr_t) writer, writer_offset,