diff options
17 files changed, 287 insertions, 35 deletions
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index d1dd49b344ec..e88145ba1bf5 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile | |||
| @@ -72,7 +72,10 @@ nouveau-y += core/subdev/devinit/nv10.o | |||
| 72 | nouveau-y += core/subdev/devinit/nv1a.o | 72 | nouveau-y += core/subdev/devinit/nv1a.o |
| 73 | nouveau-y += core/subdev/devinit/nv20.o | 73 | nouveau-y += core/subdev/devinit/nv20.o |
| 74 | nouveau-y += core/subdev/devinit/nv50.o | 74 | nouveau-y += core/subdev/devinit/nv50.o |
| 75 | nouveau-y += core/subdev/devinit/nv84.o | ||
| 76 | nouveau-y += core/subdev/devinit/nv98.o | ||
| 75 | nouveau-y += core/subdev/devinit/nva3.o | 77 | nouveau-y += core/subdev/devinit/nva3.o |
| 78 | nouveau-y += core/subdev/devinit/nvaf.o | ||
| 76 | nouveau-y += core/subdev/devinit/nvc0.o | 79 | nouveau-y += core/subdev/devinit/nvc0.o |
| 77 | nouveau-y += core/subdev/fb/base.o | 80 | nouveau-y += core/subdev/fb/base.o |
| 78 | nouveau-y += core/subdev/fb/nv04.o | 81 | nouveau-y += core/subdev/fb/nv04.o |
diff --git a/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c index 993df09ad643..ac3291f781f6 100644 --- a/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c | |||
| @@ -105,9 +105,6 @@ nvc0_copy0_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 105 | struct nvc0_copy_priv *priv; | 105 | struct nvc0_copy_priv *priv; |
| 106 | int ret; | 106 | int ret; |
| 107 | 107 | ||
| 108 | if (nv_rd32(parent, 0x022500) & 0x00000100) | ||
| 109 | return -ENODEV; | ||
| 110 | |||
| 111 | ret = nouveau_falcon_create(parent, engine, oclass, 0x104000, true, | 108 | ret = nouveau_falcon_create(parent, engine, oclass, 0x104000, true, |
| 112 | "PCE0", "copy0", &priv); | 109 | "PCE0", "copy0", &priv); |
| 113 | *pobject = nv_object(priv); | 110 | *pobject = nv_object(priv); |
| @@ -133,9 +130,6 @@ nvc0_copy1_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 133 | struct nvc0_copy_priv *priv; | 130 | struct nvc0_copy_priv *priv; |
| 134 | int ret; | 131 | int ret; |
| 135 | 132 | ||
| 136 | if (nv_rd32(parent, 0x022500) & 0x00000200) | ||
| 137 | return -ENODEV; | ||
| 138 | |||
| 139 | ret = nouveau_falcon_create(parent, engine, oclass, 0x105000, true, | 133 | ret = nouveau_falcon_create(parent, engine, oclass, 0x105000, true, |
| 140 | "PCE1", "copy1", &priv); | 134 | "PCE1", "copy1", &priv); |
| 141 | *pobject = nv_object(priv); | 135 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c b/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c index 30f1ef1edcc5..748a61eb3c6f 100644 --- a/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c | |||
| @@ -88,9 +88,6 @@ nve0_copy0_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 88 | struct nve0_copy_priv *priv; | 88 | struct nve0_copy_priv *priv; |
| 89 | int ret; | 89 | int ret; |
| 90 | 90 | ||
| 91 | if (nv_rd32(parent, 0x022500) & 0x00000100) | ||
| 92 | return -ENODEV; | ||
| 93 | |||
| 94 | ret = nouveau_engine_create(parent, engine, oclass, true, | 91 | ret = nouveau_engine_create(parent, engine, oclass, true, |
| 95 | "PCE0", "copy0", &priv); | 92 | "PCE0", "copy0", &priv); |
| 96 | *pobject = nv_object(priv); | 93 | *pobject = nv_object(priv); |
| @@ -112,9 +109,6 @@ nve0_copy1_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 112 | struct nve0_copy_priv *priv; | 109 | struct nve0_copy_priv *priv; |
| 113 | int ret; | 110 | int ret; |
| 114 | 111 | ||
| 115 | if (nv_rd32(parent, 0x022500) & 0x00000200) | ||
| 116 | return -ENODEV; | ||
| 117 | |||
| 118 | ret = nouveau_engine_create(parent, engine, oclass, true, | 112 | ret = nouveau_engine_create(parent, engine, oclass, true, |
| 119 | "PCE1", "copy1", &priv); | 113 | "PCE1", "copy1", &priv); |
| 120 | *pobject = nv_object(priv); | 114 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/nv50.c b/drivers/gpu/drm/nouveau/core/engine/device/nv50.c index 5ae94475a3f1..81d5c26643d5 100644 --- a/drivers/gpu/drm/nouveau/core/engine/device/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/device/nv50.c | |||
| @@ -90,7 +90,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 90 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 90 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 91 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 91 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 92 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 92 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 93 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 93 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv84_devinit_oclass; |
| 94 | device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; | 94 | device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; |
| 95 | device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; | 95 | device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; |
| 96 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 96 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -118,7 +118,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 118 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 118 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 119 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 119 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 120 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 120 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 121 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 121 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv84_devinit_oclass; |
| 122 | device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; | 122 | device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; |
| 123 | device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; | 123 | device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; |
| 124 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 124 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -146,7 +146,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 146 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 146 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 147 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 147 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 148 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 148 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 149 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 149 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv84_devinit_oclass; |
| 150 | device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; | 150 | device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; |
| 151 | device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; | 151 | device->oclass[NVDEV_SUBDEV_BUS ] = nv50_bus_oclass; |
| 152 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 152 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -174,7 +174,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 174 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 174 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 175 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 175 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 176 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 176 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 177 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 177 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv84_devinit_oclass; |
| 178 | device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass; | 178 | device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass; |
| 179 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 179 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 180 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 180 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -202,7 +202,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 202 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 202 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 203 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 203 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 204 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 204 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 205 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 205 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv84_devinit_oclass; |
| 206 | device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass; | 206 | device->oclass[NVDEV_SUBDEV_MC ] = nv94_mc_oclass; |
| 207 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 207 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 208 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 208 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -230,7 +230,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 230 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 230 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 231 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 231 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 232 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 232 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 233 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 233 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv98_devinit_oclass; |
| 234 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; | 234 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; |
| 235 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 235 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 236 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 236 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -258,7 +258,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 258 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; | 258 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nv84_clock_oclass; |
| 259 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 259 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 260 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 260 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 261 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 261 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv84_devinit_oclass; |
| 262 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; | 262 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; |
| 263 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 263 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 264 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 264 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -286,7 +286,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 286 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nvaa_clock_oclass; | 286 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nvaa_clock_oclass; |
| 287 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 287 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 288 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 288 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 289 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 289 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv98_devinit_oclass; |
| 290 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; | 290 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; |
| 291 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 291 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 292 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 292 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -314,7 +314,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 314 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nvaa_clock_oclass; | 314 | device->oclass[NVDEV_SUBDEV_CLOCK ] = nvaa_clock_oclass; |
| 315 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; | 315 | device->oclass[NVDEV_SUBDEV_THERM ] = &nv84_therm_oclass; |
| 316 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 316 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 317 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass; | 317 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nv98_devinit_oclass; |
| 318 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; | 318 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; |
| 319 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 319 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 320 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 320 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
| @@ -430,7 +430,7 @@ nv50_identify(struct nouveau_device *device) | |||
| 430 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nva3_clock_oclass; | 430 | device->oclass[NVDEV_SUBDEV_CLOCK ] = &nva3_clock_oclass; |
| 431 | device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass; | 431 | device->oclass[NVDEV_SUBDEV_THERM ] = &nva3_therm_oclass; |
| 432 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; | 432 | device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; |
| 433 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nva3_devinit_oclass; | 433 | device->oclass[NVDEV_SUBDEV_DEVINIT] = nvaf_devinit_oclass; |
| 434 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; | 434 | device->oclass[NVDEV_SUBDEV_MC ] = nv98_mc_oclass; |
| 435 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; | 435 | device->oclass[NVDEV_SUBDEV_BUS ] = nv94_bus_oclass; |
| 436 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; | 436 | device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c index 378a015091d2..d52c0f50a1a9 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | |||
| @@ -967,9 +967,6 @@ nvd0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 967 | int heads = nv_rd32(parent, 0x022448); | 967 | int heads = nv_rd32(parent, 0x022448); |
| 968 | int ret; | 968 | int ret; |
| 969 | 969 | ||
| 970 | if (nv_rd32(parent, 0x022500) & 0x00000001) | ||
| 971 | return -ENODEV; | ||
| 972 | |||
| 973 | ret = nouveau_disp_create(parent, engine, oclass, heads, | 970 | ret = nouveau_disp_create(parent, engine, oclass, heads, |
| 974 | "PDISP", "display", &priv); | 971 | "PDISP", "display", &priv); |
| 975 | *pobject = nv_object(priv); | 972 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c index fb1fe6ae5e74..20725b363d58 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nve0.c | |||
| @@ -54,9 +54,6 @@ nve0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 54 | int heads = nv_rd32(parent, 0x022448); | 54 | int heads = nv_rd32(parent, 0x022448); |
| 55 | int ret; | 55 | int ret; |
| 56 | 56 | ||
| 57 | if (nv_rd32(parent, 0x022500) & 0x00000001) | ||
| 58 | return -ENODEV; | ||
| 59 | |||
| 60 | ret = nouveau_disp_create(parent, engine, oclass, heads, | 57 | ret = nouveau_disp_create(parent, engine, oclass, heads, |
| 61 | "PDISP", "display", &priv); | 58 | "PDISP", "display", &priv); |
| 62 | *pobject = nv_object(priv); | 59 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c index 42aa6b97dbea..a488c36e40f9 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvf0.c | |||
| @@ -54,9 +54,6 @@ nvf0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
| 54 | int heads = nv_rd32(parent, 0x022448); | 54 | int heads = nv_rd32(parent, 0x022448); |
| 55 | int ret; | 55 | int ret; |
| 56 | 56 | ||
| 57 | if (nv_rd32(parent, 0x022500) & 0x00000001) | ||
| 58 | return -ENODEV; | ||
| 59 | |||
| 60 | ret = nouveau_disp_create(parent, engine, oclass, heads, | 57 | ret = nouveau_disp_create(parent, engine, oclass, heads, |
| 61 | "PDISP", "display", &priv); | 58 | "PDISP", "display", &priv); |
| 62 | *pobject = nv_object(priv); | 59 | *pobject = nv_object(priv); |
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h b/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h index e59384d04870..ed1ac68c38b3 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h | |||
| @@ -23,7 +23,10 @@ extern struct nouveau_oclass *nv10_devinit_oclass; | |||
| 23 | extern struct nouveau_oclass *nv1a_devinit_oclass; | 23 | extern struct nouveau_oclass *nv1a_devinit_oclass; |
| 24 | extern struct nouveau_oclass *nv20_devinit_oclass; | 24 | extern struct nouveau_oclass *nv20_devinit_oclass; |
| 25 | extern struct nouveau_oclass *nv50_devinit_oclass; | 25 | extern struct nouveau_oclass *nv50_devinit_oclass; |
| 26 | extern struct nouveau_oclass *nv84_devinit_oclass; | ||
| 27 | extern struct nouveau_oclass *nv98_devinit_oclass; | ||
| 26 | extern struct nouveau_oclass *nva3_devinit_oclass; | 28 | extern struct nouveau_oclass *nva3_devinit_oclass; |
| 29 | extern struct nouveau_oclass *nvaf_devinit_oclass; | ||
| 27 | extern struct nouveau_oclass *nvc0_devinit_oclass; | 30 | extern struct nouveau_oclass *nvc0_devinit_oclass; |
| 28 | 31 | ||
| 29 | #endif | 32 | #endif |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/base.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/base.c index 6013c42503d1..6b23d9a0b953 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/base.c | |||
| @@ -44,12 +44,21 @@ _nouveau_devinit_fini(struct nouveau_object *object, bool suspend) | |||
| 44 | int | 44 | int |
| 45 | _nouveau_devinit_init(struct nouveau_object *object) | 45 | _nouveau_devinit_init(struct nouveau_object *object) |
| 46 | { | 46 | { |
| 47 | struct nouveau_devinit_impl *impl = (void *)object->oclass; | ||
| 47 | struct nouveau_devinit *devinit = (void *)object; | 48 | struct nouveau_devinit *devinit = (void *)object; |
| 48 | int ret = nouveau_subdev_init(&devinit->base); | 49 | int ret; |
| 50 | |||
| 51 | ret = nouveau_subdev_init(&devinit->base); | ||
| 52 | if (ret) | ||
| 53 | return ret; | ||
| 54 | |||
| 55 | ret = nvbios_init(&devinit->base, devinit->post); | ||
| 49 | if (ret) | 56 | if (ret) |
| 50 | return ret; | 57 | return ret; |
| 51 | 58 | ||
| 52 | return nvbios_init(&devinit->base, devinit->post); | 59 | if (impl->disable) |
| 60 | nv_device(devinit)->disable_mask |= impl->disable(devinit); | ||
| 61 | return 0; | ||
| 53 | } | 62 | } |
| 54 | 63 | ||
| 55 | int | 64 | int |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c index f81509eb6c3e..b46c62a1d5d8 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.c | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | #include "nv50.h" | 31 | #include "nv50.h" |
| 32 | 32 | ||
| 33 | static int | 33 | int |
| 34 | nv50_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) | 34 | nv50_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) |
| 35 | { | 35 | { |
| 36 | struct nv50_devinit_priv *priv = (void *)devinit; | 36 | struct nv50_devinit_priv *priv = (void *)devinit; |
| @@ -74,6 +74,19 @@ nv50_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) | |||
| 74 | return 0; | 74 | return 0; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static u64 | ||
| 78 | nv50_devinit_disable(struct nouveau_devinit *devinit) | ||
| 79 | { | ||
| 80 | struct nv50_devinit_priv *priv = (void *)devinit; | ||
| 81 | u32 r001540 = nv_rd32(priv, 0x001540); | ||
| 82 | u64 disable = 0ULL; | ||
| 83 | |||
| 84 | if (!(r001540 & 0x40000000)) | ||
| 85 | disable |= (1ULL << NVDEV_ENGINE_MPEG); | ||
| 86 | |||
| 87 | return disable; | ||
| 88 | } | ||
| 89 | |||
| 77 | int | 90 | int |
| 78 | nv50_devinit_init(struct nouveau_object *object) | 91 | nv50_devinit_init(struct nouveau_object *object) |
| 79 | { | 92 | { |
| @@ -146,4 +159,5 @@ nv50_devinit_oclass = &(struct nouveau_devinit_impl) { | |||
| 146 | .fini = _nouveau_devinit_fini, | 159 | .fini = _nouveau_devinit_fini, |
| 147 | }, | 160 | }, |
| 148 | .pll_set = nv50_devinit_pll_set, | 161 | .pll_set = nv50_devinit_pll_set, |
| 162 | .disable = nv50_devinit_disable, | ||
| 149 | }.base; | 163 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.h b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.h index f87e483b0977..141c27e9f182 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.h +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv50.h | |||
| @@ -11,5 +11,8 @@ int nv50_devinit_ctor(struct nouveau_object *, struct nouveau_object *, | |||
| 11 | struct nouveau_oclass *, void *, u32, | 11 | struct nouveau_oclass *, void *, u32, |
| 12 | struct nouveau_object **); | 12 | struct nouveau_object **); |
| 13 | int nv50_devinit_init(struct nouveau_object *); | 13 | int nv50_devinit_init(struct nouveau_object *); |
| 14 | int nv50_devinit_pll_set(struct nouveau_devinit *, u32, u32); | ||
| 15 | |||
| 16 | int nva3_devinit_pll_set(struct nouveau_devinit *, u32, u32); | ||
| 14 | 17 | ||
| 15 | #endif | 18 | #endif |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv84.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv84.c new file mode 100644 index 000000000000..787422505d87 --- /dev/null +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv84.c | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 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 "nv50.h" | ||
| 26 | |||
| 27 | static u64 | ||
| 28 | nv84_devinit_disable(struct nouveau_devinit *devinit) | ||
| 29 | { | ||
| 30 | struct nv50_devinit_priv *priv = (void *)devinit; | ||
| 31 | u32 r001540 = nv_rd32(priv, 0x001540); | ||
| 32 | u32 r00154c = nv_rd32(priv, 0x00154c); | ||
| 33 | u64 disable = 0ULL; | ||
| 34 | |||
| 35 | if (!(r001540 & 0x40000000)) { | ||
| 36 | disable |= (1ULL << NVDEV_ENGINE_MPEG); | ||
| 37 | disable |= (1ULL << NVDEV_ENGINE_VP); | ||
| 38 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 39 | disable |= (1ULL << NVDEV_ENGINE_CRYPT); | ||
| 40 | } | ||
| 41 | |||
| 42 | if (!(r00154c & 0x00000004)) | ||
| 43 | disable |= (1ULL << NVDEV_ENGINE_DISP); | ||
| 44 | if (!(r00154c & 0x00000020)) | ||
| 45 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 46 | if (!(r00154c & 0x00000040)) | ||
| 47 | disable |= (1ULL << NVDEV_ENGINE_CRYPT); | ||
| 48 | |||
| 49 | return disable; | ||
| 50 | } | ||
| 51 | |||
| 52 | struct nouveau_oclass * | ||
| 53 | nv84_devinit_oclass = &(struct nouveau_devinit_impl) { | ||
| 54 | .base.handle = NV_SUBDEV(DEVINIT, 0x84), | ||
| 55 | .base.ofuncs = &(struct nouveau_ofuncs) { | ||
| 56 | .ctor = nv50_devinit_ctor, | ||
| 57 | .dtor = _nouveau_devinit_dtor, | ||
| 58 | .init = nv50_devinit_init, | ||
| 59 | .fini = _nouveau_devinit_fini, | ||
| 60 | }, | ||
| 61 | .pll_set = nv50_devinit_pll_set, | ||
| 62 | .disable = nv84_devinit_disable, | ||
| 63 | }.base; | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nv98.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv98.c new file mode 100644 index 000000000000..2b0e963fc6f0 --- /dev/null +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nv98.c | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 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 "nv50.h" | ||
| 26 | |||
| 27 | static u64 | ||
| 28 | nv98_devinit_disable(struct nouveau_devinit *devinit) | ||
| 29 | { | ||
| 30 | struct nv50_devinit_priv *priv = (void *)devinit; | ||
| 31 | u32 r001540 = nv_rd32(priv, 0x001540); | ||
| 32 | u32 r00154c = nv_rd32(priv, 0x00154c); | ||
| 33 | u64 disable = 0ULL; | ||
| 34 | |||
| 35 | if (!(r001540 & 0x40000000)) { | ||
| 36 | disable |= (1ULL << NVDEV_ENGINE_VP); | ||
| 37 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 38 | disable |= (1ULL << NVDEV_ENGINE_PPP); | ||
| 39 | } | ||
| 40 | |||
| 41 | if (!(r00154c & 0x00000004)) | ||
| 42 | disable |= (1ULL << NVDEV_ENGINE_DISP); | ||
| 43 | if (!(r00154c & 0x00000020)) | ||
| 44 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 45 | if (!(r00154c & 0x00000040)) | ||
| 46 | disable |= (1ULL << NVDEV_ENGINE_CRYPT); | ||
| 47 | |||
| 48 | return disable; | ||
| 49 | } | ||
| 50 | |||
| 51 | struct nouveau_oclass * | ||
| 52 | nv98_devinit_oclass = &(struct nouveau_devinit_impl) { | ||
| 53 | .base.handle = NV_SUBDEV(DEVINIT, 0x98), | ||
| 54 | .base.ofuncs = &(struct nouveau_ofuncs) { | ||
| 55 | .ctor = nv50_devinit_ctor, | ||
| 56 | .dtor = _nouveau_devinit_dtor, | ||
| 57 | .init = nv50_devinit_init, | ||
| 58 | .fini = _nouveau_devinit_fini, | ||
| 59 | }, | ||
| 60 | .pll_set = nv50_devinit_pll_set, | ||
| 61 | .disable = nv98_devinit_disable, | ||
| 62 | }.base; | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nva3.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nva3.c index 67f55940b00e..6dedf1dad7f7 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nva3.c +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nva3.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include "nv50.h" | 25 | #include "nv50.h" |
| 26 | 26 | ||
| 27 | static int | 27 | int |
| 28 | nva3_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) | 28 | nva3_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) |
| 29 | { | 29 | { |
| 30 | struct nv50_devinit_priv *priv = (void *)devinit; | 30 | struct nv50_devinit_priv *priv = (void *)devinit; |
| @@ -58,6 +58,29 @@ nva3_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) | |||
| 58 | return ret; | 58 | return ret; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | static u64 | ||
| 62 | nva3_devinit_disable(struct nouveau_devinit *devinit) | ||
| 63 | { | ||
| 64 | struct nv50_devinit_priv *priv = (void *)devinit; | ||
| 65 | u32 r001540 = nv_rd32(priv, 0x001540); | ||
| 66 | u32 r00154c = nv_rd32(priv, 0x00154c); | ||
| 67 | u64 disable = 0ULL; | ||
| 68 | |||
| 69 | if (!(r001540 & 0x40000000)) { | ||
| 70 | disable |= (1ULL << NVDEV_ENGINE_VP); | ||
| 71 | disable |= (1ULL << NVDEV_ENGINE_PPP); | ||
| 72 | } | ||
| 73 | |||
| 74 | if (!(r00154c & 0x00000004)) | ||
| 75 | disable |= (1ULL << NVDEV_ENGINE_DISP); | ||
| 76 | if (!(r00154c & 0x00000020)) | ||
| 77 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 78 | if (!(r00154c & 0x00000200)) | ||
| 79 | disable |= (1ULL << NVDEV_ENGINE_COPY0); | ||
| 80 | |||
| 81 | return disable; | ||
| 82 | } | ||
| 83 | |||
| 61 | struct nouveau_oclass * | 84 | struct nouveau_oclass * |
| 62 | nva3_devinit_oclass = &(struct nouveau_devinit_impl) { | 85 | nva3_devinit_oclass = &(struct nouveau_devinit_impl) { |
| 63 | .base.handle = NV_SUBDEV(DEVINIT, 0xa3), | 86 | .base.handle = NV_SUBDEV(DEVINIT, 0xa3), |
| @@ -68,4 +91,5 @@ nva3_devinit_oclass = &(struct nouveau_devinit_impl) { | |||
| 68 | .fini = _nouveau_devinit_fini, | 91 | .fini = _nouveau_devinit_fini, |
| 69 | }, | 92 | }, |
| 70 | .pll_set = nva3_devinit_pll_set, | 93 | .pll_set = nva3_devinit_pll_set, |
| 94 | .disable = nva3_devinit_disable, | ||
| 71 | }.base; | 95 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nvaf.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nvaf.c new file mode 100644 index 000000000000..4fc68d27eff3 --- /dev/null +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nvaf.c | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 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 "nv50.h" | ||
| 26 | |||
| 27 | static u64 | ||
| 28 | nvaf_devinit_disable(struct nouveau_devinit *devinit) | ||
| 29 | { | ||
| 30 | struct nv50_devinit_priv *priv = (void *)devinit; | ||
| 31 | u32 r001540 = nv_rd32(priv, 0x001540); | ||
| 32 | u32 r00154c = nv_rd32(priv, 0x00154c); | ||
| 33 | u64 disable = 0; | ||
| 34 | |||
| 35 | if (!(r001540 & 0x40000000)) { | ||
| 36 | disable |= (1ULL << NVDEV_ENGINE_VP); | ||
| 37 | disable |= (1ULL << NVDEV_ENGINE_PPP); | ||
| 38 | } | ||
| 39 | |||
| 40 | if (!(r00154c & 0x00000004)) | ||
| 41 | disable |= (1ULL << NVDEV_ENGINE_DISP); | ||
| 42 | if (!(r00154c & 0x00000020)) | ||
| 43 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 44 | if (!(r00154c & 0x00000040)) | ||
| 45 | disable |= (1ULL << NVDEV_ENGINE_VIC); | ||
| 46 | if (!(r00154c & 0x00000200)) | ||
| 47 | disable |= (1ULL << NVDEV_ENGINE_COPY0); | ||
| 48 | |||
| 49 | return disable; | ||
| 50 | } | ||
| 51 | |||
| 52 | struct nouveau_oclass * | ||
| 53 | nvaf_devinit_oclass = &(struct nouveau_devinit_impl) { | ||
| 54 | .base.handle = NV_SUBDEV(DEVINIT, 0xaf), | ||
| 55 | .base.ofuncs = &(struct nouveau_ofuncs) { | ||
| 56 | .ctor = nv50_devinit_ctor, | ||
| 57 | .dtor = _nouveau_devinit_dtor, | ||
| 58 | .init = nv50_devinit_init, | ||
| 59 | .fini = _nouveau_devinit_fini, | ||
| 60 | }, | ||
| 61 | .pll_set = nva3_devinit_pll_set, | ||
| 62 | .disable = nvaf_devinit_disable, | ||
| 63 | }.base; | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c index ced0e8241b34..fa7e63766b1b 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/nvc0.c | |||
| @@ -59,6 +59,33 @@ nvc0_devinit_pll_set(struct nouveau_devinit *devinit, u32 type, u32 freq) | |||
| 59 | return ret; | 59 | return ret; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | static u64 | ||
| 63 | nvc0_devinit_disable(struct nouveau_devinit *devinit) | ||
| 64 | { | ||
| 65 | struct nv50_devinit_priv *priv = (void *)devinit; | ||
| 66 | u32 r022500 = nv_rd32(priv, 0x022500); | ||
| 67 | u64 disable = 0ULL; | ||
| 68 | |||
| 69 | if (r022500 & 0x00000001) | ||
| 70 | disable |= (1ULL << NVDEV_ENGINE_DISP); | ||
| 71 | |||
| 72 | if (r022500 & 0x00000002) { | ||
| 73 | disable |= (1ULL << NVDEV_ENGINE_VP); | ||
| 74 | disable |= (1ULL << NVDEV_ENGINE_PPP); | ||
| 75 | } | ||
| 76 | |||
| 77 | if (r022500 & 0x00000004) | ||
| 78 | disable |= (1ULL << NVDEV_ENGINE_BSP); | ||
| 79 | if (r022500 & 0x00000008) | ||
| 80 | disable |= (1ULL << NVDEV_ENGINE_VENC); | ||
| 81 | if (r022500 & 0x00000100) | ||
| 82 | disable |= (1ULL << NVDEV_ENGINE_COPY0); | ||
| 83 | if (r022500 & 0x00000200) | ||
| 84 | disable |= (1ULL << NVDEV_ENGINE_COPY1); | ||
| 85 | |||
| 86 | return disable; | ||
| 87 | } | ||
| 88 | |||
| 62 | static int | 89 | static int |
| 63 | nvc0_devinit_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | 90 | nvc0_devinit_ctor(struct nouveau_object *parent, struct nouveau_object *engine, |
| 64 | struct nouveau_oclass *oclass, void *data, u32 size, | 91 | struct nouveau_oclass *oclass, void *data, u32 size, |
| @@ -87,4 +114,5 @@ nvc0_devinit_oclass = &(struct nouveau_devinit_impl) { | |||
| 87 | .fini = _nouveau_devinit_fini, | 114 | .fini = _nouveau_devinit_fini, |
| 88 | }, | 115 | }, |
| 89 | .pll_set = nvc0_devinit_pll_set, | 116 | .pll_set = nvc0_devinit_pll_set, |
| 117 | .disable = nvc0_devinit_disable, | ||
| 90 | }.base; | 118 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/devinit/priv.h b/drivers/gpu/drm/nouveau/core/subdev/devinit/priv.h index ae8de97ecf16..c4179b6d6eca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/devinit/priv.h +++ b/drivers/gpu/drm/nouveau/core/subdev/devinit/priv.h | |||
| @@ -10,6 +10,7 @@ struct nouveau_devinit_impl { | |||
| 10 | struct nouveau_oclass base; | 10 | struct nouveau_oclass base; |
| 11 | void (*meminit)(struct nouveau_devinit *); | 11 | void (*meminit)(struct nouveau_devinit *); |
| 12 | int (*pll_set)(struct nouveau_devinit *, u32 type, u32 freq); | 12 | int (*pll_set)(struct nouveau_devinit *, u32 type, u32 freq); |
| 13 | u64 (*disable)(struct nouveau_devinit *); | ||
| 13 | }; | 14 | }; |
| 14 | 15 | ||
| 15 | #define nouveau_devinit_create(p,e,o,d) \ | 16 | #define nouveau_devinit_create(p,e,o,d) \ |
