Re: FB_VISUAL_TRUECOLOR vs.FB_VISUAL_DIRECTCOLOR

"James Lehman" <[email protected]> Sun, 6 Aug 2006 00:05:13 -0400
Newsgroups gmane.linux.fbdev.user
Message-ID <000d01c6b90d$84d283a0$0b00a8c0@bug>
I'm not so sure there is a bug in the kernel or the drivers, but I can say
for sure that this code gets called.

I like to run frame buffer stuff like a high-res display server. I shell
into the box from another computer and have both a regular shell console and
the display that is native to the Linux box. If I shell in with another
console session and do anything that would open and init the frame buffer,
the problem disappears. I though I could get a screen shot of the problem,
but doing that makes it go away!

James.   :o)


//##########################################################################
##
int ezfb_tty_graphics()
{
    int ret = 1;
    if(0 > (tty = open(EZFB_TTY_DEVICE, O_RDWR)))
    {
        perror("\nezfb ERROR: " EZFB_TTY_DEVICE " open failed");
        ret = 0;
    }
    else if(0 > ioctl(tty, KDGETMODE, &tty_mode_was))
    {
        perror("\nezfb ERROR: " EZFB_TTY_DEVICE " get mode failed");
        ret = 0;
    }
    else if(    (KD_GRAPHICS != tty_mode_was)
             && (0 > ioctl(tty, KDSETMODE, KD_GRAPHICS)))
    {
        perror("\nezfb ERROR: " EZFB_TTY_DEVICE " set graphics failed");
        close(tty);
        ret = 0;
    }
    else
    {
        printf("tty mode was ");
        switch(tty_mode_was)
        {
            case KD_TEXT     :  printf("KD_TEXT"     ); break;
            case KD_GRAPHICS :  printf("KD_GRAPHICS" ); break;
            default          :  printf("IMPOSSIBLE!" ); break;
        }
        printf("\n");
        printf("tty mode set to KD_GRAPHICS\n");
        fflush(stdout);
        close(tty);
    }
    return ret;
}

//##########################################################################
##
int ezfb_tty_text()
{
    int ret = 1;
    if(0 > (tty = open(EZFB_TTY_DEVICE, O_RDWR)))
    {
        perror("\nezfb ERROR: " EZFB_TTY_DEVICE " open failed");
        ret = 0;
    }
    else if(0 > ioctl(tty, KDSETMODE, tty_mode_was))
    {
        perror("\nezfb ERROR: " EZFB_TTY_DEVICE " reset mode failed");
        close(tty);
        ret = 0;
    }
    else
    {
        printf("tty mode set to ");
        switch(tty_mode_was)
        {
            case KD_TEXT     :  printf("KD_TEXT"     ); break;
            case KD_GRAPHICS :  printf("KD_GRAPHICS" ); break;
            default          :  printf("IMPOSSIBLE!" ); break;
        }
        printf("\n");
        fflush(stdout);
        close(tty);
    }
    return ret;
}

//##########################################################################
##


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV