panfrost_batch_clear(batch, buffers, color, depth, stencil);
}
+/* TODO: Bifrost requires just a mali_shared_memory, without the rest of the
+ * framebuffer */
+
static void
panfrost_attach_vt_framebuffer(struct panfrost_context *ctx)
{
}
for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i)
- ctx->payloads[i].postfix.framebuffer = batch->framebuffer.gpu;
+ ctx->payloads[i].postfix.shared_memory = batch->framebuffer.gpu;
}
/* Reset per-frame context, called on context initialisation as well as after
panfrost_invalidate_frame(struct panfrost_context *ctx)
{
for (unsigned i = 0; i < PIPE_SHADER_TYPES; ++i)
- ctx->payloads[i].postfix.framebuffer = 0;
+ ctx->payloads[i].postfix.shared_memory = 0;
if (ctx->rasterizer)
ctx->dirty |= PAN_DIRTY_RASTERIZER;
u64 zero8;
} __attribute__((packed));
-struct bifrost_scratchpad {
- u32 zero;
- u32 flags; // = 0x1f
- /* This is a pointer to a CPU-inaccessible buffer, 16 pages, allocated
- * during startup. It seems to serve the same purpose as the
- * gpu_scratchpad in the SFBD for Midgard, although it's slightly
- * larger.
- */
- mali_ptr gpu_scratchpad;
-} __attribute__((packed));
-
struct mali_vertex_tiler_postfix {
/* Zero for vertex jobs. Pointer to the position (gl_Position) varying
* output from the vertex shader for tiler jobs.
u64 viewport;
u64 occlusion_counter; /* A single bit as far as I can tell */
- /* Note: on Bifrost, this isn't actually the FBD. It points to
- * bifrost_scratchpad instead. However, it does point to the same thing
- * in vertex and tiler jobs.
- */
- mali_ptr framebuffer;
+ /* On Bifrost, this points directly to a mali_shared_memory structure.
+ * On Midgard, this points to a framebuffer (either SFBD or MFBD as
+ * tagged), which embeds a mali_shared_memory structure */
+ mali_ptr shared_memory;
} __attribute__((packed));
struct midgard_payload_vertex_tiler {
free(ptr);
}
-static void
-pandecode_scratchpad(uintptr_t pscratchpad, int job_no, char *suffix)
-{
-
- struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(pscratchpad);
-
- struct bifrost_scratchpad *PANDECODE_PTR_VAR(scratchpad, mem, pscratchpad);
-
- if (scratchpad->zero) {
- pandecode_msg("XXX: scratchpad zero tripped");
- pandecode_prop("zero = 0x%x\n", scratchpad->zero);
- }
-
- pandecode_log("struct bifrost_scratchpad scratchpad_%"PRIx64"_%d%s = {\n", pscratchpad, job_no, suffix);
- pandecode_indent++;
-
- pandecode_prop("flags = 0x%x", scratchpad->flags);
- MEMORY_PROP(scratchpad, gpu_scratchpad);
-
- pandecode_indent--;
- pandecode_log("};\n");
-}
-
static const char *
shader_type_for_job(unsigned type)
{
.rt_count = 1
};
- if (is_bifrost)
- pandecode_scratchpad(p->framebuffer & ~1, job_no, suffix);
- else if (p->framebuffer & MALI_MFBD)
- fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->framebuffer) & FBD_MASK, job_no, false, job_type == JOB_TYPE_COMPUTE);
+ if (is_bifrost) {
+ 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);
else if (job_type == JOB_TYPE_COMPUTE)
- pandecode_compute_fbd((u64) (uintptr_t) p->framebuffer, job_no);
+ pandecode_compute_fbd((u64) (uintptr_t) p->shared_memory, job_no);
else
- fbd_info = pandecode_sfbd((u64) (uintptr_t) p->framebuffer, job_no, false, gpu_id);
+ fbd_info = pandecode_sfbd((u64) (uintptr_t) p->shared_memory, job_no, false, gpu_id);
int varying_count = 0, attribute_count = 0, uniform_count = 0, uniform_buffer_count = 0;
int texture_count = 0, sampler_count = 0;
/* MRT blend fields are used whenever MFBD is used, with
* per-RT descriptors */
- if (job_type == JOB_TYPE_TILER && p->framebuffer & MALI_MFBD) {
+ if (job_type == JOB_TYPE_TILER && p->shared_memory & MALI_MFBD) {
void* blend_base = (void *) (s + 1);
for (unsigned i = 0; i < fbd_info.rt_count; i++) {
bool is_mfbd = s->framebuffer & MALI_MFBD;
- /* Bifrost theoretically may retain support for SFBD on compute jobs,
- * but for graphics workloads with a FRAGMENT payload, use MFBD */
-
if (!is_mfbd && is_bifrost)
pandecode_msg("XXX: Bifrost fragment must use MFBD\n");