From 51a812bb6015c45ff45830c80d44332a63ee4744 Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Wed, 7 Apr 2021 23:51:01 +1200 Subject: [PATCH] panfrost: Flush output after disassembling shaders Fixes text printed to stderr appearing in the middle of disassembly when piping stdout and stderr to the same place. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 1 + src/panfrost/midgard/midgard_compile.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 5d7eee1b5ca..53ae4082157 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -3110,6 +3110,7 @@ bifrost_compile_shader_nir(nir_shader *nir, if (bifrost_debug & BIFROST_DBG_SHADERS && !skip_internal) { disassemble_bifrost(stdout, binary->data, binary->size, bifrost_debug & BIFROST_DBG_VERBOSE); + fflush(stdout); } /* Pad the shader with enough zero bytes to trick the prefetcher, diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index b6e6178056d..283afe63518 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -3197,6 +3197,7 @@ midgard_compile_shader_nir(nir_shader *nir, if ((midgard_debug & MIDGARD_DBG_SHADERS) && !nir->info.internal) { disassemble_midgard(stdout, binary->data, binary->size, inputs->gpu_id); + fflush(stdout); } if ((midgard_debug & MIDGARD_DBG_SHADERDB || inputs->shaderdb) &&