aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/gpu/drm/Kconfig3
-rw-r--r--drivers/gpu/drm/radeon/Kconfig2
-rw-r--r--drivers/gpu/drm/radeon/Makefile7
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c17
4 files changed, 12 insertions, 17 deletions
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index d42cf54f7804..e4d971c8b9d0 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -56,8 +56,9 @@ config DRM_RADEON
56 select FB_CFB_FILLRECT 56 select FB_CFB_FILLRECT
57 select FB_CFB_COPYAREA 57 select FB_CFB_COPYAREA
58 select FB_CFB_IMAGEBLIT 58 select FB_CFB_IMAGEBLIT
59 select FRAMEBUFFER_CONSOLE if !EMBEDDED
60 select FW_LOADER 59 select FW_LOADER
60 select DRM_KMS_HELPER
61 select DRM_TTM
61 help 62 help
62 Choose this option if you have an ATI Radeon graphics card. There 63 Choose this option if you have an ATI Radeon graphics card. There
63 are both PCI and AGP versions. You don't need to choose this to 64 are both PCI and AGP versions. You don't need to choose this to
diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig
index 3cc89b271123..5982321be4d5 100644
--- a/drivers/gpu/drm/radeon/Kconfig
+++ b/drivers/gpu/drm/radeon/Kconfig
@@ -1,8 +1,6 @@
1config DRM_RADEON_KMS 1config DRM_RADEON_KMS
2 bool "Enable modesetting on radeon by default" 2 bool "Enable modesetting on radeon by default"
3 depends on DRM_RADEON 3 depends on DRM_RADEON
4 select DRM_KMS_HELPER
5 select DRM_TTM
6 help 4 help
7 Choose this option if you want kernel modesetting enabled by default, 5 Choose this option if you want kernel modesetting enabled by default,
8 and you have a new enough userspace to support this. Running old 6 and you have a new enough userspace to support this. Running old
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile
index 14c3fe692723..09a28923f46e 100644
--- a/drivers/gpu/drm/radeon/Makefile
+++ b/drivers/gpu/drm/radeon/Makefile
@@ -3,8 +3,6 @@
3# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. 3# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
4 4
5ccflags-y := -Iinclude/drm 5ccflags-y := -Iinclude/drm
6radeon-y := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o \
7 radeon_irq.o r300_cmdbuf.o r600_cp.o
8 6
9hostprogs-y := mkregtable 7hostprogs-y := mkregtable
10 8
@@ -39,7 +37,10 @@ $(obj)/r300.o: $(obj)/r300_reg_safe.h
39 37
40$(obj)/rs600.o: $(obj)/rs600_reg_safe.h 38$(obj)/rs600.o: $(obj)/rs600_reg_safe.h
41 39
42radeon-$(CONFIG_DRM_RADEON_KMS) += radeon_device.o radeon_kms.o \ 40radeon-y := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o \
41 radeon_irq.o r300_cmdbuf.o r600_cp.o
42# add KMS driver
43radeon-y += radeon_device.o radeon_kms.o \
43 radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \ 44 radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \
44 atom.o radeon_fence.o radeon_ttm.o radeon_object.o radeon_gart.o \ 45 atom.o radeon_fence.o radeon_ttm.o radeon_object.o radeon_gart.o \
45 radeon_legacy_crtc.o radeon_legacy_encoders.o radeon_connectors.o \ 46 radeon_legacy_crtc.o radeon_legacy_encoders.o radeon_connectors.o \
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