From owner-freebsd-current@FreeBSD.ORG Thu Mar 16 00:42:04 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 458BC16A423 for ; Thu, 16 Mar 2006 00:42:04 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CEE743D4C for ; Thu, 16 Mar 2006 00:42:03 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k2G0fxM25655; Wed, 15 Mar 2006 19:42:00 -0500 Message-ID: <4418B455.8090709@savvis.net> Date: Wed, 15 Mar 2006 16:41:57 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ulrich Spoerlein References: <20060315223501.GA1438@galgenberg.net> In-Reply-To: <20060315223501.GA1438@galgenberg.net> Content-Type: multipart/mixed; boundary="------------060000070800010805090009" Cc: current@freebsd.org Subject: Re: kbdmux/syscons/vidcontrol interacts badly with X/radeon X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2006 00:42:04 -0000 This is a multi-part message in MIME format. --------------060000070800010805090009 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Ulrich Spoerlein wrote: > Hi all, > > this pertains to 6.1-PRERELEASE and is caused by devd calling 'syscons > restart' on keyboard attach. More specifically it is due to > allscreens_flags="-c blink 80x60" in /etc/rc.conf. This will then call > vidcontrol and this totally screws up my X11 display (radeon driver). > Killing X11 will _usually_ result in a normal console, but this is not > always the case. Clearing allscreens_flags is also a possibile > workaround. > > Also, on normal boot, vidcontrol will be called twice, once in normal > startup, then via kbdmux/devd/syscons restart. > > Possible solution: Don't do a full restart, but refactor the keyboard > code in syscons into a separate function and only call this function. > > I hope this can be implemented quickly and MFC'ed before 6.1. Thanks! could you please try the attached patch? thanks, max --------------060000070800010805090009 Content-Type: text/plain; name="syscons-devd.conf.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="syscons-devd.conf.diff.txt" Index: devd.conf =================================================================== RCS file: /home/ncvs/src/etc/devd.conf,v retrieving revision 1.31 diff -u -r1.31 devd.conf --- devd.conf 6 Mar 2006 06:38:34 -0000 1.31 +++ devd.conf 16 Mar 2006 00:38:50 -0000 @@ -99,7 +99,7 @@ # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; - action "/etc/rc.d/syscons setkeyboard /dev/ukbd0 && /etc/rc.d/syscons restart"; + action "/etc/rc.d/syscons setkeyboard /dev/ukbd0"; }; detach 100 { device-name "ukbd0"; Index: rc.d/syscons =================================================================== RCS file: /home/ncvs/src/etc/rc.d/syscons,v retrieving revision 1.15 diff -u -r1.15 syscons --- rc.d/syscons 6 Mar 2006 06:38:34 -0000 1.15 +++ rc.d/syscons 16 Mar 2006 00:38:50 -0000 @@ -44,44 +44,9 @@ kbddev=/dev/ttyv0 viddev=/dev/ttyv0 -syscons_setkeyboard() +# helper +syscons_configure_keyboard() { - kbd=$1 - - if [ -z "${kbd}" ]; then - return 1 - fi - - # Check if the kbdmux(4) is the current active keyboard - kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1 - if [ $? != 0 ]; then - kbdcontrol -k ${kbd} < ${kbddev} > /dev/null 2>&1 - fi -} - -syscons_precmd() -{ - if [ ! -c $kbddev ] - then - return 1 - fi - if [ -x /usr/sbin/ispcvt ] && /usr/sbin/ispcvt - then - return 1 - fi - return 0 -} - -syscons_start() -{ - echo -n 'Configuring syscons:' - - # keyboard - # - if [ -n "${keyboard}" ]; then - echo -n ' keyboard'; syscons_setkeyboard ${keyboard} - fi - # keymap # case ${keymap} in @@ -127,6 +92,60 @@ ;; esac + # set this keyboard mode for all virtual terminals + # + if [ -n "${allscreens_kbdflags}" ]; then + echo -n ' allscreens_kbd' + for ttyv in /dev/ttyv*; do + kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 + done + fi +} + +syscons_setkeyboard() +{ + kbd=$1 + + if [ -z "${kbd}" ]; then + return 1 + fi + + # Check if the kbdmux(4) is the current active keyboard + kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1 + if [ $? != 0 ]; then + kbdcontrol -k ${kbd} < ${kbddev} > /dev/null 2>&1 + fi + + echo -n 'Configuring keyboard:' + syscons_configure_keyboard + echo '.' +} + +syscons_precmd() +{ + if [ ! -c $kbddev ] + then + return 1 + fi + if [ -x /usr/sbin/ispcvt ] && /usr/sbin/ispcvt + then + return 1 + fi + return 0 +} + +syscons_start() +{ + echo -n 'Configuring syscons:' + + # keyboard + # + if [ -n "${keyboard}" ]; then + echo -n ' keyboard'; syscons_setkeyboard ${keyboard} + fi + + syscons_configure_keyboard + # cursor type # case ${cursor} in @@ -210,15 +229,6 @@ done fi - # set this keyboard mode for all virtual terminals - # - if [ -n "${allscreens_kbdflags}" ]; then - echo -n ' allscreens_kbd' - for ttyv in /dev/ttyv*; do - kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 - done - fi - echo '.' } --------------060000070800010805090009--