71d718c12075e27d8b5c8a6dedb2086a5d29ce6a
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.
27 /*******************************************************************************
28 * Perfmon object classes
29 ******************************************************************************/
31 /*******************************************************************************
33 ******************************************************************************/
35 /*******************************************************************************
36 * PPM engine/subdev functions
37 ******************************************************************************/
39 static const struct nouveau_specdom
40 nve0_perfmon_hub
[] = {
41 { 0x60, (const struct nouveau_specsig
[]) {
42 { 0x47, "hub00_user_0" },
44 }, &nvc0_perfctr_func
},
45 { 0x40, (const struct nouveau_specsig
[]) {
46 { 0x27, "hub01_user_0" },
48 }, &nvc0_perfctr_func
},
49 { 0x60, (const struct nouveau_specsig
[]) {
50 { 0x47, "hub02_user_0" },
52 }, &nvc0_perfctr_func
},
53 { 0x60, (const struct nouveau_specsig
[]) {
54 { 0x47, "hub03_user_0" },
56 }, &nvc0_perfctr_func
},
57 { 0x40, (const struct nouveau_specsig
[]) {
58 { 0x03, "host_mmio_rd" },
59 { 0x27, "hub04_user_0" },
61 }, &nvc0_perfctr_func
},
62 { 0x60, (const struct nouveau_specsig
[]) {
63 { 0x47, "hub05_user_0" },
65 }, &nvc0_perfctr_func
},
66 { 0xc0, (const struct nouveau_specsig
[]) {
67 { 0x74, "host_fb_rd3x" },
68 { 0x75, "host_fb_rd3x_2" },
69 { 0xa7, "hub06_user_0" },
71 }, &nvc0_perfctr_func
},
72 { 0x60, (const struct nouveau_specsig
[]) {
73 { 0x47, "hub07_user_0" },
75 }, &nvc0_perfctr_func
},
79 static const struct nouveau_specdom
80 nve0_perfmon_gpc
[] = {
81 { 0xe0, (const struct nouveau_specsig
[]) {
82 { 0xc7, "gpc00_user_0" },
84 }, &nvc0_perfctr_func
},
88 static const struct nouveau_specdom
89 nve0_perfmon_part
[] = {
90 { 0x60, (const struct nouveau_specsig
[]) {
91 { 0x47, "part00_user_0" },
93 }, &nvc0_perfctr_func
},
94 { 0x60, (const struct nouveau_specsig
[]) {
95 { 0x47, "part01_user_0" },
97 }, &nvc0_perfctr_func
},
102 nve0_perfmon_ctor(struct nouveau_object
*parent
, struct nouveau_object
*engine
,
103 struct nouveau_oclass
*oclass
, void *data
, u32 size
,
104 struct nouveau_object
**pobject
)
106 struct nvc0_perfmon_priv
*priv
;
110 ret
= nouveau_perfmon_create(parent
, engine
, oclass
, &priv
);
111 *pobject
= nv_object(priv
);
116 ret
= nouveau_perfdom_new(&priv
->base
, "pwr", 0, 0, 0, 0,
122 ret
= nouveau_perfdom_new(&priv
->base
, "hub", 0, 0x1b0000, 0, 0x200,
128 mask
= (1 << nv_rd32(priv
, 0x022430)) - 1;
129 mask
&= ~nv_rd32(priv
, 0x022504);
130 mask
&= ~nv_rd32(priv
, 0x022584);
132 ret
= nouveau_perfdom_new(&priv
->base
, "gpc", mask
, 0x180000,
133 0x1000, 0x200, nve0_perfmon_gpc
);
138 mask
= (1 << nv_rd32(priv
, 0x022438)) - 1;
139 mask
&= ~nv_rd32(priv
, 0x022548);
140 mask
&= ~nv_rd32(priv
, 0x0225c8);
142 ret
= nouveau_perfdom_new(&priv
->base
, "part", mask
, 0x1a0000,
143 0x1000, 0x200, nve0_perfmon_part
);
147 nv_engine(priv
)->cclass
= &nouveau_perfmon_cclass
;
148 nv_engine(priv
)->sclass
= nouveau_perfmon_sclass
;
153 struct nouveau_oclass
154 nve0_perfmon_oclass
= {
155 .handle
= NV_ENGINE(PERFMON
, 0xe0),
156 .ofuncs
= &(struct nouveau_ofuncs
) {
157 .ctor
= nve0_perfmon_ctor
,
158 .dtor
= _nouveau_perfmon_dtor
,
159 .init
= _nouveau_perfmon_init
,
160 .fini
= nvc0_perfmon_fini
,
This page took 0.034603 seconds and 4 git commands to generate.