This commit is contained in:
Rob Clark 2026-04-30 09:37:43 -07:00
parent 1a237a9c67
commit 5e0ee1c0ec

View file

@ -14,6 +14,7 @@
#include "drm-uapi/msm_drm.h"
#include "util/bitset.h"
#include "util/log.h"
#include "util/simple_mtx.h"
#include "freedreno_common.h"
@ -116,6 +117,7 @@ update_group_counters(struct fd_perfcntr_state *perfcntrs, int group_idx)
*/
unsigned nr = BITSET_LAST_BIT(perfcntrs->assigned_counters[group_idx]);
if (nr != perfcntrs->group_configs[group_idx].nr_countables) {
mesa_logi("%s: %u -> %u counters", perfcntrs->groups[group_idx].name, perfcntrs->group_configs[group_idx].nr_countables, nr);
perfcntrs->group_configs[group_idx].nr_countables = nr;
ret = update_reserved_counters(perfcntrs);
}
@ -239,6 +241,7 @@ fd_perfcntr_reserve(struct fd_perfcntr_state *perfcntrs,
c = BITSET_FFS(free_counters) - 1;
assert(c >= 0);
mesa_logi("pick counter %d", c);
if (c < group->num_counters) {
state = rzalloc(perfcntrs, struct fd_perfcntr_counter_state);
@ -270,6 +273,8 @@ fd_perfcntr_reserve(struct fd_perfcntr_state *perfcntrs,
if (!state)
return NULL;
mesa_logi("%s.%s: assigned %d (%d users)", group->name, countable->name, state->counter, state->nr_users);
return &group->counters[state->counter];
}
@ -287,6 +292,9 @@ fd_perfcntr_release(struct fd_perfcntr_state *perfcntrs,
assert(state->nr_users > 0);
const struct fd_perfcntr_group *group = &perfcntrs->groups[state->group];
mesa_logi("%s.%s: released %d (%d users)", group->name, group->countables[state->countable].name, state->counter, state->nr_users);
if (--state->nr_users == 0) {
/* dropping last user of the counter: */
_mesa_hash_table_remove(perfcntrs->counter_state, e);