diff options
author | Constantine Charlamov <[email protected]> | 2017-06-24 15:52:05 +0300 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-06-26 17:39:54 +1000 |
commit | abc7b110b6f6dbd00db3633a68cc836170465d91 (patch) | |
tree | 8c4f08632894d63f333cbdab8888d88e450744d5 /src | |
parent | 3d466f3e9f76c91083f0cfbb8a76148bdb0d52a3 (diff) |
r600g: fix crash when file in R600_TRACE doesn't exist
…and print error in such case. Which probably is not a rare event btw
because fopen doesn't expand ~ to $HOME.
Also get rid of unused "bool ret" variable.
Signed-off-by: Constantine Kharlamov <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 9b01e8e7d5c..ca7f41db686 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -295,15 +295,16 @@ void r600_context_gfx_flush(void *context, unsigned flags, ctx->b.num_gfx_cs_flushes++; if (ctx->is_debug) { - bool ret = ws->fence_wait(ws, ctx->b.last_gfx_fence, 10000000); - if (ret == false) { + if (!ws->fence_wait(ws, ctx->b.last_gfx_fence, 10000000)) { const char *fname = getenv("R600_TRACE"); if (!fname) exit(-1); FILE *fl = fopen(fname, "w+"); - if (fl) + if (fl) { eg_dump_debug_state(&ctx->b.b, fl, 0); - fclose(fl); + fclose(fl); + } else + perror(fname); exit(-1); } } |