mesa: don't double incr/decr ActiveCounters
authorRob Clark <robdclark@gmail.com>
Mon, 2 Jul 2018 14:40:36 +0000 (10:40 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 18 Jul 2018 14:10:44 +0000 (10:10 -0400)
commit09f240eb5ff6c24471bd55770771b7755ad07bc0
tree6029f02b6aaf2928cae8182185604a2c6d8728a2
parent426f1c60bced83cd9d9d026249f7e99e44aeeae6
mesa: don't double incr/decr ActiveCounters

Frameretrace ends up w/ excess calls to SelectPerfMonitorCountersAMD()
which ends up re-enabling already enabled counters.  Which causes
ActiveCounters[group] to be double incremented for the same counter.
This causes BeginPerfMonitorAMD() to fail.

The AMD_performance_monitor spec doesn't say that an error should be
generated in this case.  So I think the safe thing to do is just safe-
guard against excess increments/decrements.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/mesa/main/performance_monitor.c