1 /*****************************************************************************
2 * fb.c : framebuffer plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: fb.c,v 1.21 2002/07/23 00:39:17 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 = VLC_FOURCC('R','G','B','2'); break;
259 p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
261 p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
263 p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
265 p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); 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_pitch = 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->i_pitch = p_vout->p_sys->var_info.xres_virtual
318 * p_vout->p_sys->i_bytes_per_pixel;
322 p_pic->p->i_pitch = p_vout->p_sys->var_info.xres
323 * p_vout->p_sys->i_bytes_per_pixel;
326 p_pic->p->i_visible_pitch = p_vout->p_sys->var_info.xres
327 * p_vout->p_sys->i_bytes_per_pixel;
331 p_pic->i_status = DESTROYED_PICTURE;
332 p_pic->i_type = DIRECT_PICTURE;
334 PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
341 /*****************************************************************************
342 * vout_End: terminate framebuffer video thread output method
343 *****************************************************************************/
344 static void vout_End( vout_thread_t *p_vout )
346 /* Clear the screen */
347 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
350 /*****************************************************************************
351 * vout_Destroy: destroy FB video thread output method
352 *****************************************************************************
353 * Terminate an output method created by vout_CreateOutputMethod
354 *****************************************************************************/
355 static void vout_Destroy( vout_thread_t *p_vout )
357 CloseDisplay( p_vout );
359 /* Reset the terminal */
360 ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &p_vout->p_sys->vt_mode );
362 /* Remove signal handlers */
363 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
364 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
366 /* Reset the keyboard state */
367 tcsetattr( 0, 0, &p_vout->p_sys->old_termios );
369 /* Return to text mode */
370 TextMode( p_vout->p_sys->i_tty );
372 /* Destroy structure */
373 free( p_vout->p_sys );
376 /*****************************************************************************
377 * vout_Manage: handle FB events
378 *****************************************************************************
379 * This function should be called regularly by video output thread. It manages
380 * console events. It returns a non null value on error.
381 *****************************************************************************/
382 static int vout_Manage( vout_thread_t *p_vout )
387 if ( read(0, &buf, 1) == 1)
392 p_vout->p_vlc->b_die = 1;
404 if( p_vout->i_changes & VOUT_SIZE_CHANGE )
406 msg_Dbg( p_vout, "reinitializing framebuffer screen" );
407 p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
409 /* Destroy XImages to change their size */
412 /* Recreate XImages. If SysInit failed, the thread can't go on. */
413 if( vout_Init( p_vout ) )
415 msg_Err( p_vout, "cannot reinit framebuffer screen" );
420 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
423 /* Tell the video output thread that it will need to rebuild YUV
424 * tables. This is needed since conversion buffer size may have changed */
425 p_vout->i_changes |= VOUT_YUV_CHANGE;
432 /*****************************************************************************
433 * vout_Render: renders previously calculated output
434 *****************************************************************************/
435 static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
440 /*****************************************************************************
441 * vout_Display: displays previously rendered output
442 *****************************************************************************
443 * This function send the currently rendered image to FB image, waits until
444 * it is displayed and switch the two rendering buffers, preparing next frame.
445 *****************************************************************************/
446 static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
448 /* swap the two Y offsets if the drivers supports panning */
449 if( p_vout->p_sys->b_pan )
451 p_vout->p_sys->var_info.yoffset = 0;
452 //p_vout->p_sys->var_info.yoffset = p_vout->p_sys->var_info.yres;
454 /* the X offset should be 0, but who knows ...
455 * some other app might have played with the framebuffer */
456 p_vout->p_sys->var_info.xoffset = 0;
458 ioctl( p_vout->p_sys->i_fd,
459 FBIOPAN_DISPLAY, &p_vout->p_sys->var_info );
464 static void vout_SetPalette( vout_thread_t *p_vout,
465 u16 *red, u16 *green, u16 *blue, u16 *transp )
467 struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
469 ioctl( p_vout->p_sys->i_fd, FBIOPUTCMAP, &cmap );
473 /* following functions are local */
475 /*****************************************************************************
476 * OpenDisplay: initialize framebuffer
477 *****************************************************************************/
478 static int OpenDisplay( vout_thread_t *p_vout )
480 char *psz_device; /* framebuffer device path */
481 struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
483 /* Open framebuffer device */
484 if( !(psz_device = config_GetPsz( p_vout, FB_DEV_VAR )) )
486 msg_Err( p_vout, "don't know which fb device to open" );
490 p_vout->p_sys->i_fd = open( psz_device, O_RDWR);
492 if( p_vout->p_sys->i_fd == -1 )
494 msg_Err( p_vout, "cannot open %s (%s)", psz_device, strerror(errno) );
500 /* Get framebuffer device informations */
501 if( ioctl( p_vout->p_sys->i_fd,
502 FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
504 msg_Err( p_vout, "cannot get fb info (%s)", strerror(errno) );
505 close( p_vout->p_sys->i_fd );
509 if( ioctl( p_vout->p_sys->i_fd,
510 FBIOGET_VSCREENINFO, &p_vout->p_sys->old_info ) )
512 msg_Err( p_vout, "cannot get 2nd fb info (%s)", strerror(errno) );
513 close( p_vout->p_sys->i_fd );
517 /* Set some attributes */
518 p_vout->p_sys->var_info.activate = FB_ACTIVATE_NXTOPEN;
519 p_vout->p_sys->var_info.xoffset = 0;
520 p_vout->p_sys->var_info.yoffset = 0;
522 if( ioctl( p_vout->p_sys->i_fd,
523 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info ) )
525 msg_Err( p_vout, "cannot set fb info (%s)", strerror(errno) );
526 close( p_vout->p_sys->i_fd );
530 /* Get some informations again, in the definitive configuration */
531 if( ioctl( p_vout->p_sys->i_fd, FBIOGET_FSCREENINFO, &fix_info )
532 || ioctl( p_vout->p_sys->i_fd,
533 FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
535 msg_Err( p_vout, "cannot get additional fb info (%s)",
538 /* Restore fb config */
539 ioctl( p_vout->p_sys->i_fd,
540 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
542 close( p_vout->p_sys->i_fd );
546 /* FIXME: if the image is full-size, it gets cropped on the left
547 * because of the xres / xres_virtual slight difference */
548 msg_Dbg( p_vout, "%ix%i (virtual %ix%i)",
549 p_vout->p_sys->var_info.xres, p_vout->p_sys->var_info.yres,
550 p_vout->p_sys->var_info.xres_virtual,
551 p_vout->p_sys->var_info.yres_virtual );
553 p_vout->p_sys->i_height = p_vout->p_sys->var_info.yres;
554 p_vout->p_sys->i_width = p_vout->p_sys->var_info.xres_virtual
555 ? p_vout->p_sys->var_info.xres_virtual
556 : p_vout->p_sys->var_info.xres;
558 p_vout->p_sys->p_palette = NULL;
559 p_vout->p_sys->b_pan = ( fix_info.ypanstep || fix_info.ywrapstep );
561 switch( p_vout->p_sys->var_info.bits_per_pixel )
564 p_vout->p_sys->p_palette = malloc( 8 * 256 * sizeof( u16 ) );
565 p_vout->p_sys->fb_cmap.start = 0;
566 p_vout->p_sys->fb_cmap.len = 256;
567 p_vout->p_sys->fb_cmap.red = p_vout->p_sys->p_palette;
568 p_vout->p_sys->fb_cmap.green = p_vout->p_sys->p_palette + 256 * sizeof( u16 );
569 p_vout->p_sys->fb_cmap.blue = p_vout->p_sys->p_palette + 2 * 256 * sizeof( u16 );
570 p_vout->p_sys->fb_cmap.transp = p_vout->p_sys->p_palette + 3 * 256 * sizeof( u16 );
572 /* Save the colormap */
573 ioctl( p_vout->p_sys->i_fd, FBIOGETCMAP, &p_vout->p_sys->fb_cmap );
575 p_vout->p_sys->i_bytes_per_pixel = 1;
580 p_vout->p_sys->i_bytes_per_pixel = 2;
584 p_vout->p_sys->i_bytes_per_pixel = 3;
588 p_vout->p_sys->i_bytes_per_pixel = 4;
592 msg_Err( p_vout, "screen depth %d is not supported",
593 p_vout->p_sys->var_info.bits_per_pixel );
595 /* Restore fb config */
596 ioctl( p_vout->p_sys->i_fd,
597 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
599 close( p_vout->p_sys->i_fd );
603 p_vout->p_sys->i_page_size = p_vout->p_sys->i_width *
604 p_vout->p_sys->i_height * p_vout->p_sys->i_bytes_per_pixel;
606 /* Map a framebuffer at the beginning */
607 p_vout->p_sys->p_video = mmap( 0, p_vout->p_sys->i_page_size,
608 PROT_READ | PROT_WRITE, MAP_SHARED,
609 p_vout->p_sys->i_fd, 0 );
611 if( p_vout->p_sys->p_video == ((void*)-1) )
613 msg_Err( p_vout, "cannot map video memory (%s)", strerror(errno) );
615 if( p_vout->p_sys->var_info.bits_per_pixel == 8 )
617 free( p_vout->p_sys->p_palette );
620 /* Restore fb config */
621 ioctl( p_vout->p_sys->i_fd,
622 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
624 close( p_vout->p_sys->i_fd );
628 msg_Dbg( p_vout, "framebuffer type=%d, visual=%d, ypanstep=%d, "
629 "ywrap=%d, accel=%d", fix_info.type, fix_info.visual,
630 fix_info.ypanstep, fix_info.ywrapstep, fix_info.accel );
634 /*****************************************************************************
635 * CloseDisplay: terminate FB video thread output method
636 *****************************************************************************/
637 static void CloseDisplay( vout_thread_t *p_vout )
640 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
642 /* Restore palette */
643 if( p_vout->p_sys->var_info.bits_per_pixel == 8 );
645 ioctl( p_vout->p_sys->i_fd,
646 FBIOPUTCMAP, &p_vout->p_sys->fb_cmap );
647 free( p_vout->p_sys->p_palette );
650 /* Restore fb config */
651 ioctl( p_vout->p_sys->i_fd,
652 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
655 close( p_vout->p_sys->i_fd );
658 /*****************************************************************************
659 * SwitchDisplay: VT change signal handler
660 *****************************************************************************
661 * This function activates or deactivates the output of the thread. It is
662 * called by the VT driver, on terminal change.
663 *****************************************************************************/
664 static void SwitchDisplay(int i_signal)
667 vout_thread_t *p_vout;
669 vlc_mutex_lock( &p_vout_bank->lock );
671 /* XXX: only test the first video output */
672 if( p_vout_bank->i_count )
674 p_vout = p_vout_bank->pp_vout[0];
678 case SIGUSR1: /* vt has been released */
679 p_vout->b_active = 0;
680 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, 1 );
682 case SIGUSR2: /* vt has been acquired */
683 p_vout->b_active = 1;
684 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, VT_ACTIVATE );
685 /* handle blanking */
686 vlc_mutex_lock( &p_vout->change_lock );
687 p_vout->i_changes |= VOUT_SIZE_CHANGE;
688 vlc_mutex_unlock( &p_vout->change_lock );
693 vlc_mutex_unlock( &p_vout_bank->lock );
697 /*****************************************************************************
698 * TextMode and GfxMode : switch tty to text/graphic mode
699 *****************************************************************************
700 * These functions toggle the tty mode.
701 *****************************************************************************/
702 static void TextMode( int i_tty )
704 /* return to text mode */
705 if( -1 == ioctl(i_tty, KDSETMODE, KD_TEXT) )
707 //X msg_Err( p_vout, "failed ioctl KDSETMODE KD_TEXT" );
711 static void GfxMode( int i_tty )
713 /* switch to graphic mode */
714 if( -1 == ioctl(i_tty, KDSETMODE, KD_GRAPHICS) )
716 //X msg_Err( p_vout, "failed ioctl KDSETMODE KD_GRAPHICS" );