if (wallpapering) {
/* Inject in reverse order, with "predicted" job indices.
* THIS IS A HACK XXX */
- panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_TILER, false,
+ panfrost_new_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_TILER, false,
batch->scoreboard.job_index + 2, tp, tp_size, true);
- panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_VERTEX, false, 0,
+ panfrost_new_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_VERTEX, false, 0,
vp, vp_size, true);
return;
}
bool rasterizer_discard = ctx->rasterizer &&
ctx->rasterizer->base.rasterizer_discard;
- unsigned vertex = panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_VERTEX, false, 0,
+ unsigned vertex = panfrost_new_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_VERTEX, false, 0,
vp, vp_size, false);
if (rasterizer_discard)
return;
- panfrost_new_job(&batch->pool, &batch->scoreboard, JOB_TYPE_TILER, false, vertex, tp, tp_size,
+ panfrost_new_job(&batch->pool, &batch->scoreboard, MALI_JOB_TYPE_TILER, false, vertex, tp, tp_size,
false);
}
false);
panfrost_new_job(&batch->pool, &batch->scoreboard,
- JOB_TYPE_COMPUTE, true, 0, &payload,
+ MALI_JOB_TYPE_COMPUTE, true, 0, &payload,
sizeof(payload), false);
panfrost_flush_all_batches(ctx, 0);
}
panfrost_initialize_surface(batch, fb->zsbuf);
struct mali_job_descriptor_header header = {
- .job_type = JOB_TYPE_FRAGMENT,
+ .job_type = MALI_JOB_TYPE_FRAGMENT,
.job_index = 1,
.job_descriptor_size = 1
};
};
struct panfrost_bo *bos[] = { scratch };
- bool success = bit_submit(dev, JOB_TYPE_WRITE_VALUE,
+ bool success = bit_submit(dev, MALI_JOB_TYPE_WRITE_VALUE,
&payload, sizeof(payload), bos, 1, false);
return success && (((uint8_t *) scratch->cpu)[0] == 0x0);
scratchpad, shmem, shader, shader_desc, ubo, var, attr
};
- bool succ = bit_submit(dev, JOB_TYPE_VERTEX, &payload,
+ bool succ = bit_submit(dev, MALI_JOB_TYPE_VERTEX, &payload,
sizeof(payload), bos, ARRAY_SIZE(bos), debug);
/* Check the output varyings */
typedef uint64_t u64;
typedef uint64_t mali_ptr;
-enum mali_job_type {
- JOB_NOT_STARTED = 0,
- JOB_TYPE_NULL = 1,
- JOB_TYPE_WRITE_VALUE = 2,
- JOB_TYPE_CACHE_FLUSH = 3,
- JOB_TYPE_COMPUTE = 4,
- JOB_TYPE_VERTEX = 5,
- JOB_TYPE_GEOMETRY = 6,
- JOB_TYPE_TILER = 7,
- JOB_TYPE_FUSED = 8,
- JOB_TYPE_FRAGMENT = 9,
-};
-
enum mali_draw_mode {
MALI_DRAW_NONE = 0x0,
MALI_POINTS = 0x1,
#undef DEFINE_CASE
-static char *
-pandecode_job_type(enum mali_job_type type)
-{
-#define DEFINE_CASE(name) case JOB_TYPE_ ## name: return "JOB_TYPE_" #name
-
- switch (type) {
- DEFINE_CASE(NULL);
- DEFINE_CASE(WRITE_VALUE);
- DEFINE_CASE(CACHE_FLUSH);
- DEFINE_CASE(COMPUTE);
- DEFINE_CASE(VERTEX);
- DEFINE_CASE(TILER);
- DEFINE_CASE(FUSED);
- DEFINE_CASE(FRAGMENT);
-
- case JOB_NOT_STARTED:
- return "NOT_STARTED";
-
- default:
- pandecode_log("Warning! Unknown job type %x\n", type);
- return "!?!?!?";
- }
-
-#undef DEFINE_CASE
-}
-
static char *
pandecode_draw_mode(enum mali_draw_mode mode)
{
shader_type_for_job(unsigned type)
{
switch (type) {
- case JOB_TYPE_VERTEX: return "VERTEX";
- case JOB_TYPE_TILER: return "FRAGMENT";
- case JOB_TYPE_COMPUTE: return "COMPUTE";
+ case MALI_JOB_TYPE_VERTEX: return "VERTEX";
+ case MALI_JOB_TYPE_TILER: return "FRAGMENT";
+ case MALI_JOB_TYPE_COMPUTE: return "COMPUTE";
default:
return "UNKNOWN";
}
} else {
stats = disassemble_midgard(pandecode_dump_stream,
code, sz, gpu_id,
- type == JOB_TYPE_TILER ?
+ type == MALI_JOB_TYPE_TILER ?
MESA_SHADER_FRAGMENT : MESA_SHADER_VERTEX);
}
/* Print shader-db stats. Skip COMPUTE jobs since they are used for
* driver-internal purposes with the blob and interfere */
- bool should_shaderdb = type != JOB_TYPE_COMPUTE;
+ bool should_shaderdb = type != MALI_JOB_TYPE_COMPUTE;
if (should_shaderdb) {
unsigned nr_threads =
pandecode_log_cont("\t/* %X %/\n", p->shared_memory & 1);
pandecode_compute_fbd(p->shared_memory & ~1, job_no);
} else if (p->shared_memory & MALI_MFBD)
- fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->shared_memory) & FBD_MASK, job_no, false, job_type == JOB_TYPE_COMPUTE, false);
- else if (job_type == JOB_TYPE_COMPUTE)
+ fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->shared_memory) & FBD_MASK, job_no, false, job_type == MALI_JOB_TYPE_COMPUTE, false);
+ else if (job_type == MALI_JOB_TYPE_COMPUTE)
pandecode_compute_fbd((u64) (uintptr_t) p->shared_memory, job_no);
else
fbd_info = pandecode_sfbd((u64) (uintptr_t) p->shared_memory, job_no, false, gpu_id);
/* MRT blend fields are used whenever MFBD is used, with
* per-RT descriptors */
- if (job_type == JOB_TYPE_TILER && (is_bifrost || p->shared_memory & MALI_MFBD)) {
+ if (job_type == MALI_JOB_TYPE_TILER && (is_bifrost || p->shared_memory & MALI_MFBD)) {
void* blend_base = (void *) (s + 1);
for (unsigned i = 0; i < fbd_info.rt_count; i++) {
pandecode_log(".postfix = {\n");
pandecode_indent++;
- pandecode_gl_enables(p->gl_enables, JOB_TYPE_TILER);
+ pandecode_gl_enables(p->gl_enables, MALI_JOB_TYPE_TILER);
pandecode_prop("instance_shift = 0x%x", p->instance_shift);
pandecode_prop("instance_odd = 0x%x", p->instance_odd);
mali_ptr payload, int job_no, unsigned gpu_id)
{
struct midgard_payload_vertex_tiler *PANDECODE_PTR_VAR(v, mem, payload);
- bool is_graphics = (h->job_type == JOB_TYPE_VERTEX) || (h->job_type == JOB_TYPE_TILER);
+ bool is_graphics = (h->job_type == MALI_JOB_TYPE_VERTEX) || (h->job_type == MALI_JOB_TYPE_TILER);
pandecode_vertex_tiler_postfix_pre(&v->postfix, job_no, h->job_type, "", false, gpu_id);
* something else.
*/
int offset = h->job_descriptor_size == MALI_JOB_32 &&
- h->job_type != JOB_TYPE_FRAGMENT ? 4 : 0;
+ h->job_type != MALI_JOB_TYPE_FRAGMENT ? 4 : 0;
mali_ptr payload_ptr = jc_gpu_va + sizeof(*h) - offset;
payload = pandecode_fetch_gpu_mem(mem, payload_ptr, 256);
pandecode_log("struct mali_job_descriptor_header job_%"PRIx64"_%d = {\n", jc_gpu_va, job_no);
pandecode_indent++;
- pandecode_prop("job_type = %s", pandecode_job_type(h->job_type));
+ pandecode_prop("job_type = %s", mali_job_type_as_str(h->job_type));
if (h->job_descriptor_size)
pandecode_prop("job_descriptor_size = %d", h->job_descriptor_size);
pandecode_log("};\n");
switch (h->job_type) {
- case JOB_TYPE_WRITE_VALUE: {
+ 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++;
break;
}
- case JOB_TYPE_TILER:
- case JOB_TYPE_VERTEX:
- case JOB_TYPE_COMPUTE:
+ case MALI_JOB_TYPE_TILER:
+ case MALI_JOB_TYPE_VERTEX:
+ case MALI_JOB_TYPE_COMPUTE:
if (bifrost) {
- if (h->job_type == JOB_TYPE_TILER)
+ if (h->job_type == MALI_JOB_TYPE_TILER)
pandecode_tiler_job_bfr(h, mem, payload_ptr, job_no, gpu_id);
else
pandecode_vertex_job_bfr(h, mem, payload_ptr, job_no, gpu_id);
break;
- case JOB_TYPE_FRAGMENT:
+ case MALI_JOB_TYPE_FRAGMENT:
pandecode_fragment_job(mem, payload_ptr, job_no, bifrost, gpu_id);
break;
<panxml>
+ <enum name="Job Type">
+ <value name="Not started" value="0"/>
+ <value name="Null" value="1"/>
+ <value name="Write value" value="2"/>
+ <value name="Cache flush" value="3"/>
+ <value name="Compute" value="4"/>
+ <value name="Vertex" value="5"/>
+ <value name="Geometry" value="6"/>
+ <value name="Tiler" value="7"/>
+ <value name="Fused" value="8"/>
+ <value name="Fragment" value="9"/>
+ </enum>
+
</panxml>
panfrost_pack_work_groups_compute(&payload.prefix, 1, vertex_count, 1, 1, 1, 1, true);
payload.prefix.workgroups_x_shift_3 = 6;
- panfrost_new_job(pool, scoreboard, JOB_TYPE_TILER, false, 0, &payload, sizeof(payload), true);
+ panfrost_new_job(pool, scoreboard, MALI_JOB_TYPE_TILER, false, 0, &payload, sizeof(payload), true);
}
{
unsigned global_dep = 0;
- if (type == JOB_TYPE_TILER) {
+ if (type == MALI_JOB_TYPE_TILER) {
/* Tiler jobs must be chained, and on Midgard, the first tiler
* job must depend on the write value job, whose index we
* reserve now */
}
/* Form a chain */
- if (type == JOB_TYPE_TILER)
+ if (type == MALI_JOB_TYPE_TILER)
scoreboard->tiler_dep = index;
if (scoreboard->prev_job)
* regardless of size. */
struct mali_job_descriptor_header job = {
- .job_type = JOB_TYPE_WRITE_VALUE,
+ .job_type = MALI_JOB_TYPE_WRITE_VALUE,
.job_index = scoreboard->write_value_index,
.job_descriptor_size = 1,
.next_job = scoreboard->first_job