62 *pobject = nv_object(obj);
67 nv_wo32(obj, 0x04, 0x00000000);
68 nv_wo32(obj, 0x08, 0x00000000);
69 nv_wo32(obj, 0x0c, 0x00000000);
78 u32 inst = *(
u32 *)arg << 4;
79 u32 dma0 = nv_ro32(imem, inst + 0);
80 u32 dma1 = nv_ro32(imem, inst + 4);
81 u32 dma2 = nv_ro32(imem, inst + 8);
82 u32 base = (dma2 & 0xfffff000) | (dma0 >> 20);
86 if (!(dma0 & 0x00002000))
91 nv_mask(priv, 0x00b300, 0x00030000, (dma0 & 0x00030000));
92 nv_wr32(priv, 0x00b334, base);
93 nv_wr32(priv, 0x00b324, size);
97 nv_mask(priv, 0x00b300, 0x000c0000, (dma0 & 0x00030000) << 2);
98 nv_wr32(priv, 0x00b360, base);
99 nv_wr32(priv, 0x00b364, size);
102 if (dma0 & 0x000c0000)
105 nv_wr32(priv, 0x00b370, base);
106 nv_wr32(priv, 0x00b374, size);
114 .ctor = nv31_mpeg_object_ctor,
123 nv31_mpeg_omthds[] = {
124 { 0x0190, nv31_mpeg_mthd_dma },
125 { 0x01a0, nv31_mpeg_mthd_dma },
126 { 0x01b0, nv31_mpeg_mthd_dma },
132 { 0x3174, &nv31_mpeg_ofuncs, nv31_mpeg_omthds },
150 if (!atomic_add_unless(&priv->
refcount, 1, 1))
154 *pobject = nv_object(chan);
174 .ctor = nv31_mpeg_context_ctor,
175 .dtor = nv31_mpeg_context_dtor,
191 nv_wr32(priv, 0x00b008 + (i * 0x10), tile->
pitch);
192 nv_wr32(priv, 0x00b004 + (i * 0x10), tile->
limit);
193 nv_wr32(priv, 0x00b000 + (i * 0x10), tile->
addr);
204 u32 inst = nv_rd32(priv, 0x00b318) & 0x000fffff;
205 u32 stat = nv_rd32(priv, 0x00b100);
206 u32 type = nv_rd32(priv, 0x00b230);
207 u32 mthd = nv_rd32(priv, 0x00b234);
208 u32 data = nv_rd32(priv, 0x00b238);
213 chid = pfifo->
chid(pfifo, engctx);
215 if (stat & 0x01000000) {
217 if (type == 0x00000020 && mthd == 0x0000) {
218 nv_mask(priv, 0x00b308, 0x00000000, 0x00000000);
222 if (type == 0x00000010) {
224 if (handle && !nv_call(handle->
object, mthd, data))
230 nv_wr32(priv, 0x00b100, stat);
231 nv_wr32(priv, 0x00b230, 0x00000001);
234 nv_error(priv,
"ch %d [0x%08x] 0x%08x 0x%08x 0x%08x 0x%08x\n",
235 chid, inst << 4, stat, type, mthd, data);
250 *pobject = nv_object(priv);
254 nv_subdev(priv)->unit = 0x00000002;
256 nv_engine(priv)->cclass = &nv31_mpeg_cclass;
275 nv_wr32(priv, 0x00b0e0, 0x00000020);
276 nv_wr32(priv, 0x00b0e8, 0x00000020);
278 for (i = 0; i < pfb->
tile.regions; i++)
282 nv_wr32(priv, 0x00b32c, 0x00000000);
283 nv_wr32(priv, 0x00b314, 0x00000100);
284 nv_wr32(priv, 0x00b220, nv44_graph_class(priv) ? 0x00000044 : 0x00000031);
285 nv_wr32(priv, 0x00b300, 0x02001ec1);
286 nv_mask(priv, 0x00b32c, 0x00000001, 0x00000001);
288 nv_wr32(priv, 0x00b100, 0xffffffff);
289 nv_wr32(priv, 0x00b140, 0xffffffff);
291 if (!
nv_wait(priv, 0x00b200, 0x00000001, 0x00000000)) {
292 nv_error(priv,
"timeout 0x%08x\n", nv_rd32(priv, 0x00b200));
303 .ctor = nv31_mpeg_ctor,