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.
26 #include <core/enum.h>
27 #include <core/engctx.h>
29 #include <engine/copy.h>
31 struct nve0_copy_priv
{
32 struct nouveau_engine base
;
35 /*******************************************************************************
37 ******************************************************************************/
39 static struct nouveau_oclass
40 nve0_copy_sclass
[] = {
41 { 0xa0b5, &nouveau_object_ofuncs
},
45 /*******************************************************************************
47 ******************************************************************************/
49 static struct nouveau_ofuncs
50 nve0_copy_context_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
,
59 static struct nouveau_oclass
61 .handle
= NV_ENGCTX(COPY0
, 0xc0),
62 .ofuncs
= &nve0_copy_context_ofuncs
,
65 /*******************************************************************************
66 * PCOPY engine/subdev functions
67 ******************************************************************************/
70 nve0_copy_intr(struct nouveau_subdev
*subdev
)
72 const int ce
= nv_subidx(subdev
) - NVDEV_ENGINE_COPY0
;
73 struct nve0_copy_priv
*priv
= (void *)subdev
;
74 u32 stat
= nv_rd32(priv
, 0x104908 + (ce
* 0x1000));
77 nv_warn(priv
, "unhandled intr 0x%08x\n", stat
);
78 nv_wr32(priv
, 0x104908 + (ce
* 0x1000), stat
);
83 nve0_copy0_ctor(struct nouveau_object
*parent
, struct nouveau_object
*engine
,
84 struct nouveau_oclass
*oclass
, void *data
, u32 size
,
85 struct nouveau_object
**pobject
)
87 struct nve0_copy_priv
*priv
;
90 ret
= nouveau_engine_create(parent
, engine
, oclass
, true,
91 "PCE0", "copy0", &priv
);
92 *pobject
= nv_object(priv
);
96 nv_subdev(priv
)->unit
= 0x00000040;
97 nv_subdev(priv
)->intr
= nve0_copy_intr
;
98 nv_engine(priv
)->cclass
= &nve0_copy_cclass
;
99 nv_engine(priv
)->sclass
= nve0_copy_sclass
;
104 nve0_copy1_ctor(struct nouveau_object
*parent
, struct nouveau_object
*engine
,
105 struct nouveau_oclass
*oclass
, void *data
, u32 size
,
106 struct nouveau_object
**pobject
)
108 struct nve0_copy_priv
*priv
;
111 ret
= nouveau_engine_create(parent
, engine
, oclass
, true,
112 "PCE1", "copy1", &priv
);
113 *pobject
= nv_object(priv
);
117 nv_subdev(priv
)->unit
= 0x00000080;
118 nv_subdev(priv
)->intr
= nve0_copy_intr
;
119 nv_engine(priv
)->cclass
= &nve0_copy_cclass
;
120 nv_engine(priv
)->sclass
= nve0_copy_sclass
;
125 nve0_copy2_ctor(struct nouveau_object
*parent
, struct nouveau_object
*engine
,
126 struct nouveau_oclass
*oclass
, void *data
, u32 size
,
127 struct nouveau_object
**pobject
)
129 struct nve0_copy_priv
*priv
;
132 ret
= nouveau_engine_create(parent
, engine
, oclass
, true,
133 "PCE2", "copy2", &priv
);
134 *pobject
= nv_object(priv
);
138 nv_subdev(priv
)->unit
= 0x00200000;
139 nv_subdev(priv
)->intr
= nve0_copy_intr
;
140 nv_engine(priv
)->cclass
= &nve0_copy_cclass
;
141 nv_engine(priv
)->sclass
= nve0_copy_sclass
;
145 struct nouveau_oclass
146 nve0_copy0_oclass
= {
147 .handle
= NV_ENGINE(COPY0
, 0xe0),
148 .ofuncs
= &(struct nouveau_ofuncs
) {
149 .ctor
= nve0_copy0_ctor
,
150 .dtor
= _nouveau_engine_dtor
,
151 .init
= _nouveau_engine_init
,
152 .fini
= _nouveau_engine_fini
,
156 struct nouveau_oclass
157 nve0_copy1_oclass
= {
158 .handle
= NV_ENGINE(COPY1
, 0xe0),
159 .ofuncs
= &(struct nouveau_ofuncs
) {
160 .ctor
= nve0_copy1_ctor
,
161 .dtor
= _nouveau_engine_dtor
,
162 .init
= _nouveau_engine_init
,
163 .fini
= _nouveau_engine_fini
,
167 struct nouveau_oclass
168 nve0_copy2_oclass
= {
169 .handle
= NV_ENGINE(COPY2
, 0xe0),
170 .ofuncs
= &(struct nouveau_ofuncs
) {
171 .ctor
= nve0_copy2_ctor
,
172 .dtor
= _nouveau_engine_dtor
,
173 .init
= _nouveau_engine_init
,
174 .fini
= _nouveau_engine_fini
,
This page took 0.035411 seconds and 5 git commands to generate.