50696cc7b7d7737de9b9080111f4e8b2a875e849
2 * Copyright 2013 Red Hat Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
28 pwr_perfctr_init(struct nouveau_perfmon
*ppm
, struct nouveau_perfdom
*dom
,
29 struct nouveau_perfctr
*ctr
)
31 u32 mask
= 0x00000000;
32 u32 ctrl
= 0x00000001;
35 for (i
= 0; i
< ARRAY_SIZE(ctr
->signal
) && ctr
->signal
[i
]; i
++)
36 mask
|= 1 << (ctr
->signal
[i
] - dom
->signal
);
38 nv_wr32(ppm
, 0x10a504 + (ctr
->slot
* 0x10), mask
);
39 nv_wr32(ppm
, 0x10a50c + (ctr
->slot
* 0x10), ctrl
);
40 nv_wr32(ppm
, 0x10a50c + (ppm
->last
* 0x10), 0x00000003);
44 pwr_perfctr_read(struct nouveau_perfmon
*ppm
, struct nouveau_perfdom
*dom
,
45 struct nouveau_perfctr
*ctr
)
47 ctr
->ctr
= ppm
->pwr
[ctr
->slot
];
48 ctr
->clk
= ppm
->pwr
[ppm
->last
];
52 pwr_perfctr_next(struct nouveau_perfmon
*ppm
, struct nouveau_perfdom
*dom
)
56 for (i
= 0; i
<= ppm
->last
; i
++) {
57 ppm
->pwr
[i
] = nv_rd32(ppm
, 0x10a508 + (i
* 0x10));
58 nv_wr32(ppm
, 0x10a508 + (i
* 0x10), 0x80000000);
62 static const struct nouveau_funcdom
64 .init
= pwr_perfctr_init
,
65 .read
= pwr_perfctr_read
,
66 .next
= pwr_perfctr_next
,
69 const struct nouveau_specdom
70 nva3_perfmon_pwr
[] = {
71 { 0x20, (const struct nouveau_specsig
[]) {
72 { 0x00, "pwr_gr_idle" },
73 { 0x04, "pwr_bsp_idle" },
74 { 0x05, "pwr_vp_idle" },
75 { 0x06, "pwr_ppp_idle" },
76 { 0x13, "pwr_ce0_idle" },
78 }, &pwr_perfctr_func
},
82 const struct nouveau_specdom
83 nvc0_perfmon_pwr
[] = {
84 { 0x20, (const struct nouveau_specsig
[]) {
85 { 0x00, "pwr_gr_idle" },
86 { 0x04, "pwr_bsp_idle" },
87 { 0x05, "pwr_vp_idle" },
88 { 0x06, "pwr_ppp_idle" },
89 { 0x13, "pwr_ce0_idle" },
90 { 0x14, "pwr_ce1_idle" },
92 }, &pwr_perfctr_func
},
96 const struct nouveau_specdom
97 nve0_perfmon_pwr
[] = {
98 { 0x20, (const struct nouveau_specsig
[]) {
99 { 0x00, "pwr_gr_idle" },
100 { 0x04, "pwr_bsp_idle" },
101 { 0x05, "pwr_vp_idle" },
102 { 0x06, "pwr_ppp_idle" },
103 { 0x13, "pwr_ce0_idle" },
104 { 0x14, "pwr_ce1_idle" },
105 { 0x15, "pwr_ce2_idle" },
107 }, &pwr_perfctr_func
},
This page took 0.035561 seconds and 4 git commands to generate.