nanogui: Failed to switch VT in linux-2.6.9


Previous by date: 9 Nov 2005 18:09:14 +0000 Re: nano-X : bliting bitmaps, Greg Haerr
Next by date: 9 Nov 2005 18:09:14 +0000 freetype 1.3.1, Gil Glass
Previous in thread: 9 Nov 2005 18:09:14 +0000 Re: Failed to switch VT in linux-2.6.9, Greg Haerr
Next in thread:

Subject: RE: [nanogui] Failed to switch VT in linux-2.6.9
From: Gavin Li ####@####.####
Date: 9 Nov 2005 18:09:14 +0000
Message-Id: <11E3973D1E78D311A5B400508B4A70CE02CC0A5B@COMSRVR>

The error message : "Error can't switch away from VT: Invalid argument". is
come from drivers/vtswitch.c :
vt_do_switch(void *arg)
{
    static unsigned short r[16], g[16], b[16];

    /*
     * If a drawing function is in progress then we cannot mode
     * switch right now because the drawing function would continue to
     * scribble on the screen after the switch.  So disable further
     * drawing and schedule an alarm to try again in .1 second.
     */
    if(mwdrawing) {
    	draw_disable ();
	GdAddTimer(100, vt_do_switch, NULL);
    	return;
    }
      
    if(visible) {
    	draw_disable ();
	ioctl_getpalette(0, 16, r, g, b);

	if(ioctl (ttyfd, VT_RELDISP, 1) == -1) {
	    EPRINTF("Error can't switch away from VT: %m\n");
	}
    } else {
	ioctl_setpalette(0, 16, r, g, b);
    	draw_enable ();
      
	if(ioctl (ttyfd, VT_RELDISP, VT_ACKACQ) == -1)
		EPRINTF("Error can't acknowledge VT switch: %m\n");
    }
}

I think it is the EPRINTF("....%m\n"); gives the Invalid argument. But the
error comes from the former ioctl(,VT_RELDISP,)
But when I changed the GdAddTimer(100, vt_do_switch, NULL); to
GdAddTimer(1000,,); the error message will dispear, but still successfully
switch console.
BTW, I am using :
extern struct mw_timer* GdAddTimer(unsigned long timeout, void * callback,
void *arg);
extern struct mw_timer* GdAddPeriodicTimer(unsigned long timeout, void *
callback, void *arg);
extern void GdResetAllTimer(void);
extern void GdDestroyTimer(struct mw_timer* timer);

I have a 8 windows displayed on screen with fastest timer is 1/15 second,
and 7 of 1second timer running. I use StretchBlt() to draw windows client
area. When I switch console, the Title is not displayed, but all client area
are displayed on the switched console.

Gavin Li


-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Wednesday, November 09, 2005 12:28 PM
To: Gavin Li; ####@####.####
Subject: Re: [nanogui] Failed to switch VT in linux-2.6.9


: I was using microwindows-0.91 + linux-2.4.27 without any problem,
: Recently, I moved to linux-2.6.9 (FedoraCore3), I compiled
microwindows-0.91
: and run my app, it seems OK, but when I press Alt_Fx, I couldn't switch
away
: , and log says "Error can't switch away from VT: Invalid argument".

Sounds like the code in drivers/vtswitch.c uses an unsupported
VT switch ioctl() for your kernel.  You may have to disable
VTSWITCH in config file.



:
: Suppose my app running in VT 1, I could switch away by press Alt_F2,
Alt_F3,
: Alt_F1, Alt_F2, Alt_F3, Alt_F1, Alt_F3, which means I have to press those
: keys in a random speed and random combinations.

I don't understand what you're asking for here.  When VTSWITCH
is set, Microwindows will switch consoles using a kernel ioctl()
when ALT-F{1-8} is returned from the keyboard driver.

Regards,

Greg

Previous by date: 9 Nov 2005 18:09:14 +0000 Re: nano-X : bliting bitmaps, Greg Haerr
Next by date: 9 Nov 2005 18:09:14 +0000 freetype 1.3.1, Gil Glass
Previous in thread: 9 Nov 2005 18:09:14 +0000 Re: Failed to switch VT in linux-2.6.9, Greg Haerr
Next in thread:


Powered by ezmlm-browse 0.20.