1 | /* $NetBSD: nouveau_engine_graph_nvc1.c,v 1.1.1.1 2014/08/06 12:36:26 riastradh Exp $ */ |
2 | |
3 | /* |
4 | * Copyright 2013 Red Hat Inc. |
5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), |
8 | * to deal in the Software without restriction, including without limitation |
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
10 | * and/or sell copies of the Software, and to permit persons to whom the |
11 | * Software is furnished to do so, subject to the following conditions: |
12 | * |
13 | * The above copyright notice and this permission notice shall be included in |
14 | * all copies or substantial portions of the Software. |
15 | * |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
19 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
22 | * OTHER DEALINGS IN THE SOFTWARE. |
23 | * |
24 | * Authors: Ben Skeggs <bskeggs@redhat.com> |
25 | */ |
26 | |
27 | #include <sys/cdefs.h> |
28 | __KERNEL_RCSID(0, "$NetBSD: nouveau_engine_graph_nvc1.c,v 1.1.1.1 2014/08/06 12:36:26 riastradh Exp $" ); |
29 | |
30 | #include "nvc0.h" |
31 | #include "ctxnvc0.h" |
32 | |
33 | /******************************************************************************* |
34 | * Graphics object classes |
35 | ******************************************************************************/ |
36 | |
37 | static struct nouveau_oclass |
38 | nvc1_graph_sclass[] = { |
39 | { 0x902d, &nouveau_object_ofuncs }, |
40 | { 0x9039, &nouveau_object_ofuncs }, |
41 | { 0x9097, &nouveau_object_ofuncs }, |
42 | { 0x90c0, &nouveau_object_ofuncs }, |
43 | { 0x9197, &nouveau_object_ofuncs }, |
44 | {} |
45 | }; |
46 | |
47 | /******************************************************************************* |
48 | * PGRAPH register lists |
49 | ******************************************************************************/ |
50 | |
51 | const struct nvc0_graph_init |
52 | nvc1_graph_init_gpc_unk_0[] = { |
53 | { 0x418604, 1, 0x04, 0x00000000 }, |
54 | { 0x418680, 1, 0x04, 0x00000000 }, |
55 | { 0x418714, 1, 0x04, 0x00000000 }, |
56 | { 0x418384, 1, 0x04, 0x00000000 }, |
57 | {} |
58 | }; |
59 | |
60 | const struct nvc0_graph_init |
61 | nvc1_graph_init_setup_1[] = { |
62 | { 0x4188c8, 2, 0x04, 0x00000000 }, |
63 | { 0x4188d0, 1, 0x04, 0x00010000 }, |
64 | { 0x4188d4, 1, 0x04, 0x00000001 }, |
65 | {} |
66 | }; |
67 | |
68 | static const struct nvc0_graph_init |
69 | nvc1_graph_init_gpc_unk_1[] = { |
70 | { 0x418d00, 1, 0x04, 0x00000000 }, |
71 | { 0x418f08, 1, 0x04, 0x00000000 }, |
72 | { 0x418e00, 1, 0x04, 0x00000003 }, |
73 | { 0x418e08, 1, 0x04, 0x00000000 }, |
74 | {} |
75 | }; |
76 | |
77 | static const struct nvc0_graph_init |
78 | nvc1_graph_init_pe_0[] = { |
79 | { 0x41980c, 1, 0x04, 0x00000010 }, |
80 | { 0x419810, 1, 0x04, 0x00000000 }, |
81 | { 0x419814, 1, 0x04, 0x00000004 }, |
82 | { 0x419844, 1, 0x04, 0x00000000 }, |
83 | { 0x41984c, 1, 0x04, 0x00005bc5 }, |
84 | { 0x419850, 4, 0x04, 0x00000000 }, |
85 | { 0x419880, 1, 0x04, 0x00000002 }, |
86 | {} |
87 | }; |
88 | |
89 | static const struct nvc0_graph_pack |
90 | nvc1_graph_pack_mmio[] = { |
91 | { nvc0_graph_init_main_0 }, |
92 | { nvc0_graph_init_fe_0 }, |
93 | { nvc0_graph_init_pri_0 }, |
94 | { nvc0_graph_init_rstr2d_0 }, |
95 | { nvc0_graph_init_pd_0 }, |
96 | { nvc4_graph_init_ds_0 }, |
97 | { nvc0_graph_init_scc_0 }, |
98 | { nvc0_graph_init_prop_0 }, |
99 | { nvc1_graph_init_gpc_unk_0 }, |
100 | { nvc0_graph_init_setup_0 }, |
101 | { nvc0_graph_init_crstr_0 }, |
102 | { nvc1_graph_init_setup_1 }, |
103 | { nvc0_graph_init_zcull_0 }, |
104 | { nvc0_graph_init_gpm_0 }, |
105 | { nvc1_graph_init_gpc_unk_1 }, |
106 | { nvc0_graph_init_gcc_0 }, |
107 | { nvc0_graph_init_tpccs_0 }, |
108 | { nvc4_graph_init_tex_0 }, |
109 | { nvc1_graph_init_pe_0 }, |
110 | { nvc0_graph_init_l1c_0 }, |
111 | { nvc0_graph_init_wwdx_0 }, |
112 | { nvc0_graph_init_tpccs_1 }, |
113 | { nvc0_graph_init_mpc_0 }, |
114 | { nvc4_graph_init_sm_0 }, |
115 | { nvc0_graph_init_be_0 }, |
116 | { nvc0_graph_init_fe_1 }, |
117 | {} |
118 | }; |
119 | |
120 | /******************************************************************************* |
121 | * PGRAPH engine/subdev functions |
122 | ******************************************************************************/ |
123 | |
124 | struct nouveau_oclass * |
125 | nvc1_graph_oclass = &(struct nvc0_graph_oclass) { |
126 | .base.handle = NV_ENGINE(GR, 0xc1), |
127 | .base.ofuncs = &(struct nouveau_ofuncs) { |
128 | .ctor = nvc0_graph_ctor, |
129 | .dtor = nvc0_graph_dtor, |
130 | .init = nvc0_graph_init, |
131 | .fini = _nouveau_graph_fini, |
132 | }, |
133 | .cclass = &nvc1_grctx_oclass, |
134 | .sclass = nvc1_graph_sclass, |
135 | .mmio = nvc1_graph_pack_mmio, |
136 | .fecs.ucode = &nvc0_graph_fecs_ucode, |
137 | .gpccs.ucode = &nvc0_graph_gpccs_ucode, |
138 | }.base; |
139 | |