Index: SOURCES/drakx-kbd-mouse-x11-kmsstuff.patch
===================================================================
--- SOURCES/drakx-kbd-mouse-x11-kmsstuff.patch	(revision 0)
+++ SOURCES/drakx-kbd-mouse-x11-kmsstuff.patch	(revision 0)
@@ -0,0 +1,141 @@
+Index: drakx-kbd-mouse-x11-0.90/lib/Xconfig/main.pm
+===================================================================
+--- drakx-kbd-mouse-x11-0.90/lib/Xconfig/main.pm
++++ drakx-kbd-mouse-x11-0.90/lib/Xconfig/main.pm	2011-03-06 05:23:17.295595439 +0200
+@@ -5,6 +5,7 @@
+ 
+ use Xconfig::monitor;
+ use Xconfig::card;
++use Xconfig::initrd;
+ use Xconfig::plugins;
+ use Xconfig::resolution_and_depth;
+ use Xconfig::various;
+@@ -38,7 +39,7 @@
+ 
+     $X->{resolutions} = Xconfig::resolution_and_depth::configure($in, $raw_X, $X->{card}, $X->{monitors}) or return;
+     if ($raw_X->is_modified) {
+-	&write($raw_X, $X);
++	&write($raw_X, $X, 0, $in);
+     } else {
+ 	'';
+     }
+@@ -199,22 +200,28 @@
+ 
+ %s", Xconfig::various::info($raw_X, $X->{card})), 1);
+ 
+-    $ok && &write($raw_X, $X);
++    $ok && &write($raw_X, $X, 0, $in);
+ }
+ 
+ sub write {
+-    my ($raw_X, $X, $o_skip_fb_setup) = @_;
++    my ($raw_X, $X, $o_skip_fb_setup, $o_in) = @_;
+     export_to_install_X($X) if $::isInstall;
+     my $only_resolution = $raw_X->is_only_resolution_modified;
+     $raw_X->write;
+     Xconfig::various::check_xorg_conf_symlink();
++    Xconfig::initrd::rebuild_initrds_if_needed($o_in);
+     if ($X->{resolutions}[0]{bios}) {
+ 	Xconfig::various::setupFB($X->{resolutions}[0]{bios}) if !$o_skip_fb_setup;;
+ 	'need_reboot';
+     } elsif (my $resolution = $only_resolution && eval { $raw_X->get_resolution }) {
+ 	'need_xrandr' . sprintf(' --size %dx%d', @$resolution{'X', 'Y'});
+-    } else {
++    } elsif (-x "$::prefix/sbin/display_driver_helper" && run_program::rooted($::prefix, "/sbin/display_driver_helper", "--check-loaded-strict")) {
++	# No conflicting drivers are loaded. Make sure the correct driver is loaded,
++	# and allow X.org restart instead of full reboot.
++	run_program::rooted($::prefix, "udevadm", "trigger", "--subsystem-match=pci", "--attr-match=class=0x03*");
+ 	'need_restart';
++    } else {
++	'need_reboot';
+     }
+ }
+ 
+--- /dev/null	2011-02-11 11:29:34.217893282 +0200
++++ drakx-kbd-mouse-x11-0.90/lib/Xconfig/initrd.pm	2011-03-06 11:39:19.588963345 +0200
+@@ -0,0 +1,85 @@
++package Xconfig::initrd;
++
++use diagnostics;
++use strict;
++
++use lib '/usr/lib/libDrakX';
++require bootloader;
++require fsedit;
++require fs;
++use c;
++use common;
++use interactive;
++use log;
++use run_program;
++
++sub get_bootloader {
++    -x "$::prefix/sbin/display_driver_helper" or return;
++
++    my $all_hds = fsedit::get_hds();
++    fs::get_info_from_fstab($all_hds);
++    bootloader::read($all_hds);
++}
++
++sub handle_initrds {
++    my ($bootloader, $rebuild, $o_in) = @_;
++    my $curr_kernel = c::kernel_version();
++
++    my %done;
++    my @need_rebuild;
++
++    $o_in and my ($wait, $wait_message) = $o_in->wait_message_with_progress_bar(N("Initrd regeneration"));
++    $wait_message and $wait_message->(N("Please wait, checking initrds..."), 0, 1);
++
++    foreach (grep { $_->{initrd} } @{$bootloader->{entries}}) {
++	my $kernel_str = bootloader::vmlinuz2kernel_str($_->{kernel_or_dev}) or next;
++
++	# in check mode handle current kernel only
++	$rebuild or $kernel_str->{version} eq $curr_kernel or next;
++
++	my $initrd_long = '/boot/' . bootloader::kernel_str2initrd_long($kernel_str);
++	next if $done{$initrd_long}++ or not -e "$::prefix$initrd_long";
++
++	next if run_program::rooted($::prefix, "/sbin/display_driver_helper", "--check-initrd", "$initrd_long");
++
++	# return if we were only checking
++	return 1 if not $rebuild;
++
++	push(@need_rebuild, { entry   => $_,
++			      version => $kernel_str->{version},
++			      initrd  => $initrd_long });
++    }
++
++    scalar @need_rebuild > 0 or return;
++    
++    my $counter = 0;
++    $wait_message and $wait_message->(N("Configuring the display driver... (%d kernels)", scalar @need_rebuild), $counter++, scalar @need_rebuild);
++
++    foreach (@need_rebuild) {
++	bootloader::rebuild_initrd($_->{version}, $bootloader, $_->{entry}, $_->{initrd});
++	$wait_message and $wait_message->(0, $counter++, scalar @need_rebuild);
++    }
++    bootloader::action($bootloader, 'when_config_changed');
++}
++
++sub is_rebuild_needed {
++    my ($bootloader) = @_;
++    $bootloader ||= get_bootloader() or return;
++    handle_initrds($bootloader);
++}
++
++sub rebuild_initrds {
++    my ($bootloader, $o_in) = @_;
++    log::l("rebuilding initrds for KMS configuration change");
++    $bootloader ||= get_bootloader() or return;
++    handle_initrds($bootloader, 1, $o_in);
++}
++
++sub rebuild_initrds_if_needed {
++    my ($o_in) = @_;
++    my $bootloader = get_bootloader() or return;
++    is_rebuild_needed($bootloader) or return;
++    rebuild_initrds($bootloader, $o_in);
++}
++
++1;
Index: SPECS/drakx-kbd-mouse-x11.spec
===================================================================
--- SPECS/drakx-kbd-mouse-x11.spec	(revision 642214)
+++ SPECS/drakx-kbd-mouse-x11.spec	(working copy)
@@ -6,8 +6,9 @@
 Summary:  Tools to configure the keyboard, the mice and the graphic card
 Name:     drakx-kbd-mouse-x11
 Version:  0.90
-Release:  %mkrel 2
+Release:  %mkrel 2.test.2
 Source0:  %name-%version.tar.bz2
+Patch0:   drakx-kbd-mouse-x11-kmsstuff.patch
 License:  GPLv2+
 Group:    System/Configuration/Other
 Url:      http://www.mandrivalinux.com/en/cvs.php3
@@ -39,6 +40,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %make
