1 /*****************************************************************************
2 * fb.c : framebuffer plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: fb.c,v 1.20 2002/07/20 18:01:42 sam Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <errno.h> /* ENOMEM */
28 #include <signal.h> /* SIGUSR1, SIGUSR2 */
29 #include <stdlib.h> /* free() */
30 #include <string.h> /* strerror() */
31 #include <fcntl.h> /* open() */
32 #include <unistd.h> /* close() */
34 #include <termios.h> /* struct termios */
35 #include <sys/ioctl.h>
36 #include <sys/mman.h> /* mmap() */
39 #include <linux/vt.h> /* VT_* */
40 #include <linux/kd.h> /* KD* */
45 /*****************************************************************************
46 * Capabilities defined in the other files.
47 *****************************************************************************/
48 static void vout_getfunctions( function_list_t * p_function_list );
50 static int vout_Create ( vout_thread_t * );
51 static void vout_Destroy ( vout_thread_t * );
52 static void vout_Render ( vout_thread_t *, picture_t * );
53 static void vout_Display ( vout_thread_t *, picture_t * );
54 static int vout_Manage ( vout_thread_t * );
55 static int vout_Init ( vout_thread_t * );
56 static void vout_End ( vout_thread_t * );
58 static int OpenDisplay ( vout_thread_t * );
59 static void CloseDisplay ( vout_thread_t * );
60 static void SwitchDisplay ( int i_signal );
61 static void TextMode ( int i_tty );
62 static void GfxMode ( int i_tty );
64 /*****************************************************************************
65 * Building configuration tree
66 *****************************************************************************/
67 #define FB_DEV_VAR "fbdev"
70 ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
71 ADD_STRING ( FB_DEV_VAR, "/dev/fb0", NULL, N_("framebuffer device"), NULL )
75 SET_DESCRIPTION( _("Linux console framebuffer module") )
76 ADD_CAPABILITY( VOUT, 30 )
80 vout_getfunctions( &p_module->p_functions->vout );
83 MODULE_DEACTIVATE_START
84 MODULE_DEACTIVATE_STOP
86 /*****************************************************************************
87 * vout_sys_t: video output framebuffer method descriptor
88 *****************************************************************************
89 * This structure is part of the video output thread descriptor.
90 * It describes the FB specific properties of an output thread.
91 *****************************************************************************/
94 /* System informations */
95 int i_tty; /* tty device handle */
96 struct termios old_termios;
98 /* Original configuration informations */
99 struct sigaction sig_usr1; /* USR1 previous handler */
100 struct sigaction sig_usr2; /* USR2 previous handler */
101 struct vt_mode vt_mode; /* previous VT mode */
103 /* Framebuffer information */
104 int i_fd; /* device handle */
105 struct fb_var_screeninfo old_info; /* original mode informations */
106 struct fb_var_screeninfo var_info; /* current mode informations */
107 vlc_bool_t b_pan; /* does device supports panning ? */
108 struct fb_cmap fb_cmap; /* original colormap */
109 u16 *p_palette; /* original palette */
111 /* Video information */
114 int i_bytes_per_pixel;
117 byte_t * p_video; /* base adress */
118 size_t i_page_size; /* page size */
121 /*****************************************************************************
122 * Functions exported as capabilities. They are declared as static so that
123 * we don't pollute the namespace too much.
124 *****************************************************************************/
125 static void vout_getfunctions( function_list_t * p_function_list )
127 p_function_list->functions.vout.pf_create = vout_Create;
128 p_function_list->functions.vout.pf_init = vout_Init;
129 p_function_list->functions.vout.pf_end = vout_End;
130 p_function_list->functions.vout.pf_destroy = vout_Destroy;
131 p_function_list->functions.vout.pf_manage = vout_Manage;
132 p_function_list->functions.vout.pf_render = vout_Render;
133 p_function_list->functions.vout.pf_display = vout_Display;
136 /*****************************************************************************
137 * vout_Create: allocates FB video thread output method
138 *****************************************************************************
139 * This function allocates and initializes a FB vout method.
140 *****************************************************************************/
141 static int vout_Create( vout_thread_t *p_vout )
143 struct sigaction sig_tty; /* sigaction for tty change */
144 struct vt_mode vt_mode; /* vt current mode */
145 struct termios new_termios;
147 /* Allocate instance and initialize some members */
148 p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
149 if( p_vout->p_sys == NULL )
154 /* Set tty and fb devices */
155 p_vout->p_sys->i_tty = 0; /* 0 == /dev/tty0 == current console */
157 GfxMode( p_vout->p_sys->i_tty );
159 /* Set keyboard settings */
160 if (tcgetattr(0, &p_vout->p_sys->old_termios) == -1)
162 msg_Err( p_vout, "tcgetattr failed" );
165 if (tcgetattr(0, &new_termios) == -1)
167 msg_Err( p_vout, "tcgetattr failed" );
170 /* new_termios.c_lflag &= ~ (ICANON | ISIG);
171 new_termios.c_lflag |= (ECHO | ECHOCTL); */
172 new_termios.c_lflag &= ~ (ICANON);
173 new_termios.c_lflag &= ~(ECHO | ECHOCTL);
174 new_termios.c_iflag = 0;
175 new_termios.c_cc[VMIN] = 1;
176 new_termios.c_cc[VTIME] = 0;
178 if (tcsetattr(0, TCSAFLUSH, &new_termios) == -1)
180 msg_Err( p_vout, "tcsetattr failed" );
183 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, VT_ACKACQ );
185 /* Set-up tty signal handler to be aware of tty changes */
186 memset( &sig_tty, 0, sizeof( sig_tty ) );
187 sig_tty.sa_handler = SwitchDisplay;
188 sigemptyset( &sig_tty.sa_mask );
189 if( sigaction( SIGUSR1, &sig_tty, &p_vout->p_sys->sig_usr1 ) ||
190 sigaction( SIGUSR2, &sig_tty, &p_vout->p_sys->sig_usr2 ) )
192 msg_Err( p_vout, "cannot set signal handler (%s)", strerror(errno) );
193 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
194 TextMode( p_vout->p_sys->i_tty );
195 free( p_vout->p_sys );
199 /* Set-up tty according to new signal handler */
200 if( -1 == ioctl( p_vout->p_sys->i_tty,
201 VT_GETMODE, &p_vout->p_sys->vt_mode ) )
203 msg_Err( p_vout, "cannot get terminal mode (%s)", strerror(errno) );
204 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
205 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
206 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
207 TextMode( p_vout->p_sys->i_tty );
208 free( p_vout->p_sys );
211 memcpy( &vt_mode, &p_vout->p_sys->vt_mode, sizeof( vt_mode ) );
212 vt_mode.mode = VT_PROCESS;
214 vt_mode.relsig = SIGUSR1;
215 vt_mode.acqsig = SIGUSR2;
217 if( -1 == ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &vt_mode ) )
219 msg_Err( p_vout, "cannot set terminal mode (%s)", strerror(errno) );
220 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
221 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
222 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
223 TextMode( p_vout->p_sys->i_tty );
224 free( p_vout->p_sys );
228 if( OpenDisplay( p_vout ) )
230 ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &p_vout->p_sys->vt_mode );
231 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
232 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
233 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
234 TextMode( p_vout->p_sys->i_tty );
235 free( p_vout->p_sys );
242 /*****************************************************************************
243 * vout_Init: initialize framebuffer video thread output method
244 *****************************************************************************/
245 static int vout_Init( vout_thread_t *p_vout )
250 I_OUTPUTPICTURES = 0;
252 /* Initialize the output structure: RGB with square pixels, whatever
253 * the input format is, since it's the only format we know */
254 switch( p_vout->p_sys->var_info.bits_per_pixel )
256 case 8: /* FIXME: set the palette */
257 p_vout->output.i_chroma = FOURCC_RGB2; break;
259 p_vout->output.i_chroma = FOURCC_RV15; break;
261 p_vout->output.i_chroma = FOURCC_RV16; break;
263 p_vout->output.i_chroma = FOURCC_RV24; break;
265 p_vout->output.i_chroma = FOURCC_RV32; break;
267 msg_Err( p_vout, "unknown screen depth %i",
268 p_vout->p_sys->var_info.bits_per_pixel );
272 /* Only useful for p_vout->p_sys->var_info.bits_per_pixel != 8 */
273 p_vout->output.i_rmask = ( (1 << p_vout->p_sys->var_info.red.length) - 1 )
274 << p_vout->p_sys->var_info.red.offset;
275 p_vout->output.i_gmask = ( (1 << p_vout->p_sys->var_info.green.length) - 1 )
276 << p_vout->p_sys->var_info.green.offset;
277 p_vout->output.i_bmask = ( (1 << p_vout->p_sys->var_info.blue.length) - 1 )
278 << p_vout->p_sys->var_info.blue.offset;
280 p_vout->output.i_width = p_vout->p_sys->i_width;
281 p_vout->output.i_height = p_vout->p_sys->i_height;
283 /* Assume we have square pixels */
284 p_vout->output.i_aspect = p_vout->p_sys->i_width
285 * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
287 /* Clear the screen */
288 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
290 /* Try to initialize 1 direct buffer */
293 /* Find an empty picture slot */
294 for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
296 if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
298 p_pic = p_vout->p_picture + i_index;
303 /* Allocate the picture */
309 /* We know the chroma, allocate a buffer which will be used
310 * directly by the decoder */
311 p_pic->p->p_pixels = p_vout->p_sys->p_video;
312 p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
313 p_pic->p->i_lines = p_vout->p_sys->var_info.yres;
315 if( p_vout->p_sys->var_info.xres_virtual )
317 p_pic->p->b_margin = 1;
318 p_pic->p->b_hidden = 1;
319 p_pic->p->i_pitch = p_vout->p_sys->var_info.xres_virtual
320 * p_vout->p_sys->i_bytes_per_pixel;
321 p_pic->p->i_visible_bytes = p_vout->p_sys->var_info.xres
322 * p_vout->p_sys->i_bytes_per_pixel;
326 p_pic->p->b_margin = 0;
327 p_pic->p->i_pitch = p_vout->p_sys->var_info.xres
328 * p_vout->p_sys->i_bytes_per_pixel;
333 p_pic->i_status = DESTROYED_PICTURE;
334 p_pic->i_type = DIRECT_PICTURE;
336 PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
343 /*****************************************************************************
344 * vout_End: terminate framebuffer video thread output method
345 *****************************************************************************/
346 static void vout_End( vout_thread_t *p_vout )
348 /* Clear the screen */
349 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
352 /*****************************************************************************
353 * vout_Destroy: destroy FB video thread output method
354 *****************************************************************************
355 * Terminate an output method created by vout_CreateOutputMethod
356 *****************************************************************************/
357 static void vout_Destroy( vout_thread_t *p_vout )
359 CloseDisplay( p_vout );
361 /* Reset the terminal */
362 ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &p_vout->p_sys->vt_mode );
364 /* Remove signal handlers */
365 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
366 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
368 /* Reset the keyboard state */
369 tcsetattr( 0, 0, &p_vout->p_sys->old_termios );
371 /* Return to text mode */
372 TextMode( p_vout->p_sys->i_tty );
374 /* Destroy structure */
375 free( p_vout->p_sys );
378 /*****************************************************************************
379 * vout_Manage: handle FB events
380 *****************************************************************************
381 * This function should be called regularly by video output thread. It manages
382 * console events. It returns a non null value on error.
383 *****************************************************************************/
384 static int vout_Manage( vout_thread_t *p_vout )
389 if ( read(0, &buf, 1) == 1)
394 p_vout->p_vlc->b_die = 1;
406 if( p_vout->i_changes & VOUT_SIZE_CHANGE )
408 msg_Dbg( p_vout, "reinitializing framebuffer screen" );
409 p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
411 /* Destroy XImages to change their size */
414 /* Recreate XImages. If SysInit failed, the thread can't go on. */
415 if( vout_Init( p_vout ) )
417 msg_Err( p_vout, "cannot reinit framebuffer screen" );
422 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
425 /* Tell the video output thread that it will need to rebuild YUV
426 * tables. This is needed since conversion buffer size may have changed */
427 p_vout->i_changes |= VOUT_YUV_CHANGE;
434 /*****************************************************************************
435 * vout_Render: renders previously calculated output
436 *****************************************************************************/
437 static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
442 /*****************************************************************************
443 * vout_Display: displays previously rendered output
444 *****************************************************************************
445 * This function send the currently rendered image to FB image, waits until
446 * it is displayed and switch the two rendering buffers, preparing next frame.
447 *****************************************************************************/
448 static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
450 /* swap the two Y offsets if the drivers supports panning */
451 if( p_vout->p_sys->b_pan )
453 p_vout->p_sys->var_info.yoffset = 0;
454 //p_vout->p_sys->var_info.yoffset = p_vout->p_sys->var_info.yres;
456 /* the X offset should be 0, but who knows ...
457 * some other app might have played with the framebuffer */
458 p_vout->p_sys->var_info.xoffset = 0;
460 ioctl( p_vout->p_sys->i_fd,
461 FBIOPAN_DISPLAY, &p_vout->p_sys->var_info );
466 static void vout_SetPalette( vout_thread_t *p_vout,
467 u16 *red, u16 *green, u16 *blue, u16 *transp )
469 struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
471 ioctl( p_vout->p_sys->i_fd, FBIOPUTCMAP, &cmap );
475 /* following functions are local */
477 /*****************************************************************************
478 * OpenDisplay: initialize framebuffer
479 *****************************************************************************/
480 static int OpenDisplay( vout_thread_t *p_vout )
482 char *psz_device; /* framebuffer device path */
483 struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
485 /* Open framebuffer device */
486 if( !(psz_device = config_GetPsz( p_vout, FB_DEV_VAR )) )
488 msg_Err( p_vout, "don't know which fb device to open" );
492 p_vout->p_sys->i_fd = open( psz_device, O_RDWR);
494 if( p_vout->p_sys->i_fd == -1 )
496 msg_Err( p_vout, "cannot open %s (%s)", psz_device, strerror(errno) );
502 /* Get framebuffer device informations */
503 if( ioctl( p_vout->p_sys->i_fd,
504 FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
506 msg_Err( p_vout, "cannot get fb info (%s)", strerror(errno) );
507 close( p_vout->p_sys->i_fd );
511 if( ioctl( p_vout->p_sys->i_fd,
512 FBIOGET_VSCREENINFO, &p_vout->p_sys->old_info ) )
514 msg_Err( p_vout, "cannot get 2nd fb info (%s)", strerror(errno) );
515 close( p_vout->p_sys->i_fd );
519 /* Set some attributes */
520 p_vout->p_sys->var_info.activate = FB_ACTIVATE_NXTOPEN;
521 p_vout->p_sys->var_info.xoffset = 0;
522 p_vout->p_sys->var_info.yoffset = 0;
524 if( ioctl( p_vout->p_sys->i_fd,
525 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info ) )
527 msg_Err( p_vout, "cannot set fb info (%s)", strerror(errno) );
528 close( p_vout->p_sys->i_fd );
532 /* Get some informations again, in the definitive configuration */
533 if( ioctl( p_vout->p_sys->i_fd, FBIOGET_FSCREENINFO, &fix_info )
534 || ioctl( p_vout->p_sys->i_fd,
535 FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
537 msg_Err( p_vout, "cannot get additional fb info (%s)",
540 /* Restore fb config */
541 ioctl( p_vout->p_sys->i_fd,
542 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
544 close( p_vout->p_sys->i_fd );
548 /* FIXME: if the image is full-size, it gets cropped on the left
549 * because of the xres / xres_virtual slight difference */
550 msg_Dbg( p_vout, "%ix%i (virtual %ix%i)",
551 p_vout->p_sys->var_info.xres, p_vout->p_sys->var_info.yres,
552 p_vout->p_sys->var_info.xres_virtual,
553 p_vout->p_sys->var_info.yres_virtual );
555 p_vout->p_sys->i_height = p_vout->p_sys->var_info.yres;
556 p_vout->p_sys->i_width = p_vout->p_sys->var_info.xres_virtual
557 ? p_vout->p_sys->var_info.xres_virtual
558 : p_vout->p_sys->var_info.xres;
560 p_vout->p_sys->p_palette = NULL;
561 p_vout->p_sys->b_pan = ( fix_info.ypanstep || fix_info.ywrapstep );
563 switch( p_vout->p_sys->var_info.bits_per_pixel )
566 p_vout->p_sys->p_palette = malloc( 8 * 256 * sizeof( u16 ) );
567 p_vout->p_sys->fb_cmap.start = 0;
568 p_vout->p_sys->fb_cmap.len = 256;
569 p_vout->p_sys->fb_cmap.red = p_vout->p_sys->p_palette;
570 p_vout->p_sys->fb_cmap.green = p_vout->p_sys->p_palette + 256 * sizeof( u16 );
571 p_vout->p_sys->fb_cmap.blue = p_vout->p_sys->p_palette + 2 * 256 * sizeof( u16 );
572 p_vout->p_sys->fb_cmap.transp = p_vout->p_sys->p_palette + 3 * 256 * sizeof( u16 );
574 /* Save the colormap */
575 ioctl( p_vout->p_sys->i_fd, FBIOGETCMAP, &p_vout->p_sys->fb_cmap );
577 p_vout->p_sys->i_bytes_per_pixel = 1;
582 p_vout->p_sys->i_bytes_per_pixel = 2;
586 p_vout->p_sys->i_bytes_per_pixel = 3;
590 p_vout->p_sys->i_bytes_per_pixel = 4;
594 msg_Err( p_vout, "screen depth %d is not supported",
595 p_vout->p_sys->var_info.bits_per_pixel );
597 /* Restore fb config */
598 ioctl( p_vout->p_sys->i_fd,
599 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
601 close( p_vout->p_sys->i_fd );
605 p_vout->p_sys->i_page_size = p_vout->p_sys->i_width *
606 p_vout->p_sys->i_height * p_vout->p_sys->i_bytes_per_pixel;
608 /* Map a framebuffer at the beginning */
609 p_vout->p_sys->p_video = mmap( 0, p_vout->p_sys->i_page_size,
610 PROT_READ | PROT_WRITE, MAP_SHARED,
611 p_vout->p_sys->i_fd, 0 );
613 if( p_vout->p_sys->p_video == ((void*)-1) )
615 msg_Err( p_vout, "cannot map video memory (%s)", strerror(errno) );
617 if( p_vout->p_sys->var_info.bits_per_pixel == 8 )
619 free( p_vout->p_sys->p_palette );
622 /* Restore fb config */
623 ioctl( p_vout->p_sys->i_fd,
624 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
626 close( p_vout->p_sys->i_fd );
630 msg_Dbg( p_vout, "framebuffer type=%d, visual=%d, ypanstep=%d, "
631 "ywrap=%d, accel=%d", fix_info.type, fix_info.visual,
632 fix_info.ypanstep, fix_info.ywrapstep, fix_info.accel );
636 /*****************************************************************************
637 * CloseDisplay: terminate FB video thread output method
638 *****************************************************************************/
639 static void CloseDisplay( vout_thread_t *p_vout )
642 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
644 /* Restore palette */
645 if( p_vout->p_sys->var_info.bits_per_pixel == 8 );
647 ioctl( p_vout->p_sys->i_fd,
648 FBIOPUTCMAP, &p_vout->p_sys->fb_cmap );
649 free( p_vout->p_sys->p_palette );
652 /* Restore fb config */
653 ioctl( p_vout->p_sys->i_fd,
654 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
657 close( p_vout->p_sys->i_fd );
660 /*****************************************************************************
661 * SwitchDisplay: VT change signal handler
662 *****************************************************************************
663 * This function activates or deactivates the output of the thread. It is
664 * called by the VT driver, on terminal change.
665 *****************************************************************************/
666 static void SwitchDisplay(int i_signal)
669 vout_thread_t *p_vout;
671 vlc_mutex_lock( &p_vout_bank->lock );
673 /* XXX: only test the first video output */
674 if( p_vout_bank->i_count )
676 p_vout = p_vout_bank->pp_vout[0];
680 case SIGUSR1: /* vt has been released */
681 p_vout->b_active = 0;
682 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, 1 );
684 case SIGUSR2: /* vt has been acquired */
685 p_vout->b_active = 1;
686 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, VT_ACTIVATE );
687 /* handle blanking */
688 vlc_mutex_lock( &p_vout->change_lock );
689 p_vout->i_changes |= VOUT_SIZE_CHANGE;
690 vlc_mutex_unlock( &p_vout->change_lock );
695 vlc_mutex_unlock( &p_vout_bank->lock );
699 /*****************************************************************************
700 * TextMode and GfxMode : switch tty to text/graphic mode
701 *****************************************************************************
702 * These functions toggle the tty mode.
703 *****************************************************************************/
704 static void TextMode( int i_tty )
706 /* return to text mode */
707 if( -1 == ioctl(i_tty, KDSETMODE, KD_TEXT) )
709 //X msg_Err( p_vout, "failed ioctl KDSETMODE KD_TEXT" );
713 static void GfxMode( int i_tty )
715 /* switch to graphic mode */
716 if( -1 == ioctl(i_tty, KDSETMODE, KD_GRAPHICS) )
718 //X msg_Err( p_vout, "failed ioctl KDSETMODE KD_GRAPHICS" );