From a5e6a5e5856622e01e136f7fbccf8d586400b1d4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 2 Apr 2022 13:22:04 -0400 Subject: [PATCH] asahi: Identify more depth pipeline fields Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/cmdbuf.xml | 10 ++++++---- src/asahi/lib/decode.c | 16 +++++++++++++++- src/gallium/drivers/asahi/magic.c | 8 ++++++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml index 6141325..4255b73 100644 --- a/src/asahi/lib/cmdbuf.xml +++ b/src/asahi/lib/cmdbuf.xml @@ -611,10 +611,12 @@ - - - - + + + + + + diff --git a/src/asahi/lib/decode.c b/src/asahi/lib/decode.c index f82659e..7547715 100644 --- a/src/asahi/lib/decode.c +++ b/src/asahi/lib/decode.c @@ -444,7 +444,10 @@ agxdecode_cmdstream(unsigned cmdbuf_handle, unsigned map_handle, bool verbose) DUMP_CL(IOGPU_INTERNAL_PIPELINES, ((uint32_t *) cmdbuf->ptr.cpu) + 160, "Internal pipelines"); DUMP_CL(IOGPU_AUX_FRAMEBUFFER, ((uint32_t *) cmdbuf->ptr.cpu) + 228, "Aux Framebuffer"); - DUMP_CL(IOGPU_CLEAR_Z_S, ((uint32_t *) cmdbuf->ptr.cpu) + 292, "Clear Z/S"); + + agx_unpack(agxdecode_dump_stream, ((uint32_t *) cmdbuf->ptr.cpu) + 292, + IOGPU_CLEAR_Z_S, clearzs); + DUMP_UNPACKED(IOGPU_CLEAR_Z_S, clearzs, "Clear Z/S"); /* Guard against changes */ uint32_t zeroes[356 - 344] = { 0 }; @@ -484,6 +487,17 @@ agxdecode_cmdstream(unsigned cmdbuf_handle, unsigned map_handle, bool verbose) agxdecode_pipeline, verbose); } + assert((clearzs.depth_clear_pipeline_unk & 0xF) == 0x4); + if (clearzs.depth_clear_pipeline) { + agxdecode_stateful(clearzs.depth_clear_pipeline, + "Depth clear pipeline", agxdecode_pipeline, verbose); + } + + if (clearzs.depth_store_pipeline) { + agxdecode_stateful(clearzs.depth_store_pipeline, + "Depth store pipeline", agxdecode_pipeline, verbose); + } + agxdecode_map_read_write(); } diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c index 8a6721b..3e1e07b 100644 --- a/src/gallium/drivers/asahi/magic.c +++ b/src/gallium/drivers/asahi/magic.c @@ -229,8 +229,12 @@ demo_cmdbuf(uint64_t *buf, size_t size, agx_pack(map + 292, IOGPU_CLEAR_Z_S, cfg) { cfg.depth_clear_value = fui(clear_depth); cfg.stencil_clear_value = clear_stencil; - cfg.unk_pipeline = pipeline_null | 0x4; - cfg.unk_pipeline_2 = pipeline_store | 0x4; + + cfg.depth_clear_pipeline_bind = 0xffff8002 | (clear_pipeline_textures ? 0x210 : 0); + cfg.depth_clear_pipeline = pipeline_null; + + cfg.depth_store_pipeline_bind = 0x12; + cfg.depth_store_pipeline = pipeline_store; } agx_pack(map + 356, IOGPU_MISC, cfg) { -- 2.7.4