Commit 3e9d7a39 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Identify clear flags field

parent 5c8ffc69
......@@ -342,6 +342,12 @@ struct mali_payload_fragment {
/* (Single?) Framebuffer Descriptor */
/* Fast/slow based on whether all three buffers are cleared at once */
#define MALI_CLEAR_FAST (1 << 18)
#define MALI_CLEAR_SLOW (1 << 28)
#define MALI_CLEAR_SLOW_STENCIL (1 << 31)
struct mali_tentative_sfbd {
u32 unknown1;
u32 flags;
......@@ -350,7 +356,7 @@ struct mali_tentative_sfbd {
u64 heap_free_address;
u32 unknown2; // 0xB8..
u32 unknown3; // 0x10..
u32 clear_flags;
u32 zero2;
/* Purposeful off-by-one in these fields should be accounted for by the
......
......@@ -38,6 +38,17 @@ static const struct panwrap_flag_info gl_enable_flag_info[] = {
};
#undef FLAG_INFO
#define FLAG_INFO(flag) { MALI_CLEAR_##flag, "MALI_CLEAR_" #flag }
static const struct panwrap_flag_info clear_flag_info[] = {
FLAG_INFO(FAST),
FLAG_INFO(SLOW),
FLAG_INFO(SLOW_STENCIL),
{}
};
#undef FLAG_INFO
extern char* replace_fragment;
extern char* replace_vertex;
......@@ -123,13 +134,19 @@ panwrap_replay_sfbd(uint64_t gpu_va, int job_no)
panwrap_prop("flags = 0x%" PRIx32, s->flags);
panwrap_prop("heap_free_address = 0x%" PRIx64, s->heap_free_address);
panwrap_prop("unknown2 = 0x%" PRIx32, s->unknown2);
panwrap_prop("unknown3 = 0x%" PRIx32, s->unknown3);
panwrap_prop("width = MALI_POSITIVE(%" PRId16 ")", s->width + 1);
panwrap_prop("height = MALI_POSITIVE(%" PRId16 ")", s->height + 1);
panwrap_property_u32_list("weights", s->weights, MALI_FBD_HIERARCHY_WEIGHTS);
/* Earlier in the actual commandstream -- right before width -- but we
* delay to flow nicer */
panwrap_log(".clear_flags = ");
panwrap_log_decoded_flags(clear_flag_info, s->clear_flags);
panwrap_log_cont(",\n");
if (s->depth_buffer | s->depth_buffer_enable) {
panwrap_prop("depth_buffer = " MALI_PTR_FMT, s->depth_buffer);
panwrap_prop("depth_buffer_enable = %s", DS_ENABLE(s->depth_buffer_enable));
......
......@@ -77,16 +77,17 @@ trans_fbd_clear(
sfbd->clear_stencil = stencil;
}
sfbd->unknown3 = 0x00101100;
/* XXX: What do these flags mean? */
sfbd->clear_flags = 0x00101100;
/* Fast path? */
if (clear_color && clear_depth && clear_stencil) {
sfbd->unknown3 |= 0x00040000;
sfbd->clear_flags |= MALI_CLEAR_FAST;
} else {
sfbd->unknown3 |= 0x10000000;
sfbd->clear_flags |= MALI_CLEAR_SLOW;
if (clear_stencil)
sfbd->unknown3 |= 0x80000000;
sfbd->clear_flags |= MALI_CLEAR_SLOW_STENCIL;
}
}
......
......@@ -166,7 +166,7 @@ void main(void) {
.flags = 0x1f,
.heap_free_address = 0x0,
.unknown2 = 0x30000000,
.unknown3 = 0x1000,
.clear_flags = 0x1000,
.weights = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, },
.unknown_address_0 = alloc_gpu_va_11 + 0,
.unknown_address_1 = alloc_gpu_va_11 + 24576,
......@@ -368,7 +368,6 @@ void main(void) {
.flags = 0x1f,
.heap_free_address = 0x0,
.unknown2 = 0xb84e0281,
.unknown3 = 0x10101100,
.weights = { 0x0, 0x0, 0x0, 0x0, 0x20c75c0, 0x1, 0xfffff9c0, 0x0, },
.unknown_address_0 = alloc_gpu_va_11 + 0,
.unknown_address_1 = alloc_gpu_va_11 + 24576,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment