aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 250a5e88c751..cee1eaf64117 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -73,7 +73,9 @@ MODULE_PARM_DESC(runpm, "disable (0), force enable (1), optimus only default (-1
73int nouveau_runtime_pm = -1; 73int nouveau_runtime_pm = -1;
74module_param_named(runpm, nouveau_runtime_pm, int, 0400); 74module_param_named(runpm, nouveau_runtime_pm, int, 0400);
75 75
76static struct drm_driver driver; 76static struct drm_driver driver_stub;
77static struct drm_driver driver_pci;
78static struct drm_driver driver_platform;
77 79
78static u64 80static u64
79nouveau_pci_name(struct pci_dev *pdev) 81nouveau_pci_name(struct pci_dev *pdev)
@@ -322,7 +324,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
322 324
323 pci_set_master(pdev); 325 pci_set_master(pdev);
324 326
325 ret = drm_get_pci_dev(pdev, pent, &driver); 327 ret = drm_get_pci_dev(pdev, pent, &driver_pci);
326 if (ret) { 328 if (ret) {
327 nouveau_object_ref(NULL, (struct nouveau_object **)&device); 329 nouveau_object_ref(NULL, (struct nouveau_object **)&device);
328 return ret; 330 return ret;
@@ -855,7 +857,7 @@ nouveau_driver_fops = {
855}; 857};
856 858
857static struct drm_driver 859static struct drm_driver
858driver = { 860driver_stub = {
859 .driver_features = 861 .driver_features =
860 DRIVER_USE_AGP | 862 DRIVER_USE_AGP |
861 DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER, 863 DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER,
@@ -1061,7 +1063,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size,
1061 if (err) 1063 if (err)
1062 return ERR_PTR(err); 1064 return ERR_PTR(err);
1063 1065
1064 drm = drm_dev_alloc(&driver, &pdev->dev); 1066 drm = drm_dev_alloc(&driver_platform, &pdev->dev);
1065 if (!drm) { 1067 if (!drm) {
1066 err = -ENOMEM; 1068 err = -ENOMEM;
1067 goto err_free; 1069 goto err_free;
@@ -1086,6 +1088,11 @@ EXPORT_SYMBOL(nouveau_platform_device_create_);
1086static int __init 1088static int __init
1087nouveau_drm_init(void) 1089nouveau_drm_init(void)
1088{ 1090{
1091 driver_pci = driver_stub;
1092 driver_pci.set_busid = drm_pci_set_busid;
1093 driver_platform = driver_stub;
1094 driver_platform.set_busid = drm_platform_set_busid;
1095
1089 if (nouveau_modeset == -1) { 1096 if (nouveau_modeset == -1) {
1090#ifdef CONFIG_VGA_CONSOLE 1097#ifdef CONFIG_VGA_CONSOLE
1091 if (vgacon_text_force()) 1098 if (vgacon_text_force())
@@ -1097,7 +1104,7 @@ nouveau_drm_init(void)
1097 return 0; 1104 return 0;
1098 1105
1099 nouveau_register_dsm_handler(); 1106 nouveau_register_dsm_handler();
1100 return drm_pci_init(&driver, &nouveau_drm_pci_driver); 1107 return drm_pci_init(&driver_pci, &nouveau_drm_pci_driver);
1101} 1108}
1102 1109
1103static void __exit 1110static void __exit
@@ -1106,7 +1113,7 @@ nouveau_drm_exit(void)
1106 if (!nouveau_modeset) 1113 if (!nouveau_modeset)
1107 return; 1114 return;
1108 1115
1109 drm_pci_exit(&driver, &nouveau_drm_pci_driver); 1116 drm_pci_exit(&driver_pci, &nouveau_drm_pci_driver);
1110 nouveau_unregister_dsm_handler(); 1117 nouveau_unregister_dsm_handler();
1111} 1118}
1112 1119