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.
25 #include <core/engctx.h>
26 #include <core/class.h>
28 #include <engine/vp.h>
31 struct nouveau_engine base;
34 /*******************************************************************************
36 ******************************************************************************/
38 static struct nouveau_oclass
43 /*******************************************************************************
45 ******************************************************************************/
47 static struct nouveau_oclass
49 .handle = NV_ENGCTX(VP, 0x84),
50 .ofuncs = &(struct nouveau_ofuncs) {
51 .ctor = _nouveau_engctx_ctor,
52 .dtor = _nouveau_engctx_dtor,
53 .init = _nouveau_engctx_init,
54 .fini = _nouveau_engctx_fini,
55 .rd32 = _nouveau_engctx_rd32,
56 .wr32 = _nouveau_engctx_wr32,
60 /*******************************************************************************
61 * PVP engine/subdev functions
62 ******************************************************************************/
65 nv84_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
66 struct nouveau_oclass *oclass, void *data, u32 size,
67 struct nouveau_object **pobject)
69 struct nv84_vp_priv *priv;
72 ret = nouveau_engine_create(parent, engine, oclass, true,
74 *pobject = nv_object(priv);
78 nv_subdev(priv)->unit = 0x01020000;
79 nv_engine(priv)->cclass = &nv84_vp_cclass;
80 nv_engine(priv)->sclass = nv84_vp_sclass;
86 .handle = NV_ENGINE(VP, 0x84),
87 .ofuncs = &(struct nouveau_ofuncs) {
89 .dtor = _nouveau_engine_dtor,
90 .init = _nouveau_engine_init,
91 .fini = _nouveau_engine_fini,