Commit a0cdc649 authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
parent 6fcefd56
...@@ -56,8 +56,9 @@ config DRM_RADEON ...@@ -56,8 +56,9 @@ config DRM_RADEON
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
select FRAMEBUFFER_CONSOLE if !EMBEDDED
select FW_LOADER select FW_LOADER
select DRM_KMS_HELPER
select DRM_TTM
help help
Choose this option if you have an ATI Radeon graphics card. There Choose this option if you have an ATI Radeon graphics card. There
are both PCI and AGP versions. You don't need to choose this to are both PCI and AGP versions. You don't need to choose this to
......
config DRM_RADEON_KMS config DRM_RADEON_KMS
bool "Enable modesetting on radeon by default" bool "Enable modesetting on radeon by default"
depends on DRM_RADEON depends on DRM_RADEON
select DRM_KMS_HELPER
select DRM_TTM
help help
Choose this option if you want kernel modesetting enabled by default, Choose this option if you want kernel modesetting enabled by default,
and you have a new enough userspace to support this. Running old and you have a new enough userspace to support this. Running old
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
ccflags-y := -Iinclude/drm ccflags-y := -Iinclude/drm
radeon-y := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o \
radeon_irq.o r300_cmdbuf.o r600_cp.o
hostprogs-y := mkregtable hostprogs-y := mkregtable
...@@ -39,7 +37,10 @@ $(obj)/r300.o: $(obj)/r300_reg_safe.h ...@@ -39,7 +37,10 @@ $(obj)/r300.o: $(obj)/r300_reg_safe.h
$(obj)/rs600.o: $(obj)/rs600_reg_safe.h $(obj)/rs600.o: $(obj)/rs600_reg_safe.h
radeon-$(CONFIG_DRM_RADEON_KMS) += radeon_device.o radeon_kms.o \ radeon-y := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o \
radeon_irq.o r300_cmdbuf.o r600_cp.o
# add KMS driver
radeon-y += radeon_device.o radeon_kms.o \
radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \ radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \
atom.o radeon_fence.o radeon_ttm.o radeon_object.o radeon_gart.o \ atom.o radeon_fence.o radeon_ttm.o radeon_object.o radeon_gart.o \
radeon_legacy_crtc.o radeon_legacy_encoders.o radeon_connectors.o \ radeon_legacy_crtc.o radeon_legacy_encoders.o radeon_connectors.o \
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <linux/console.h> #include <linux/console.h>
#if defined(CONFIG_DRM_RADEON_KMS)
/* /*
* KMS wrapper. * KMS wrapper.
*/ */
...@@ -77,11 +76,9 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma); ...@@ -77,11 +76,9 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma);
int radeon_debugfs_init(struct drm_minor *minor); int radeon_debugfs_init(struct drm_minor *minor);
void radeon_debugfs_cleanup(struct drm_minor *minor); void radeon_debugfs_cleanup(struct drm_minor *minor);
#endif #endif
#endif
int radeon_no_wb; int radeon_no_wb;
#if defined(CONFIG_DRM_RADEON_KMS)
int radeon_modeset = -1; int radeon_modeset = -1;
int radeon_dynclks = -1; int radeon_dynclks = -1;
int radeon_r4xx_atom = 0; int radeon_r4xx_atom = 0;
...@@ -92,12 +89,10 @@ int radeon_benchmarking = 0; ...@@ -92,12 +89,10 @@ int radeon_benchmarking = 0;
int radeon_testing = 0; int radeon_testing = 0;
int radeon_connector_table = 0; int radeon_connector_table = 0;
int radeon_tv = 1; int radeon_tv = 1;
#endif
MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
module_param_named(no_wb, radeon_no_wb, int, 0444); module_param_named(no_wb, radeon_no_wb, int, 0444);
#if defined(CONFIG_DRM_RADEON_KMS)
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
module_param_named(modeset, radeon_modeset, int, 0400); module_param_named(modeset, radeon_modeset, int, 0400);
...@@ -127,7 +122,6 @@ module_param_named(connector_table, radeon_connector_table, int, 0444); ...@@ -127,7 +122,6 @@ module_param_named(connector_table, radeon_connector_table, int, 0444);
MODULE_PARM_DESC(tv, "TV enable (0 = disable)"); MODULE_PARM_DESC(tv, "TV enable (0 = disable)");
module_param_named(tv, radeon_tv, int, 0444); module_param_named(tv, radeon_tv, int, 0444);
#endif
static int radeon_suspend(struct drm_device *dev, pm_message_t state) static int radeon_suspend(struct drm_device *dev, pm_message_t state)
{ {
...@@ -219,7 +213,6 @@ static struct drm_driver driver_old = { ...@@ -219,7 +213,6 @@ static struct drm_driver driver_old = {
.patchlevel = DRIVER_PATCHLEVEL, .patchlevel = DRIVER_PATCHLEVEL,
}; };
#if defined(CONFIG_DRM_RADEON_KMS)
static struct drm_driver kms_driver; static struct drm_driver kms_driver;
static int __devinit static int __devinit
...@@ -313,7 +306,6 @@ static struct drm_driver kms_driver = { ...@@ -313,7 +306,6 @@ static struct drm_driver kms_driver = {
.minor = KMS_DRIVER_MINOR, .minor = KMS_DRIVER_MINOR,
.patchlevel = KMS_DRIVER_PATCHLEVEL, .patchlevel = KMS_DRIVER_PATCHLEVEL,
}; };
#endif
static struct drm_driver *driver; static struct drm_driver *driver;
...@@ -321,7 +313,6 @@ static int __init radeon_init(void) ...@@ -321,7 +313,6 @@ static int __init radeon_init(void)
{ {
driver = &driver_old; driver = &driver_old;
driver->num_ioctls = radeon_max_ioctl; driver->num_ioctls = radeon_max_ioctl;
#if defined(CONFIG_DRM_RADEON_KMS)
#ifdef CONFIG_VGA_CONSOLE #ifdef CONFIG_VGA_CONSOLE
if (vgacon_text_force() && radeon_modeset == -1) { if (vgacon_text_force() && radeon_modeset == -1) {
DRM_INFO("VGACON disable radeon kernel modesetting.\n"); DRM_INFO("VGACON disable radeon kernel modesetting.\n");
...@@ -332,8 +323,13 @@ static int __init radeon_init(void) ...@@ -332,8 +323,13 @@ static int __init radeon_init(void)
#endif #endif
/* if enabled by default */ /* if enabled by default */
if (radeon_modeset == -1) { if (radeon_modeset == -1) {
DRM_INFO("radeon default to kernel modesetting.\n"); #ifdef CONFIG_DRM_RADEON_KMS
DRM_INFO("radeon defaulting to kernel modesetting.\n");
radeon_modeset = 1; radeon_modeset = 1;
#else
DRM_INFO("radeon defaulting to userspace modesetting.\n");
radeon_modeset = 0;
#endif
} }
if (radeon_modeset == 1) { if (radeon_modeset == 1) {
DRM_INFO("radeon kernel modesetting enabled.\n"); DRM_INFO("radeon kernel modesetting enabled.\n");
...@@ -343,7 +339,6 @@ static int __init radeon_init(void) ...@@ -343,7 +339,6 @@ static int __init radeon_init(void)
} }
/* if the vga console setting is enabled still /* if the vga console setting is enabled still
* let modprobe override it */ * let modprobe override it */
#endif
return drm_init(driver); return drm_init(driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment