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/class.h>
27 #include <core/engctx.h>
29 #include <subdev/vm.h>
30 #include <subdev/bar.h>
31 #include <subdev/timer.h>
33 #include <engine/mpeg.h>
35 struct nv84_mpeg_priv
{
36 struct nouveau_mpeg base
;
39 struct nv84_mpeg_chan
{
40 struct nouveau_mpeg_chan base
;
43 /*******************************************************************************
45 ******************************************************************************/
47 static struct nouveau_oclass
48 nv84_mpeg_sclass
[] = {
49 { 0x8274, &nv50_mpeg_ofuncs
},
53 /*******************************************************************************
55 ******************************************************************************/
57 static struct nouveau_oclass
59 .handle
= NV_ENGCTX(MPEG
, 0x84),
60 .ofuncs
= &(struct nouveau_ofuncs
) {
61 .ctor
= nv50_mpeg_context_ctor
,
62 .dtor
= _nouveau_mpeg_context_dtor
,
63 .init
= _nouveau_mpeg_context_init
,
64 .fini
= _nouveau_mpeg_context_fini
,
65 .rd32
= _nouveau_mpeg_context_rd32
,
66 .wr32
= _nouveau_mpeg_context_wr32
,
70 /*******************************************************************************
71 * PMPEG engine/subdev functions
72 ******************************************************************************/
75 nv84_mpeg_ctor(struct nouveau_object
*parent
, struct nouveau_object
*engine
,
76 struct nouveau_oclass
*oclass
, void *data
, u32 size
,
77 struct nouveau_object
**pobject
)
79 struct nv84_mpeg_priv
*priv
;
82 ret
= nouveau_mpeg_create(parent
, engine
, oclass
, &priv
);
83 *pobject
= nv_object(priv
);
87 nv_subdev(priv
)->unit
= 0x00000002;
88 nv_subdev(priv
)->intr
= nv50_mpeg_intr
;
89 nv_engine(priv
)->cclass
= &nv84_mpeg_cclass
;
90 nv_engine(priv
)->sclass
= nv84_mpeg_sclass
;
91 nv_engine(priv
)->tlb_flush
= nv50_mpeg_tlb_flush
;
97 .handle
= NV_ENGINE(MPEG
, 0x84),
98 .ofuncs
= &(struct nouveau_ofuncs
) {
99 .ctor
= nv84_mpeg_ctor
,
100 .dtor
= _nouveau_mpeg_dtor
,
101 .init
= nv50_mpeg_init
,
102 .fini
= _nouveau_mpeg_fini
,