struct panfrost_bo *scratch = bit_bo_create(dev, 65536);
((uint32_t *) scratch->cpu)[0] = 0xAA;
- struct mali_payload_write_value payload = {
- .address = scratch->gpu,
- .value_descriptor = MALI_WRITE_VALUE_ZERO
+ struct mali_write_value_job_payload_packed payload;
+
+ pan_pack(&payload, WRITE_VALUE_JOB_PAYLOAD, cfg) {
+ cfg.address = scratch->gpu;
+ cfg.type = MALI_WRITE_VALUE_TYPE_ZERO;
};
struct panfrost_bo *bos[] = { scratch };
};
} __attribute__((packed));
-/* Details about write_value from panfrost igt tests which use it as a generic
- * dword write primitive */
-
-#define MALI_WRITE_VALUE_ZERO 3
-
-struct mali_payload_write_value {
- u64 address;
- u32 value_descriptor;
- u32 reserved;
- u64 immediate;
-} __attribute__((packed));
-
/*
* Mali Attributes
*
return sizeof(*s);
}
+static void
+pandecode_write_value_job(const struct pandecode_mapped_memory *mem,
+ mali_ptr job, int job_no)
+{
+ struct mali_write_value_job_packed *PANDECODE_PTR_VAR(p, mem, job);
+ pan_section_unpack(p, WRITE_VALUE_JOB, PAYLOAD, u);
+ DUMP_SECTION(WRITE_VALUE_JOB, PAYLOAD, p, "Write Value Payload:\n");
+ pandecode_log("\n");
+}
+
/* Entrypoint to start tracing. jc_gpu_va is the GPU address for the first job
* in the chain; later jobs are found by walking the chain. Bifrost is, well,
* if it's bifrost or not. GPU ID is the more finegrained ID (at some point, we
do {
struct pandecode_mapped_memory *mem =
pandecode_find_mapped_gpu_mem_containing(jc_gpu_va);
- void *payload;
-
pan_unpack(PANDECODE_PTR(mem, jc_gpu_va, struct mali_job_header_packed),
JOB_HEADER, h);
next_job = h.next;
mali_ptr payload_ptr = jc_gpu_va + MALI_JOB_HEADER_LENGTH;
- payload = pandecode_fetch_gpu_mem(mem, payload_ptr, 64);
+ pandecode_fetch_gpu_mem(mem, payload_ptr, 64);
int job_no = job_descriptor_number++;
pandecode_log("\n");
switch (h.type) {
- case MALI_JOB_TYPE_WRITE_VALUE: {
- struct mali_payload_write_value *s = payload;
- pandecode_log("struct mali_payload_write_value payload_%"PRIx64"_%d = {\n", payload_ptr, job_no);
- pandecode_indent++;
- MEMORY_PROP(s, address);
-
- if (s->value_descriptor != MALI_WRITE_VALUE_ZERO) {
- pandecode_msg("XXX: unknown value descriptor\n");
- pandecode_prop("value_descriptor = 0x%" PRIX32, s->value_descriptor);
- }
-
- if (s->reserved) {
- pandecode_msg("XXX: set value tripped\n");
- pandecode_prop("reserved = 0x%" PRIX32, s->reserved);
- }
-
- pandecode_prop("immediate = 0x%" PRIX64, s->immediate);
- pandecode_indent--;
- pandecode_log("};\n");
-
+ case MALI_JOB_TYPE_WRITE_VALUE:
+ pandecode_write_value_job(mem, jc_gpu_va, job_no);
break;
- }
case MALI_JOB_TYPE_TILER:
case MALI_JOB_TYPE_VERTEX:
<field name="Dependency 2" size="16" start="5:16" type="uint"/>
<field name="Next" size="64" start="6:0" type="address"/>
</struct>
+
+ <enum name="Write Value Type">
+ <value name="Cycle Counter" value="1"/>
+ <value name="System Timestamp" value="2"/>
+ <value name="Zero" value="3"/>
+ <value name="Immediate 8" value="4"/>
+ <value name="Immediate 16" value="5"/>
+ <value name="Immediate 32" value="6"/>
+ <value name="Immediate 64" value="7"/>
+ </enum>
+
+ <struct name="Write Value Job Payload">
+ <field name="Address" size="64" start="0:0" type="address"/>
+ <field name="Type" size="32" start="2:0" type="Write Value Type"/>
+ <field name="Immediate Value" size="64" start="4:0" type="uint"/>
+ </struct>
+
+ <aggregate name="Write Value Job">
+ <section name="Header" offset="0" type="Job Header"/>
+ <section name="Payload" offset="32" type="Write Value Job Payload"/>
+ </aggregate>
</panxml>
/* Okay, we do. Let's generate it. We'll need the job's polygon list
* regardless of size. */
- struct mali_payload_write_value payload = {
- .address = polygon_list,
- .value_descriptor = MALI_WRITE_VALUE_ZERO,
- };
-
struct panfrost_transfer transfer =
panfrost_pool_alloc_aligned(pool,
- MALI_JOB_HEADER_LENGTH + sizeof(payload),
+ MALI_WRITE_VALUE_JOB_LENGTH,
64);
- pan_pack(transfer.cpu, JOB_HEADER, job) {
- job.type = MALI_JOB_TYPE_WRITE_VALUE;
- job.index = scoreboard->write_value_index;
- job.next = scoreboard->first_job;
+ pan_section_pack(transfer.cpu, WRITE_VALUE_JOB, HEADER, header) {
+ header.type = MALI_JOB_TYPE_WRITE_VALUE;
+ header.index = scoreboard->write_value_index;
+ header.next = scoreboard->first_job;
}
- memcpy(transfer.cpu + MALI_JOB_HEADER_LENGTH, &payload, sizeof(payload));
+ pan_section_pack(transfer.cpu, WRITE_VALUE_JOB, PAYLOAD, payload) {
+ payload.address = polygon_list;
+ payload.type = MALI_WRITE_VALUE_TYPE_ZERO;
+ }
scoreboard->first_job = transfer.gpu;
}