From: Marek Olšák Date: Sat, 26 Jan 2019 01:39:40 +0000 (-0500) Subject: radeonsi: fix crashing performance counters (division by zero) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=742d6cdb42e5570a3a74005f18bb89208069d01f;p=mesa.git radeonsi: fix crashing performance counters (division by zero) Fixes: e2b9329f17 "radeonsi: move remaining perfcounter code into si_perfcounter.c" --- diff --git a/src/gallium/drivers/radeonsi/si_perfcounter.c b/src/gallium/drivers/radeonsi/si_perfcounter.c index 2da14f8868f..d55394f2cba 100644 --- a/src/gallium/drivers/radeonsi/si_perfcounter.c +++ b/src/gallium/drivers/radeonsi/si_perfcounter.c @@ -1333,7 +1333,7 @@ void si_init_perfcounters(struct si_screen *screen) for (i = 0; i < num_blocks; ++i) { struct si_pc_block *block = &pc->blocks[i]; block->b = &blocks[i]; - block->num_instances = block->b->instances; + block->num_instances = MAX2(1, block->b->instances); if (!strcmp(block->b->b->name, "CB") || !strcmp(block->b->b->name, "DB"))