aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index 0fd8e10dbbd..1de5eb53e01 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -35,10 +35,6 @@
35 35
36#include "drm_pciids.h" 36#include "drm_pciids.h"
37 37
38MODULE_PARM_DESC(ctxfw, "Use external firmware blob for grctx init (NV40)");
39int nouveau_ctxfw = 0;
40module_param_named(ctxfw, nouveau_ctxfw, int, 0400);
41
42MODULE_PARM_DESC(noagp, "Disable AGP"); 38MODULE_PARM_DESC(noagp, "Disable AGP");
43int nouveau_noagp; 39int nouveau_noagp;
44module_param_named(noagp, nouveau_noagp, int, 0400); 40module_param_named(noagp, nouveau_noagp, int, 0400);
@@ -56,7 +52,7 @@ int nouveau_vram_pushbuf;
56module_param_named(vram_pushbuf, nouveau_vram_pushbuf, int, 0400); 52module_param_named(vram_pushbuf, nouveau_vram_pushbuf, int, 0400);
57 53
58MODULE_PARM_DESC(vram_notify, "Force DMA notifiers to be in VRAM"); 54MODULE_PARM_DESC(vram_notify, "Force DMA notifiers to be in VRAM");
59int nouveau_vram_notify = 1; 55int nouveau_vram_notify = 0;
60module_param_named(vram_notify, nouveau_vram_notify, int, 0400); 56module_param_named(vram_notify, nouveau_vram_notify, int, 0400);
61 57
62MODULE_PARM_DESC(duallink, "Allow dual-link TMDS (>=GeForce 8)"); 58MODULE_PARM_DESC(duallink, "Allow dual-link TMDS (>=GeForce 8)");
@@ -155,9 +151,6 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state)
155 struct drm_crtc *crtc; 151 struct drm_crtc *crtc;
156 int ret, i; 152 int ret, i;
157 153
158 if (!drm_core_check_feature(dev, DRIVER_MODESET))
159 return -ENODEV;
160
161 if (pm_state.event == PM_EVENT_PRETHAW) 154 if (pm_state.event == PM_EVENT_PRETHAW)
162 return 0; 155 return 0;
163 156
@@ -257,9 +250,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
257 struct drm_crtc *crtc; 250 struct drm_crtc *crtc;
258 int ret, i; 251 int ret, i;
259 252
260 if (!drm_core_check_feature(dev, DRIVER_MODESET))
261 return -ENODEV;
262
263 nouveau_fbcon_save_disable_accel(dev); 253 nouveau_fbcon_save_disable_accel(dev);
264 254
265 NV_INFO(dev, "We're back, enabling device...\n"); 255 NV_INFO(dev, "We're back, enabling device...\n");
@@ -269,6 +259,13 @@ nouveau_pci_resume(struct pci_dev *pdev)
269 return -1; 259 return -1;
270 pci_set_master(dev->pdev); 260 pci_set_master(dev->pdev);
271 261
262 /* Make sure the AGP controller is in a consistent state */
263 if (dev_priv->gart_info.type == NOUVEAU_GART_AGP)
264 nouveau_mem_reset_agp(dev);
265
266 /* Make the CRTCs accessible */
267 engine->display.early_init(dev);
268
272 NV_INFO(dev, "POSTing device...\n"); 269 NV_INFO(dev, "POSTing device...\n");
273 ret = nouveau_run_vbios_init(dev); 270 ret = nouveau_run_vbios_init(dev);
274 if (ret) 271 if (ret)
@@ -323,7 +320,6 @@ nouveau_pci_resume(struct pci_dev *pdev)
323 320
324 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 321 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
325 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 322 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
326 int ret;
327 323
328 ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM); 324 ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM);
329 if (!ret) 325 if (!ret)
@@ -332,11 +328,7 @@ nouveau_pci_resume(struct pci_dev *pdev)
332 NV_ERROR(dev, "Could not pin/map cursor.\n"); 328 NV_ERROR(dev, "Could not pin/map cursor.\n");
333 } 329 }
334 330
335 if (dev_priv->card_type < NV_50) { 331 engine->display.init(dev);
336 nv04_display_restore(dev);
337 NVLockVgaCrtcs(dev, false);
338 } else
339 nv50_display_init(dev);
340 332
341 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 333 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
342 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 334 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
@@ -371,7 +363,8 @@ nouveau_pci_resume(struct pci_dev *pdev)
371static struct drm_driver driver = { 363static struct drm_driver driver = {
372 .driver_features = 364 .driver_features =
373 DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | 365 DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
374 DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM, 366 DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
367 DRIVER_MODESET,
375 .load = nouveau_load, 368 .load = nouveau_load,
376 .firstopen = nouveau_firstopen, 369 .firstopen = nouveau_firstopen,
377 .lastclose = nouveau_lastclose, 370 .lastclose = nouveau_lastclose,
@@ -438,16 +431,18 @@ static int __init nouveau_init(void)
438 nouveau_modeset = 1; 431 nouveau_modeset = 1;
439 } 432 }
440 433
441 if (nouveau_modeset == 1) { 434 if (!nouveau_modeset)
442 driver.driver_features |= DRIVER_MODESET; 435 return 0;
443 nouveau_register_dsm_handler();
444 }
445 436
437 nouveau_register_dsm_handler();
446 return drm_init(&driver); 438 return drm_init(&driver);
447} 439}
448 440
449static void __exit nouveau_exit(void) 441static void __exit nouveau_exit(void)
450{ 442{
443 if (!nouveau_modeset)
444 return;
445
451 drm_exit(&driver); 446 drm_exit(&driver);
452 nouveau_unregister_dsm_handler(); 447 nouveau_unregister_dsm_handler();
453} 448}