xref: /openbmc/linux/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1878da15aSBen Skeggs /*
2878da15aSBen Skeggs  * Copyright 2012 Red Hat Inc.
3878da15aSBen Skeggs  *
4878da15aSBen Skeggs  * Permission is hereby granted, free of charge, to any person obtaining a
5878da15aSBen Skeggs  * copy of this software and associated documentation files (the "Software"),
6878da15aSBen Skeggs  * to deal in the Software without restriction, including without limitation
7878da15aSBen Skeggs  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8878da15aSBen Skeggs  * and/or sell copies of the Software, and to permit persons to whom the
9878da15aSBen Skeggs  * Software is furnished to do so, subject to the following conditions:
10878da15aSBen Skeggs  *
11878da15aSBen Skeggs  * The above copyright notice and this permission notice shall be included in
12878da15aSBen Skeggs  * all copies or substantial portions of the Software.
13878da15aSBen Skeggs  *
14878da15aSBen Skeggs  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15878da15aSBen Skeggs  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16878da15aSBen Skeggs  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17878da15aSBen Skeggs  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18878da15aSBen Skeggs  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19878da15aSBen Skeggs  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20878da15aSBen Skeggs  * OTHER DEALINGS IN THE SOFTWARE.
21878da15aSBen Skeggs  *
22878da15aSBen Skeggs  * Authors: Ben Skeggs
23878da15aSBen Skeggs  */
2492fba5d3SBen Skeggs #include "priv.h"
25acbe9ecfSBen Skeggs #include "chan.h"
26acbe9ecfSBen Skeggs #include "hdmi.h"
27a1c93078SBen Skeggs #include "head.h"
2878f1ad6fSBen Skeggs #include "ior.h"
29168c0299SBen Skeggs 
30168c0299SBen Skeggs #include <nvif/class.h>
31878da15aSBen Skeggs 
32*f530bc60SBen Skeggs static void
g84_sor_hdmi_infoframe_vsi(struct nvkm_ior * ior,int head,void * data,u32 size)33*f530bc60SBen Skeggs g84_sor_hdmi_infoframe_vsi(struct nvkm_ior *ior, int head, void *data, u32 size)
34*f530bc60SBen Skeggs {
35*f530bc60SBen Skeggs 	struct nvkm_device *device = ior->disp->engine.subdev.device;
36*f530bc60SBen Skeggs 	struct packed_hdmi_infoframe vsi;
37*f530bc60SBen Skeggs 	const u32 hoff = head * 0x800;
38*f530bc60SBen Skeggs 
39*f530bc60SBen Skeggs 	nvkm_mask(device, 0x61653c + hoff, 0x00010001, 0x00010000);
40*f530bc60SBen Skeggs 	if (!size)
41*f530bc60SBen Skeggs 		return;
42*f530bc60SBen Skeggs 
43*f530bc60SBen Skeggs 	pack_hdmi_infoframe(&vsi, data, size);
44*f530bc60SBen Skeggs 
45*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x616544 + hoff, vsi.header);
46*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x616548 + hoff, vsi.subpack0_low);
47*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x61654c + hoff, vsi.subpack0_high);
48*f530bc60SBen Skeggs 	/* Is there a second (or up to fourth?) set of subpack registers here? */
49*f530bc60SBen Skeggs 	/* nvkm_wr32(device, 0x616550 + hoff, vsi.subpack1_low); */
50*f530bc60SBen Skeggs 	/* nvkm_wr32(device, 0x616554 + hoff, vsi.subpack1_high); */
51*f530bc60SBen Skeggs 
52*f530bc60SBen Skeggs 	nvkm_mask(device, 0x61653c + hoff, 0x00010001, 0x00010001);
53*f530bc60SBen Skeggs }
54*f530bc60SBen Skeggs 
55*f530bc60SBen Skeggs static void
g84_sor_hdmi_infoframe_avi(struct nvkm_ior * ior,int head,void * data,u32 size)56*f530bc60SBen Skeggs g84_sor_hdmi_infoframe_avi(struct nvkm_ior *ior, int head, void *data, u32 size)
57*f530bc60SBen Skeggs {
58*f530bc60SBen Skeggs 	struct nvkm_device *device = ior->disp->engine.subdev.device;
59*f530bc60SBen Skeggs 	struct packed_hdmi_infoframe avi;
60*f530bc60SBen Skeggs 	const u32 hoff = head * 0x800;
61*f530bc60SBen Skeggs 
62*f530bc60SBen Skeggs 	pack_hdmi_infoframe(&avi, data, size);
63*f530bc60SBen Skeggs 
64*f530bc60SBen Skeggs 	nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000000);
65*f530bc60SBen Skeggs 	if (!size)
66*f530bc60SBen Skeggs 		return;
67*f530bc60SBen Skeggs 
68*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x616528 + hoff, avi.header);
69*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x61652c + hoff, avi.subpack0_low);
70*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x616530 + hoff, avi.subpack0_high);
71*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x616534 + hoff, avi.subpack1_low);
72*f530bc60SBen Skeggs 	nvkm_wr32(device, 0x616538 + hoff, avi.subpack1_high);
73*f530bc60SBen Skeggs 
74*f530bc60SBen Skeggs 	nvkm_mask(device, 0x616520 + hoff, 0x00000001, 0x00000001);
75*f530bc60SBen Skeggs }
76*f530bc60SBen Skeggs 
77*f530bc60SBen Skeggs 
78*f530bc60SBen Skeggs static void
g84_sor_hdmi_ctrl(struct nvkm_ior * ior,int head,bool enable,u8 max_ac_packet,u8 rekey)79*f530bc60SBen Skeggs g84_sor_hdmi_ctrl(struct nvkm_ior *ior, int head, bool enable, u8 max_ac_packet, u8 rekey)
80acbe9ecfSBen Skeggs {
81acbe9ecfSBen Skeggs 	struct nvkm_device *device = ior->disp->engine.subdev.device;
82acbe9ecfSBen Skeggs 	const u32 ctrl = 0x40000000 * enable |
83acbe9ecfSBen Skeggs 			 0x1f000000 /* ??? */ |
84acbe9ecfSBen Skeggs 			 max_ac_packet << 16 |
85acbe9ecfSBen Skeggs 			 rekey;
86acbe9ecfSBen Skeggs 	const u32 hoff = head * 0x800;
87acbe9ecfSBen Skeggs 
88acbe9ecfSBen Skeggs 	if (!(ctrl & 0x40000000)) {
89acbe9ecfSBen Skeggs 		nvkm_mask(device, 0x6165a4 + hoff, 0x40000000, 0x00000000);
90acbe9ecfSBen Skeggs 		nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000000);
91acbe9ecfSBen Skeggs 		return;
92acbe9ecfSBen Skeggs 	}
93acbe9ecfSBen Skeggs 
94acbe9ecfSBen Skeggs 	/* Audio InfoFrame */
95acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000000);
96acbe9ecfSBen Skeggs 	nvkm_wr32(device, 0x616508 + hoff, 0x000a0184);
97acbe9ecfSBen Skeggs 	nvkm_wr32(device, 0x61650c + hoff, 0x00000071);
98acbe9ecfSBen Skeggs 	nvkm_wr32(device, 0x616510 + hoff, 0x00000000);
99acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x616500 + hoff, 0x00000001, 0x00000001);
100acbe9ecfSBen Skeggs 
101acbe9ecfSBen Skeggs 
102acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x6165d0 + hoff, 0x00070001, 0x00010001); /* SPARE, HW_CTS */
103acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x616568 + hoff, 0x00010101, 0x00000000); /* ACR_CTRL, ?? */
104acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x616578 + hoff, 0x80000000, 0x80000000); /* ACR_0441_ENABLE */
105acbe9ecfSBen Skeggs 
106acbe9ecfSBen Skeggs 	/* ??? */
107acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x61733c, 0x00100000, 0x00100000); /* RESETF */
108acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x61733c, 0x10000000, 0x10000000); /* LOOKUP_EN */
109acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x61733c, 0x00100000, 0x00000000); /* !RESETF */
110acbe9ecfSBen Skeggs 
111acbe9ecfSBen Skeggs 	/* HDMI_CTRL */
112acbe9ecfSBen Skeggs 	nvkm_mask(device, 0x6165a4 + hoff, 0x5f1f007f, ctrl);
113acbe9ecfSBen Skeggs }
114acbe9ecfSBen Skeggs 
115*f530bc60SBen Skeggs const struct nvkm_ior_func_hdmi
116*f530bc60SBen Skeggs g84_sor_hdmi = {
117*f530bc60SBen Skeggs 	.ctrl = g84_sor_hdmi_ctrl,
118*f530bc60SBen Skeggs 	.infoframe_avi = g84_sor_hdmi_infoframe_avi,
119*f530bc60SBen Skeggs 	.infoframe_vsi = g84_sor_hdmi_infoframe_vsi,
120*f530bc60SBen Skeggs };
121*f530bc60SBen Skeggs 
122acbe9ecfSBen Skeggs static const struct nvkm_ior_func
123acbe9ecfSBen Skeggs g84_sor = {
124acbe9ecfSBen Skeggs 	.state = nv50_sor_state,
125acbe9ecfSBen Skeggs 	.power = nv50_sor_power,
126acbe9ecfSBen Skeggs 	.clock = nv50_sor_clock,
127*f530bc60SBen Skeggs 	.hdmi = &g84_sor_hdmi,
128acbe9ecfSBen Skeggs };
129acbe9ecfSBen Skeggs 
130acbe9ecfSBen Skeggs int
g84_sor_new(struct nvkm_disp * disp,int id)131acbe9ecfSBen Skeggs g84_sor_new(struct nvkm_disp *disp, int id)
132acbe9ecfSBen Skeggs {
13379c453afSBen Skeggs 	return nvkm_ior_new_(&g84_sor, disp, SOR, id, false);
134acbe9ecfSBen Skeggs }
135acbe9ecfSBen Skeggs 
136acbe9ecfSBen Skeggs static const struct nvkm_disp_mthd_list
137acbe9ecfSBen Skeggs g84_disp_ovly_mthd_base = {
138acbe9ecfSBen Skeggs 	.mthd = 0x0000,
139acbe9ecfSBen Skeggs 	.addr = 0x000000,
140acbe9ecfSBen Skeggs 	.data = {
141acbe9ecfSBen Skeggs 		{ 0x0080, 0x000000 },
142acbe9ecfSBen Skeggs 		{ 0x0084, 0x6109a0 },
143acbe9ecfSBen Skeggs 		{ 0x0088, 0x6109c0 },
144acbe9ecfSBen Skeggs 		{ 0x008c, 0x6109c8 },
145acbe9ecfSBen Skeggs 		{ 0x0090, 0x6109b4 },
146acbe9ecfSBen Skeggs 		{ 0x0094, 0x610970 },
147acbe9ecfSBen Skeggs 		{ 0x00a0, 0x610998 },
148acbe9ecfSBen Skeggs 		{ 0x00a4, 0x610964 },
149acbe9ecfSBen Skeggs 		{ 0x00c0, 0x610958 },
150acbe9ecfSBen Skeggs 		{ 0x00e0, 0x6109a8 },
151acbe9ecfSBen Skeggs 		{ 0x00e4, 0x6109d0 },
152acbe9ecfSBen Skeggs 		{ 0x00e8, 0x6109d8 },
153acbe9ecfSBen Skeggs 		{ 0x0100, 0x61094c },
154acbe9ecfSBen Skeggs 		{ 0x0104, 0x610984 },
155acbe9ecfSBen Skeggs 		{ 0x0108, 0x61098c },
156acbe9ecfSBen Skeggs 		{ 0x0800, 0x6109f8 },
157acbe9ecfSBen Skeggs 		{ 0x0808, 0x610a08 },
158acbe9ecfSBen Skeggs 		{ 0x080c, 0x610a10 },
159acbe9ecfSBen Skeggs 		{ 0x0810, 0x610a00 },
160acbe9ecfSBen Skeggs 		{}
161acbe9ecfSBen Skeggs 	}
162acbe9ecfSBen Skeggs };
163acbe9ecfSBen Skeggs 
164acbe9ecfSBen Skeggs static const struct nvkm_disp_chan_mthd
165acbe9ecfSBen Skeggs g84_disp_ovly_mthd = {
166acbe9ecfSBen Skeggs 	.name = "Overlay",
167acbe9ecfSBen Skeggs 	.addr = 0x000540,
168acbe9ecfSBen Skeggs 	.prev = 0x000004,
169acbe9ecfSBen Skeggs 	.data = {
170acbe9ecfSBen Skeggs 		{ "Global", 1, &g84_disp_ovly_mthd_base },
171acbe9ecfSBen Skeggs 		{}
172acbe9ecfSBen Skeggs 	}
173acbe9ecfSBen Skeggs };
174acbe9ecfSBen Skeggs 
175889fcbe9SBen Skeggs const struct nvkm_disp_chan_user
176889fcbe9SBen Skeggs g84_disp_ovly = {
177889fcbe9SBen Skeggs 	.func = &nv50_disp_dmac_func,
178889fcbe9SBen Skeggs 	.ctrl = 3,
179889fcbe9SBen Skeggs 	.user = 3,
180889fcbe9SBen Skeggs 	.mthd = &g84_disp_ovly_mthd,
181889fcbe9SBen Skeggs };
182acbe9ecfSBen Skeggs 
183acbe9ecfSBen Skeggs static const struct nvkm_disp_mthd_list
184acbe9ecfSBen Skeggs g84_disp_base_mthd_base = {
185acbe9ecfSBen Skeggs 	.mthd = 0x0000,
186acbe9ecfSBen Skeggs 	.addr = 0x000000,
187acbe9ecfSBen Skeggs 	.data = {
188acbe9ecfSBen Skeggs 		{ 0x0080, 0x000000 },
189acbe9ecfSBen Skeggs 		{ 0x0084, 0x0008c4 },
190acbe9ecfSBen Skeggs 		{ 0x0088, 0x0008d0 },
191acbe9ecfSBen Skeggs 		{ 0x008c, 0x0008dc },
192acbe9ecfSBen Skeggs 		{ 0x0090, 0x0008e4 },
193acbe9ecfSBen Skeggs 		{ 0x0094, 0x610884 },
194acbe9ecfSBen Skeggs 		{ 0x00a0, 0x6108a0 },
195acbe9ecfSBen Skeggs 		{ 0x00a4, 0x610878 },
196acbe9ecfSBen Skeggs 		{ 0x00c0, 0x61086c },
197acbe9ecfSBen Skeggs 		{ 0x00c4, 0x610800 },
198acbe9ecfSBen Skeggs 		{ 0x00c8, 0x61080c },
199acbe9ecfSBen Skeggs 		{ 0x00cc, 0x610818 },
200acbe9ecfSBen Skeggs 		{ 0x00e0, 0x610858 },
201acbe9ecfSBen Skeggs 		{ 0x00e4, 0x610860 },
202acbe9ecfSBen Skeggs 		{ 0x00e8, 0x6108ac },
203acbe9ecfSBen Skeggs 		{ 0x00ec, 0x6108b4 },
204acbe9ecfSBen Skeggs 		{ 0x00fc, 0x610824 },
205acbe9ecfSBen Skeggs 		{ 0x0100, 0x610894 },
206acbe9ecfSBen Skeggs 		{ 0x0104, 0x61082c },
207acbe9ecfSBen Skeggs 		{ 0x0110, 0x6108bc },
208acbe9ecfSBen Skeggs 		{ 0x0114, 0x61088c },
209acbe9ecfSBen Skeggs 		{}
210acbe9ecfSBen Skeggs 	}
211acbe9ecfSBen Skeggs };
212acbe9ecfSBen Skeggs 
213acbe9ecfSBen Skeggs static const struct nvkm_disp_chan_mthd
214acbe9ecfSBen Skeggs g84_disp_base_mthd = {
215acbe9ecfSBen Skeggs 	.name = "Base",
216acbe9ecfSBen Skeggs 	.addr = 0x000540,
217acbe9ecfSBen Skeggs 	.prev = 0x000004,
218acbe9ecfSBen Skeggs 	.data = {
219acbe9ecfSBen Skeggs 		{ "Global", 1, &g84_disp_base_mthd_base },
220acbe9ecfSBen Skeggs 		{  "Image", 2, &nv50_disp_base_mthd_image },
221acbe9ecfSBen Skeggs 		{}
222acbe9ecfSBen Skeggs 	}
223acbe9ecfSBen Skeggs };
224acbe9ecfSBen Skeggs 
225889fcbe9SBen Skeggs const struct nvkm_disp_chan_user
226889fcbe9SBen Skeggs g84_disp_base = {
227889fcbe9SBen Skeggs 	.func = &nv50_disp_dmac_func,
228889fcbe9SBen Skeggs 	.ctrl = 1,
229889fcbe9SBen Skeggs 	.user = 1,
230889fcbe9SBen Skeggs 	.mthd = &g84_disp_base_mthd,
231889fcbe9SBen Skeggs };
232acbe9ecfSBen Skeggs 
233acbe9ecfSBen Skeggs const struct nvkm_disp_mthd_list
234acbe9ecfSBen Skeggs g84_disp_core_mthd_dac = {
235acbe9ecfSBen Skeggs 	.mthd = 0x0080,
236acbe9ecfSBen Skeggs 	.addr = 0x000008,
237acbe9ecfSBen Skeggs 	.data = {
238acbe9ecfSBen Skeggs 		{ 0x0400, 0x610b58 },
239acbe9ecfSBen Skeggs 		{ 0x0404, 0x610bdc },
240acbe9ecfSBen Skeggs 		{ 0x0420, 0x610bc4 },
241acbe9ecfSBen Skeggs 		{}
242acbe9ecfSBen Skeggs 	}
243acbe9ecfSBen Skeggs };
244acbe9ecfSBen Skeggs 
245acbe9ecfSBen Skeggs const struct nvkm_disp_mthd_list
246acbe9ecfSBen Skeggs g84_disp_core_mthd_head = {
247acbe9ecfSBen Skeggs 	.mthd = 0x0400,
248acbe9ecfSBen Skeggs 	.addr = 0x000540,
249acbe9ecfSBen Skeggs 	.data = {
250acbe9ecfSBen Skeggs 		{ 0x0800, 0x610ad8 },
251acbe9ecfSBen Skeggs 		{ 0x0804, 0x610ad0 },
252acbe9ecfSBen Skeggs 		{ 0x0808, 0x610a48 },
253acbe9ecfSBen Skeggs 		{ 0x080c, 0x610a78 },
254acbe9ecfSBen Skeggs 		{ 0x0810, 0x610ac0 },
255acbe9ecfSBen Skeggs 		{ 0x0814, 0x610af8 },
256acbe9ecfSBen Skeggs 		{ 0x0818, 0x610b00 },
257acbe9ecfSBen Skeggs 		{ 0x081c, 0x610ae8 },
258acbe9ecfSBen Skeggs 		{ 0x0820, 0x610af0 },
259acbe9ecfSBen Skeggs 		{ 0x0824, 0x610b08 },
260acbe9ecfSBen Skeggs 		{ 0x0828, 0x610b10 },
261acbe9ecfSBen Skeggs 		{ 0x082c, 0x610a68 },
262acbe9ecfSBen Skeggs 		{ 0x0830, 0x610a60 },
263acbe9ecfSBen Skeggs 		{ 0x0834, 0x000000 },
264acbe9ecfSBen Skeggs 		{ 0x0838, 0x610a40 },
265acbe9ecfSBen Skeggs 		{ 0x0840, 0x610a24 },
266acbe9ecfSBen Skeggs 		{ 0x0844, 0x610a2c },
267acbe9ecfSBen Skeggs 		{ 0x0848, 0x610aa8 },
268acbe9ecfSBen Skeggs 		{ 0x084c, 0x610ab0 },
269acbe9ecfSBen Skeggs 		{ 0x085c, 0x610c5c },
270acbe9ecfSBen Skeggs 		{ 0x0860, 0x610a84 },
271acbe9ecfSBen Skeggs 		{ 0x0864, 0x610a90 },
272acbe9ecfSBen Skeggs 		{ 0x0868, 0x610b18 },
273acbe9ecfSBen Skeggs 		{ 0x086c, 0x610b20 },
274acbe9ecfSBen Skeggs 		{ 0x0870, 0x610ac8 },
275acbe9ecfSBen Skeggs 		{ 0x0874, 0x610a38 },
276acbe9ecfSBen Skeggs 		{ 0x0878, 0x610c50 },
277acbe9ecfSBen Skeggs 		{ 0x0880, 0x610a58 },
278acbe9ecfSBen Skeggs 		{ 0x0884, 0x610a9c },
279acbe9ecfSBen Skeggs 		{ 0x089c, 0x610c68 },
280acbe9ecfSBen Skeggs 		{ 0x08a0, 0x610a70 },
281acbe9ecfSBen Skeggs 		{ 0x08a4, 0x610a50 },
282acbe9ecfSBen Skeggs 		{ 0x08a8, 0x610ae0 },
283acbe9ecfSBen Skeggs 		{ 0x08c0, 0x610b28 },
284acbe9ecfSBen Skeggs 		{ 0x08c4, 0x610b30 },
285acbe9ecfSBen Skeggs 		{ 0x08c8, 0x610b40 },
286acbe9ecfSBen Skeggs 		{ 0x08d4, 0x610b38 },
287acbe9ecfSBen Skeggs 		{ 0x08d8, 0x610b48 },
288acbe9ecfSBen Skeggs 		{ 0x08dc, 0x610b50 },
289acbe9ecfSBen Skeggs 		{ 0x0900, 0x610a18 },
290acbe9ecfSBen Skeggs 		{ 0x0904, 0x610ab8 },
291acbe9ecfSBen Skeggs 		{ 0x0910, 0x610c70 },
292acbe9ecfSBen Skeggs 		{ 0x0914, 0x610c78 },
293acbe9ecfSBen Skeggs 		{}
294acbe9ecfSBen Skeggs 	}
295acbe9ecfSBen Skeggs };
296acbe9ecfSBen Skeggs 
297acbe9ecfSBen Skeggs const struct nvkm_disp_chan_mthd
298acbe9ecfSBen Skeggs g84_disp_core_mthd = {
299acbe9ecfSBen Skeggs 	.name = "Core",
300acbe9ecfSBen Skeggs 	.addr = 0x000000,
301acbe9ecfSBen Skeggs 	.prev = 0x000004,
302acbe9ecfSBen Skeggs 	.data = {
303acbe9ecfSBen Skeggs 		{ "Global", 1, &nv50_disp_core_mthd_base },
304acbe9ecfSBen Skeggs 		{    "DAC", 3, &g84_disp_core_mthd_dac  },
305acbe9ecfSBen Skeggs 		{    "SOR", 2, &nv50_disp_core_mthd_sor  },
306acbe9ecfSBen Skeggs 		{   "PIOR", 3, &nv50_disp_core_mthd_pior },
307acbe9ecfSBen Skeggs 		{   "HEAD", 2, &g84_disp_core_mthd_head },
308acbe9ecfSBen Skeggs 		{}
309acbe9ecfSBen Skeggs 	}
310acbe9ecfSBen Skeggs };
311acbe9ecfSBen Skeggs 
312889fcbe9SBen Skeggs const struct nvkm_disp_chan_user
313889fcbe9SBen Skeggs g84_disp_core = {
314889fcbe9SBen Skeggs 	.func = &nv50_disp_core_func,
315889fcbe9SBen Skeggs 	.ctrl = 0,
316889fcbe9SBen Skeggs 	.user = 0,
317889fcbe9SBen Skeggs 	.mthd = &g84_disp_core_mthd,
318889fcbe9SBen Skeggs };
319acbe9ecfSBen Skeggs 
3200407b33fSBen Skeggs static const struct nvkm_disp_func
3210ce41e3cSBen Skeggs g84_disp = {
322acbe9ecfSBen Skeggs 	.oneinit = nv50_disp_oneinit,
32392fba5d3SBen Skeggs 	.init = nv50_disp_init,
32492fba5d3SBen Skeggs 	.fini = nv50_disp_fini,
32592fba5d3SBen Skeggs 	.intr = nv50_disp_intr,
326af85389cSBen Skeggs 	.super = nv50_disp_super,
32792fba5d3SBen Skeggs 	.uevent = &nv50_disp_chan_uevent,
328f7b2ece3SBen Skeggs 	.head = { .cnt = nv50_head_cnt, .new = nv50_head_new },
329bf5d1a6bSBen Skeggs 	.dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
3309fe4e177SBen Skeggs 	.sor = { .cnt = nv50_sor_cnt, .new = g84_sor_new },
331f5e088d6SBen Skeggs 	.pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
332168c0299SBen Skeggs 	.root = { 0,0,G82_DISP },
333168c0299SBen Skeggs 	.user = {
334889fcbe9SBen Skeggs 		{{0,0,G82_DISP_CURSOR             }, nvkm_disp_chan_new, &nv50_disp_curs },
335889fcbe9SBen Skeggs 		{{0,0,G82_DISP_OVERLAY            }, nvkm_disp_chan_new, &nv50_disp_oimm },
336889fcbe9SBen Skeggs 		{{0,0,G82_DISP_BASE_CHANNEL_DMA   }, nvkm_disp_chan_new, & g84_disp_base },
337889fcbe9SBen Skeggs 		{{0,0,G82_DISP_CORE_CHANNEL_DMA   }, nvkm_disp_core_new, & g84_disp_core },
338889fcbe9SBen Skeggs 		{{0,0,G82_DISP_OVERLAY_CHANNEL_DMA}, nvkm_disp_chan_new, & g84_disp_ovly },
339168c0299SBen Skeggs 		{}
340168c0299SBen Skeggs 	},
3410ce41e3cSBen Skeggs };
3420ce41e3cSBen Skeggs 
34370aa8670SBen Skeggs int
g84_disp_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_disp ** pdisp)344a7f000ecSBen Skeggs g84_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
345a7f000ecSBen Skeggs 	     struct nvkm_disp **pdisp)
346878da15aSBen Skeggs {
3471c6aab75SBen Skeggs 	return nvkm_disp_new_(&g84_disp, device, type, inst, pdisp);
348878da15aSBen Skeggs }
349