aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-09-07 21:09:50 -0400
committerDave Airlie <airlied@redhat.com>2009-09-07 21:15:59 -0400
commita0cdc6495bdd0ea12390b9edaf13c8cb653df109 (patch)
treec9f77662adab2cb11b0b5bd801827e00eeeb7856 /drivers/gpu/drm/radeon/radeon_drv.c
parent6fcefd56f5060ca99ab03c9f2ad1f17c3a543ca1 (diff)
drm/kms/radeon: make kms default a runtime option
This makes the kms/enable disable a runtime not a build time option. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_drv.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 133e975dbf0c..29f040a7861b 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -38,7 +38,6 @@
38#include <linux/console.h> 38#include <linux/console.h>
39 39
40 40
41#if defined(CONFIG_DRM_RADEON_KMS)
42/* 41/*
43 * KMS wrapper. 42 * KMS wrapper.
44 */ 43 */
@@ -77,11 +76,9 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma);
77int radeon_debugfs_init(struct drm_minor *minor); 76int radeon_debugfs_init(struct drm_minor *minor);
78void radeon_debugfs_cleanup(struct drm_minor *minor); 77void radeon_debugfs_cleanup(struct drm_minor *minor);
79#endif 78#endif
80#endif
81 79
82 80
83int radeon_no_wb; 81int radeon_no_wb;
84#if defined(CONFIG_DRM_RADEON_KMS)
85int radeon_modeset = -1; 82int radeon_modeset = -1;
86int radeon_dynclks = -1; 83int radeon_dynclks = -1;
87int radeon_r4xx_atom = 0; 84int radeon_r4xx_atom = 0;
@@ -92,12 +89,10 @@ int radeon_benchmarking = 0;
92int radeon_testing = 0; 89int radeon_testing = 0;
93int radeon_connector_table = 0; 90int radeon_connector_table = 0;
94int radeon_tv = 1; 91int radeon_tv = 1;
95#endif
96 92
97MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); 93MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
98module_param_named(no_wb, radeon_no_wb, int, 0444); 94module_param_named(no_wb, radeon_no_wb, int, 0444);
99 95
100#if defined(CONFIG_DRM_RADEON_KMS)
101MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); 96MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
102module_param_named(modeset, radeon_modeset, int, 0400); 97module_param_named(modeset, radeon_modeset, int, 0400);
103 98
@@ -127,7 +122,6 @@ module_param_named(connector_table, radeon_connector_table, int, 0444);
127 122
128MODULE_PARM_DESC(tv, "TV enable (0 = disable)"); 123MODULE_PARM_DESC(tv, "TV enable (0 = disable)");
129module_param_named(tv, radeon_tv, int, 0444); 124module_param_named(tv, radeon_tv, int, 0444);
130#endif
131 125
132static int radeon_suspend(struct drm_device *dev, pm_message_t state) 126static int radeon_suspend(struct drm_device *dev, pm_message_t state)
133{ 127{
@@ -219,7 +213,6 @@ static struct drm_driver driver_old = {
219 .patchlevel = DRIVER_PATCHLEVEL, 213 .patchlevel = DRIVER_PATCHLEVEL,
220}; 214};
221 215
222#if defined(CONFIG_DRM_RADEON_KMS)
223static struct drm_driver kms_driver; 216static struct drm_driver kms_driver;
224 217
225static int __devinit 218static int __devinit
@@ -313,7 +306,6 @@ static struct drm_driver kms_driver = {
313 .minor = KMS_DRIVER_MINOR, 306 .minor = KMS_DRIVER_MINOR,
314 .patchlevel = KMS_DRIVER_PATCHLEVEL, 307 .patchlevel = KMS_DRIVER_PATCHLEVEL,
315}; 308};
316#endif
317 309
318static struct drm_driver *driver; 310static struct drm_driver *driver;
319 311
@@ -321,7 +313,6 @@ static int __init radeon_init(void)
321{ 313{
322 driver = &driver_old; 314 driver = &driver_old;
323 driver->num_ioctls = radeon_max_ioctl; 315 driver->num_ioctls = radeon_max_ioctl;
324#if defined(CONFIG_DRM_RADEON_KMS)
325#ifdef CONFIG_VGA_CONSOLE 316#ifdef CONFIG_VGA_CONSOLE
326 if (vgacon_text_force() && radeon_modeset == -1) { 317 if (vgacon_text_force() && radeon_modeset == -1) {
327 DRM_INFO("VGACON disable radeon kernel modesetting.\n"); 318 DRM_INFO("VGACON disable radeon kernel modesetting.\n");
@@ -332,8 +323,13 @@ static int __init radeon_init(void)
332#endif 323#endif
333 /* if enabled by default */ 324 /* if enabled by default */
334 if (radeon_modeset == -1) { 325 if (radeon_modeset == -1) {
335 DRM_INFO("radeon default to kernel modesetting.\n"); 326#ifdef CONFIG_DRM_RADEON_KMS
327 DRM_INFO("radeon defaulting to kernel modesetting.\n");
336 radeon_modeset = 1; 328 radeon_modeset = 1;
329#else
330 DRM_INFO("radeon defaulting to userspace modesetting.\n");
331 radeon_modeset = 0;
332#endif
337 } 333 }
338 if (radeon_modeset == 1) { 334 if (radeon_modeset == 1) {
339 DRM_INFO("radeon kernel modesetting enabled.\n"); 335 DRM_INFO("radeon kernel modesetting enabled.\n");
@@ -343,7 +339,6 @@ static int __init radeon_init(void)
343 } 339 }
344 /* if the vga console setting is enabled still 340 /* if the vga console setting is enabled still
345 * let modprobe override it */ 341 * let modprobe override it */
346#endif
347 return drm_init(driver); 342 return drm_init(driver);
348} 343}
349 344