1/* $NetBSD: nouveau_engine_graph_ctxnvc4.c,v 1.1.1.1 2014/08/06 12:36:25 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_ctxnvc4.c,v 1.1.1.1 2014/08/06 12:36:25 riastradh Exp $");
29
30#include "ctxnvc0.h"
31
32/*******************************************************************************
33 * PGRAPH context register lists
34 ******************************************************************************/
35
36const struct nvc0_graph_init
37nvc4_grctx_init_tex_0[] = {
38 { 0x419a00, 1, 0x04, 0x000001f0 },
39 { 0x419a04, 1, 0x04, 0x00000001 },
40 { 0x419a08, 1, 0x04, 0x00000023 },
41 { 0x419a0c, 1, 0x04, 0x00020000 },
42 { 0x419a10, 1, 0x04, 0x00000000 },
43 { 0x419a14, 1, 0x04, 0x00000200 },
44 { 0x419a1c, 1, 0x04, 0x00000000 },
45 { 0x419a20, 1, 0x04, 0x00000800 },
46 { 0x419ac4, 1, 0x04, 0x0007f440 },
47 {}
48};
49
50const struct nvc0_graph_init
51nvc4_grctx_init_l1c_0[] = {
52 { 0x419cb0, 1, 0x04, 0x00020048 },
53 { 0x419ce8, 1, 0x04, 0x00000000 },
54 { 0x419cf4, 1, 0x04, 0x00000183 },
55 {}
56};
57
58const struct nvc0_graph_init
59nvc4_grctx_init_sm_0[] = {
60 { 0x419e04, 3, 0x04, 0x00000000 },
61 { 0x419e10, 1, 0x04, 0x00000002 },
62 { 0x419e44, 1, 0x04, 0x001beff2 },
63 { 0x419e48, 1, 0x04, 0x00000000 },
64 { 0x419e4c, 1, 0x04, 0x0000000f },
65 { 0x419e50, 17, 0x04, 0x00000000 },
66 { 0x419e98, 1, 0x04, 0x00000000 },
67 { 0x419ee0, 1, 0x04, 0x00011110 },
68 { 0x419f30, 11, 0x04, 0x00000000 },
69 {}
70};
71
72static const struct nvc0_graph_pack
73nvc4_grctx_pack_tpc[] = {
74 { nvc0_grctx_init_pe_0 },
75 { nvc4_grctx_init_tex_0 },
76 { nvc0_grctx_init_wwdx_0 },
77 { nvc0_grctx_init_mpc_0 },
78 { nvc4_grctx_init_l1c_0 },
79 { nvc0_grctx_init_tpccs_0 },
80 { nvc4_grctx_init_sm_0 },
81 {}
82};
83
84/*******************************************************************************
85 * PGRAPH context implementation
86 ******************************************************************************/
87
88struct nouveau_oclass *
89nvc4_grctx_oclass = &(struct nvc0_grctx_oclass) {
90 .base.handle = NV_ENGCTX(GR, 0xc3),
91 .base.ofuncs = &(struct nouveau_ofuncs) {
92 .ctor = nvc0_graph_context_ctor,
93 .dtor = nvc0_graph_context_dtor,
94 .init = _nouveau_graph_context_init,
95 .fini = _nouveau_graph_context_fini,
96 .rd32 = _nouveau_graph_context_rd32,
97 .wr32 = _nouveau_graph_context_wr32,
98 },
99 .main = nvc0_grctx_generate_main,
100 .mods = nvc0_grctx_generate_mods,
101 .unkn = nvc0_grctx_generate_unkn,
102 .hub = nvc0_grctx_pack_hub,
103 .gpc = nvc0_grctx_pack_gpc,
104 .zcull = nvc0_grctx_pack_zcull,
105 .tpc = nvc4_grctx_pack_tpc,
106 .icmd = nvc0_grctx_pack_icmd,
107 .mthd = nvc0_grctx_pack_mthd,
108}.base;
109