aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-05-02 03:33:25 -0400
committerDave Airlie <airlied@redhat.com>2013-05-02 03:33:25 -0400
commitf468400664e3ae79e6e001bb2820c79bebe6aa41 (patch)
tree0f78e9bfe17bfa2e05ed804582e484d458d2cb8f /drivers
parentb11b88ef0e07a1ea9a3df6666ba8e15833facc67 (diff)
parent7b4f638b3a611118324328a18c842e26996493fe (diff)
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
Add GK110 modesetting suport. * 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nve0: recognise nvf0 as a kepler board (GK110) drm/nouveau: force noaccel when no PFIFO support present drm/nvf0/disp: expose display class 2.2
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/Makefile1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/device/base.c3
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/device/nve0.c34
-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/nouveau_drm.c3
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c1
9 files changed, 145 insertions, 2 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/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c
index 86d24904e9d3..4c72571655ad 100644
--- a/drivers/gpu/drm/nouveau/core/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/base.c
@@ -172,7 +172,8 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
172 case 0xa0: device->card_type = NV_50; break; 172 case 0xa0: device->card_type = NV_50; break;
173 case 0xc0: device->card_type = NV_C0; break; 173 case 0xc0: device->card_type = NV_C0; break;
174 case 0xd0: device->card_type = NV_D0; break; 174 case 0xd0: device->card_type = NV_D0; break;
175 case 0xe0: device->card_type = NV_E0; break; 175 case 0xe0:
176 case 0xf0: device->card_type = NV_E0; break;
176 default: 177 default:
177 break; 178 break;
178 } 179 }
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/nve0.c b/drivers/gpu/drm/nouveau/core/engine/device/nve0.c
index e6a77944f43b..08f7b52d9e0c 100644
--- a/drivers/gpu/drm/nouveau/core/engine/device/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/nve0.c
@@ -141,6 +141,40 @@ nve0_identify(struct nouveau_device *device)
141 device->oclass[NVDEV_ENGINE_VP ] = &nve0_vp_oclass; 141 device->oclass[NVDEV_ENGINE_VP ] = &nve0_vp_oclass;
142 device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass; 142 device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass;
143 break; 143 break;
144 case 0xf0:
145 device->cname = "GK110";
146 device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
147 device->oclass[NVDEV_SUBDEV_GPIO ] = &nve0_gpio_oclass;
148 device->oclass[NVDEV_SUBDEV_I2C ] = &nvd0_i2c_oclass;
149 device->oclass[NVDEV_SUBDEV_CLOCK ] = &nvc0_clock_oclass;
150 device->oclass[NVDEV_SUBDEV_THERM ] = &nvd0_therm_oclass;
151 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
152 device->oclass[NVDEV_SUBDEV_DEVINIT] = &nvc0_devinit_oclass;
153 device->oclass[NVDEV_SUBDEV_MC ] = &nvc0_mc_oclass;
154 device->oclass[NVDEV_SUBDEV_BUS ] = &nvc0_bus_oclass;
155 device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
156 device->oclass[NVDEV_SUBDEV_FB ] = &nvc0_fb_oclass;
157 device->oclass[NVDEV_SUBDEV_LTCG ] = &nvc0_ltcg_oclass;
158 device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
159 device->oclass[NVDEV_SUBDEV_INSTMEM] = &nv50_instmem_oclass;
160 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
161 device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
162 device->oclass[NVDEV_ENGINE_DMAOBJ ] = &nvd0_dmaeng_oclass;
163#if 0
164 device->oclass[NVDEV_ENGINE_FIFO ] = &nve0_fifo_oclass;
165 device->oclass[NVDEV_ENGINE_SW ] = &nvc0_software_oclass;
166 device->oclass[NVDEV_ENGINE_GR ] = &nve0_graph_oclass;
167#endif
168 device->oclass[NVDEV_ENGINE_DISP ] = &nvf0_disp_oclass;
169#if 0
170 device->oclass[NVDEV_ENGINE_COPY0 ] = &nve0_copy0_oclass;
171 device->oclass[NVDEV_ENGINE_COPY1 ] = &nve0_copy1_oclass;
172 device->oclass[NVDEV_ENGINE_COPY2 ] = &nve0_copy2_oclass;
173 device->oclass[NVDEV_ENGINE_BSP ] = &nve0_bsp_oclass;
174 device->oclass[NVDEV_ENGINE_VP ] = &nve0_vp_oclass;
175 device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass;
176#endif
177 break;
144 default: 178 default:
145 nv_fatal(device, "unknown Kepler chipset\n"); 179 nv_fatal(device, "unknown Kepler chipset\n");
146 return -EINVAL; 180 return -EINVAL;
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/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index c33b13fb18db..46c152ff0a80 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -33,6 +33,7 @@
33 33
34#include <engine/device.h> 34#include <engine/device.h>
35#include <engine/disp.h> 35#include <engine/disp.h>
36#include <engine/fifo.h>
36 37
37#include <subdev/vm.h> 38#include <subdev/vm.h>
38 39
@@ -164,7 +165,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
164 u32 arg0, arg1; 165 u32 arg0, arg1;
165 int ret; 166 int ret;
166 167
167 if (nouveau_noaccel) 168 if (nouveau_noaccel || !nouveau_fifo(device) /*XXX*/)
168 return; 169 return;
169 170
170 /* initialise synchronisation routines */ 171 /* initialise synchronisation routines */
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,