2 * Copyright 2012 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.
22 * Authors: Ben Skeggs, Ilia Mirkin
25 #include <engine/xtensa.h>
26 #include <engine/vp.h>
28 /*******************************************************************************
30 ******************************************************************************/
32 static struct nouveau_oclass
34 { 0x7476, &nouveau_object_ofuncs },
38 /*******************************************************************************
40 ******************************************************************************/
42 static struct nouveau_oclass
44 .handle = NV_ENGCTX(VP, 0x84),
45 .ofuncs = &(struct nouveau_ofuncs) {
46 .ctor = _nouveau_xtensa_engctx_ctor,
47 .dtor = _nouveau_engctx_dtor,
48 .init = _nouveau_engctx_init,
49 .fini = _nouveau_engctx_fini,
50 .rd32 = _nouveau_engctx_rd32,
51 .wr32 = _nouveau_engctx_wr32,
55 /*******************************************************************************
56 * PVP engine/subdev functions
57 ******************************************************************************/
60 nv84_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
61 struct nouveau_oclass *oclass, void *data, u32 size,
62 struct nouveau_object **pobject)
64 struct nouveau_xtensa *priv;
67 ret = nouveau_xtensa_create(parent, engine, oclass, 0xf000, true,
69 *pobject = nv_object(priv);
73 nv_subdev(priv)->unit = 0x01020000;
74 nv_engine(priv)->cclass = &nv84_vp_cclass;
75 nv_engine(priv)->sclass = nv84_vp_sclass;
76 priv->fifo_val = 0x111;
77 priv->unkd28 = 0x9c544;
83 .handle = NV_ENGINE(VP, 0x84),
84 .ofuncs = &(struct nouveau_ofuncs) {
86 .dtor = _nouveau_xtensa_dtor,
87 .init = _nouveau_xtensa_init,
88 .fini = _nouveau_xtensa_fini,
89 .rd32 = _nouveau_xtensa_rd32,
90 .wr32 = _nouveau_xtensa_wr32,