aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-03-30 08:31:25 -0400
committerBen Skeggs <bskeggs@redhat.com>2013-05-02 02:23:13 -0400
commite5398b23a5cdcd1f4901cbce0933937b5509dc72 (patch)
tree4de523fda578756ce2f944078a3c65e8ee8ba758
parent893e90c554c1ef85684b335655a5030d38a4a1b0 (diff)
drm/nvf0/disp: expose display class 2.2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/Makefile1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c89
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c3
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/class.h12
-rw-r--r--drivers/gpu/drm/nouveau/core/include/engine/disp.h1
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c1
6 files changed, 107 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
index 52930a20d8f8..998e8b4444f3 100644
--- a/drivers/gpu/drm/nouveau/Makefile
+++ b/drivers/gpu/drm/nouveau/Makefile
@@ -160,6 +160,7 @@ nouveau-y += core/engine/disp/nva0.o
160nouveau-y += core/engine/disp/nva3.o 160nouveau-y += core/engine/disp/nva3.o
161nouveau-y += core/engine/disp/nvd0.o 161nouveau-y += core/engine/disp/nvd0.o
162nouveau-y += core/engine/disp/nve0.o 162nouveau-y += core/engine/disp/nve0.o
163nouveau-y += core/engine/disp/nvf0.o
163nouveau-y += core/engine/disp/dacnv50.o 164nouveau-y += core/engine/disp/dacnv50.o
164nouveau-y += core/engine/disp/dport.o 165nouveau-y += core/engine/disp/dport.o
165nouveau-y += core/engine/disp/hdanva3.o 166nouveau-y += core/engine/disp/hdanva3.o
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c
new file mode 100644
index 000000000000..a488c36e40f9
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c
@@ -0,0 +1,89 @@
1/*
2 * Copyright 2012 Red Hat Inc.
3 *
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:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
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.
21 *
22 * Authors: Ben Skeggs
23 */
24
25#include <engine/software.h>
26#include <engine/disp.h>
27
28#include <core/class.h>
29
30#include "nv50.h"
31
32static struct nouveau_oclass
33nvf0_disp_sclass[] = {
34 { NVF0_DISP_MAST_CLASS, &nvd0_disp_mast_ofuncs },
35 { NVF0_DISP_SYNC_CLASS, &nvd0_disp_sync_ofuncs },
36 { NVF0_DISP_OVLY_CLASS, &nvd0_disp_ovly_ofuncs },
37 { NVF0_DISP_OIMM_CLASS, &nvd0_disp_oimm_ofuncs },
38 { NVF0_DISP_CURS_CLASS, &nvd0_disp_curs_ofuncs },
39 {}
40};
41
42static struct nouveau_oclass
43nvf0_disp_base_oclass[] = {
44 { NVF0_DISP_CLASS, &nvd0_disp_base_ofuncs, nva3_disp_base_omthds },
45 {}
46};
47
48static int
49nvf0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
50 struct nouveau_oclass *oclass, void *data, u32 size,
51 struct nouveau_object **pobject)
52{
53 struct nv50_disp_priv *priv;
54 int heads = nv_rd32(parent, 0x022448);
55 int ret;
56
57 ret = nouveau_disp_create(parent, engine, oclass, heads,
58 "PDISP", "display", &priv);
59 *pobject = nv_object(priv);
60 if (ret)
61 return ret;
62
63 nv_engine(priv)->sclass = nvf0_disp_base_oclass;
64 nv_engine(priv)->cclass = &nv50_disp_cclass;
65 nv_subdev(priv)->intr = nvd0_disp_intr;
66 INIT_WORK(&priv->supervisor, nvd0_disp_intr_supervisor);
67 priv->sclass = nvf0_disp_sclass;
68 priv->head.nr = heads;
69 priv->dac.nr = 3;
70 priv->sor.nr = 4;
71 priv->dac.power = nv50_dac_power;
72 priv->dac.sense = nv50_dac_sense;
73 priv->sor.power = nv50_sor_power;
74 priv->sor.hda_eld = nvd0_hda_eld;
75 priv->sor.hdmi = nvd0_hdmi_ctrl;
76 priv->sor.dp = &nvd0_sor_dp_func;
77 return 0;
78}
79
80struct nouveau_oclass
81nvf0_disp_oclass = {
82 .handle = NV_ENGINE(DISP, 0x92),
83 .ofuncs = &(struct nouveau_ofuncs) {
84 .ctor = nvf0_disp_ctor,
85 .dtor = _nouveau_disp_dtor,
86 .init = _nouveau_disp_init,
87 .fini = _nouveau_disp_fini,
88 },
89};
diff --git a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c
index d1528752980c..944e73ac485c 100644
--- a/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/dmaobj/nvd0.c
@@ -50,6 +50,9 @@ nvd0_dmaobj_bind(struct nouveau_dmaeng *dmaeng,
50 case NVE0_DISP_MAST_CLASS: 50 case NVE0_DISP_MAST_CLASS:
51 case NVE0_DISP_SYNC_CLASS: 51 case NVE0_DISP_SYNC_CLASS:
52 case NVE0_DISP_OVLY_CLASS: 52 case NVE0_DISP_OVLY_CLASS:
53 case NVF0_DISP_MAST_CLASS:
54 case NVF0_DISP_SYNC_CLASS:
55 case NVF0_DISP_OVLY_CLASS:
53 break; 56 break;
54 default: 57 default:
55 return -EINVAL; 58 return -EINVAL;
diff --git a/drivers/gpu/drm/nouveau/core/include/core/class.h b/drivers/gpu/drm/nouveau/core/include/core/class.h
index 92d3ab11d962..0a393f7f055f 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/class.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/class.h
@@ -169,6 +169,7 @@ struct nv04_display_class {
169 * 8570: NVA3_DISP 169 * 8570: NVA3_DISP
170 * 9070: NVD0_DISP 170 * 9070: NVD0_DISP
171 * 9170: NVE0_DISP 171 * 9170: NVE0_DISP
172 * 9270: NVF0_DISP
172 */ 173 */
173 174
174#define NV50_DISP_CLASS 0x00005070 175#define NV50_DISP_CLASS 0x00005070
@@ -178,6 +179,7 @@ struct nv04_display_class {
178#define NVA3_DISP_CLASS 0x00008570 179#define NVA3_DISP_CLASS 0x00008570
179#define NVD0_DISP_CLASS 0x00009070 180#define NVD0_DISP_CLASS 0x00009070
180#define NVE0_DISP_CLASS 0x00009170 181#define NVE0_DISP_CLASS 0x00009170
182#define NVF0_DISP_CLASS 0x00009270
181 183
182#define NV50_DISP_SOR_MTHD 0x00010000 184#define NV50_DISP_SOR_MTHD 0x00010000
183#define NV50_DISP_SOR_MTHD_TYPE 0x0000f000 185#define NV50_DISP_SOR_MTHD_TYPE 0x0000f000
@@ -246,6 +248,7 @@ struct nv50_display_class {
246 * 857a: NVA3_DISP_CURS 248 * 857a: NVA3_DISP_CURS
247 * 907a: NVD0_DISP_CURS 249 * 907a: NVD0_DISP_CURS
248 * 917a: NVE0_DISP_CURS 250 * 917a: NVE0_DISP_CURS
251 * 927a: NVF0_DISP_CURS
249 */ 252 */
250 253
251#define NV50_DISP_CURS_CLASS 0x0000507a 254#define NV50_DISP_CURS_CLASS 0x0000507a
@@ -255,6 +258,7 @@ struct nv50_display_class {
255#define NVA3_DISP_CURS_CLASS 0x0000857a 258#define NVA3_DISP_CURS_CLASS 0x0000857a
256#define NVD0_DISP_CURS_CLASS 0x0000907a 259#define NVD0_DISP_CURS_CLASS 0x0000907a
257#define NVE0_DISP_CURS_CLASS 0x0000917a 260#define NVE0_DISP_CURS_CLASS 0x0000917a
261#define NVF0_DISP_CURS_CLASS 0x0000927a
258 262
259struct nv50_display_curs_class { 263struct nv50_display_curs_class {
260 u32 head; 264 u32 head;
@@ -267,6 +271,7 @@ struct nv50_display_curs_class {
267 * 857b: NVA3_DISP_OIMM 271 * 857b: NVA3_DISP_OIMM
268 * 907b: NVD0_DISP_OIMM 272 * 907b: NVD0_DISP_OIMM
269 * 917b: NVE0_DISP_OIMM 273 * 917b: NVE0_DISP_OIMM
274 * 927b: NVE0_DISP_OIMM
270 */ 275 */
271 276
272#define NV50_DISP_OIMM_CLASS 0x0000507b 277#define NV50_DISP_OIMM_CLASS 0x0000507b
@@ -276,6 +281,7 @@ struct nv50_display_curs_class {
276#define NVA3_DISP_OIMM_CLASS 0x0000857b 281#define NVA3_DISP_OIMM_CLASS 0x0000857b
277#define NVD0_DISP_OIMM_CLASS 0x0000907b 282#define NVD0_DISP_OIMM_CLASS 0x0000907b
278#define NVE0_DISP_OIMM_CLASS 0x0000917b 283#define NVE0_DISP_OIMM_CLASS 0x0000917b
284#define NVF0_DISP_OIMM_CLASS 0x0000927b
279 285
280struct nv50_display_oimm_class { 286struct nv50_display_oimm_class {
281 u32 head; 287 u32 head;
@@ -288,6 +294,7 @@ struct nv50_display_oimm_class {
288 * 857c: NVA3_DISP_SYNC 294 * 857c: NVA3_DISP_SYNC
289 * 907c: NVD0_DISP_SYNC 295 * 907c: NVD0_DISP_SYNC
290 * 917c: NVE0_DISP_SYNC 296 * 917c: NVE0_DISP_SYNC
297 * 927c: NVF0_DISP_SYNC
291 */ 298 */
292 299
293#define NV50_DISP_SYNC_CLASS 0x0000507c 300#define NV50_DISP_SYNC_CLASS 0x0000507c
@@ -297,6 +304,7 @@ struct nv50_display_oimm_class {
297#define NVA3_DISP_SYNC_CLASS 0x0000857c 304#define NVA3_DISP_SYNC_CLASS 0x0000857c
298#define NVD0_DISP_SYNC_CLASS 0x0000907c 305#define NVD0_DISP_SYNC_CLASS 0x0000907c
299#define NVE0_DISP_SYNC_CLASS 0x0000917c 306#define NVE0_DISP_SYNC_CLASS 0x0000917c
307#define NVF0_DISP_SYNC_CLASS 0x0000927c
300 308
301struct nv50_display_sync_class { 309struct nv50_display_sync_class {
302 u32 pushbuf; 310 u32 pushbuf;
@@ -310,6 +318,7 @@ struct nv50_display_sync_class {
310 * 857d: NVA3_DISP_MAST 318 * 857d: NVA3_DISP_MAST
311 * 907d: NVD0_DISP_MAST 319 * 907d: NVD0_DISP_MAST
312 * 917d: NVE0_DISP_MAST 320 * 917d: NVE0_DISP_MAST
321 * 927d: NVF0_DISP_MAST
313 */ 322 */
314 323
315#define NV50_DISP_MAST_CLASS 0x0000507d 324#define NV50_DISP_MAST_CLASS 0x0000507d
@@ -319,6 +328,7 @@ struct nv50_display_sync_class {
319#define NVA3_DISP_MAST_CLASS 0x0000857d 328#define NVA3_DISP_MAST_CLASS 0x0000857d
320#define NVD0_DISP_MAST_CLASS 0x0000907d 329#define NVD0_DISP_MAST_CLASS 0x0000907d
321#define NVE0_DISP_MAST_CLASS 0x0000917d 330#define NVE0_DISP_MAST_CLASS 0x0000917d
331#define NVF0_DISP_MAST_CLASS 0x0000927d
322 332
323struct nv50_display_mast_class { 333struct nv50_display_mast_class {
324 u32 pushbuf; 334 u32 pushbuf;
@@ -331,6 +341,7 @@ struct nv50_display_mast_class {
331 * 857e: NVA3_DISP_OVLY 341 * 857e: NVA3_DISP_OVLY
332 * 907e: NVD0_DISP_OVLY 342 * 907e: NVD0_DISP_OVLY
333 * 917e: NVE0_DISP_OVLY 343 * 917e: NVE0_DISP_OVLY
344 * 927e: NVF0_DISP_OVLY
334 */ 345 */
335 346
336#define NV50_DISP_OVLY_CLASS 0x0000507e 347#define NV50_DISP_OVLY_CLASS 0x0000507e
@@ -340,6 +351,7 @@ struct nv50_display_mast_class {
340#define NVA3_DISP_OVLY_CLASS 0x0000857e 351#define NVA3_DISP_OVLY_CLASS 0x0000857e
341#define NVD0_DISP_OVLY_CLASS 0x0000907e 352#define NVD0_DISP_OVLY_CLASS 0x0000907e
342#define NVE0_DISP_OVLY_CLASS 0x0000917e 353#define NVE0_DISP_OVLY_CLASS 0x0000917e
354#define NVF0_DISP_OVLY_CLASS 0x0000927e
343 355
344struct nv50_display_ovly_class { 356struct nv50_display_ovly_class {
345 u32 pushbuf; 357 u32 pushbuf;
diff --git a/drivers/gpu/drm/nouveau/core/include/engine/disp.h b/drivers/gpu/drm/nouveau/core/include/engine/disp.h
index 28da6772c095..4b21fabfbddb 100644
--- a/drivers/gpu/drm/nouveau/core/include/engine/disp.h
+++ b/drivers/gpu/drm/nouveau/core/include/engine/disp.h
@@ -44,5 +44,6 @@ extern struct nouveau_oclass nv94_disp_oclass;
44extern struct nouveau_oclass nva3_disp_oclass; 44extern struct nouveau_oclass nva3_disp_oclass;
45extern struct nouveau_oclass nvd0_disp_oclass; 45extern struct nouveau_oclass nvd0_disp_oclass;
46extern struct nouveau_oclass nve0_disp_oclass; 46extern struct nouveau_oclass nve0_disp_oclass;
47extern struct nouveau_oclass nvf0_disp_oclass;
47 48
48#endif 49#endif
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 7f0e6c3f37d1..325887390677 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -2174,6 +2174,7 @@ int
2174nv50_display_create(struct drm_device *dev) 2174nv50_display_create(struct drm_device *dev)
2175{ 2175{
2176 static const u16 oclass[] = { 2176 static const u16 oclass[] = {
2177 NVF0_DISP_CLASS,
2177 NVE0_DISP_CLASS, 2178 NVE0_DISP_CLASS,
2178 NVD0_DISP_CLASS, 2179 NVD0_DISP_CLASS,
2179 NVA3_DISP_CLASS, 2180 NVA3_DISP_CLASS,