/* enable the source */
nv_mask(ppm, src->addr, mask, value);
+ nv_debug(ppm, "enabled source 0x%08x 0x%08x 0x%08x\n",
+ src->addr, mask, value);
}
}
return 0;
struct nvkm_perfdom *dom = NULL;
struct nvkm_perfsig *sig;
struct nvkm_perfsrc *src;
+ u32 mask;
int i, j;
for (i = 0; i < 4 && ctr->signal[i]; i++) {
if (!src)
return -EINVAL;
+ /* unset enable bit if needed */
+ mask = 0x00000000;
+ if (src->enable)
+ mask = 0x80000000;
+ mask |= (src->mask << src->shift);
+
/* disable the source */
- nv_mask(ppm, src->addr, src->mask << src->shift, 0);
+ nv_mask(ppm, src->addr, mask, 0);
+ nv_debug(ppm, "disabled source 0x%08x 0x%08x\n",
+ src->addr, mask);
}
}
return 0;
}
static int
-nvkm_perfctr_new(struct nvkm_perfdom *dom, int slot,
+nvkm_perfctr_new(struct nvkm_perfdom *dom, int slot, uint8_t domain,
struct nvkm_perfsig *signal[4], uint64_t source[4][8],
uint16_t logic_op, struct nvkm_perfctr **pctr)
{
if (!ctr)
return -ENOMEM;
+ ctr->domain = domain;
ctr->logic_op = logic_op;
ctr->slot = slot;
for (i = 0; i < 4; i++) {
for (c = 0; c < ARRAY_SIZE(args->v0.ctr); c++) {
struct nvkm_perfsig *sig[4] = {};
- u64 src[4][8];
+ u64 src[4][8] = {};
for (s = 0; s < ARRAY_SIZE(args->v0.ctr[c].signal); s++) {
sig[s] = nvkm_perfsig_find(ppm, args->v0.domain,
}
}
- ret = nvkm_perfctr_new(sdom, c, sig, src,
+ ret = nvkm_perfctr_new(sdom, c, args->v0.domain, sig, src,
args->v0.ctr[c].logic_op, &ctr[c]);
if (ret)
return ret;
- ctr[c]->domain = args->v0.domain;
}
if (!sdom)