1 /*****************************************************************************
2 * fb.c : framebuffer plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: fb.c,v 1.12 2002/01/12 01:25:57 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* */
42 #include <videolan/vlc.h>
45 #include "video_output.h"
47 /*****************************************************************************
48 * Capabilities defined in the other files.
49 *****************************************************************************/
50 static void vout_getfunctions( function_list_t * p_function_list );
52 static int vout_Probe ( probedata_t *p_data );
53 static int vout_Create ( vout_thread_t * );
54 static void vout_Destroy ( vout_thread_t * );
55 static void vout_Render ( vout_thread_t *, picture_t * );
56 static void vout_Display ( vout_thread_t *, picture_t * );
57 static int vout_Manage ( vout_thread_t * );
58 static int vout_Init ( vout_thread_t * );
59 static void vout_End ( vout_thread_t * );
61 static int OpenDisplay ( vout_thread_t * );
62 static void CloseDisplay ( vout_thread_t * );
63 static void SwitchDisplay ( int i_signal );
64 static void TextMode ( int i_tty );
65 static void GfxMode ( int i_tty );
67 /*****************************************************************************
68 * Building configuration tree
69 *****************************************************************************/
74 SET_DESCRIPTION( "Linux console framebuffer module" )
75 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 *****************************************************************************/
92 typedef struct vout_sys_s
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 boolean_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 */
122 /*****************************************************************************
123 * Functions exported as capabilities. They are declared as static so that
124 * we don't pollute the namespace too much.
125 *****************************************************************************/
126 static void vout_getfunctions( function_list_t * p_function_list )
128 p_function_list->pf_probe = vout_Probe;
129 p_function_list->functions.vout.pf_create = vout_Create;
130 p_function_list->functions.vout.pf_init = vout_Init;
131 p_function_list->functions.vout.pf_end = vout_End;
132 p_function_list->functions.vout.pf_destroy = vout_Destroy;
133 p_function_list->functions.vout.pf_manage = vout_Manage;
134 p_function_list->functions.vout.pf_render = vout_Render;
135 p_function_list->functions.vout.pf_display = vout_Display;
138 /*****************************************************************************
139 * vout_Probe: probe the video driver and return a score
140 *****************************************************************************
141 * This function tries to open the framebuffer and returns a score to the
142 * plugin manager so that it can select the best plugin.
143 *****************************************************************************/
144 static int vout_Probe( probedata_t *p_data )
148 i_fd = open( main_GetPszVariable( VOUT_FB_DEV_VAR,
149 VOUT_FB_DEV_DEFAULT ), O_RDWR );
159 /*****************************************************************************
160 * vout_Create: allocates FB video thread output method
161 *****************************************************************************
162 * This function allocates and initializes a FB vout method.
163 *****************************************************************************/
164 static int vout_Create( vout_thread_t *p_vout )
166 struct sigaction sig_tty; /* sigaction for tty change */
167 struct vt_mode vt_mode; /* vt current mode */
168 struct termios new_termios;
170 /* Allocate instance and initialize some members */
171 p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
172 if( p_vout->p_sys == NULL )
177 /* Set tty and fb devices */
178 p_vout->p_sys->i_tty = 0; /* 0 == /dev/tty0 == current console */
180 GfxMode( p_vout->p_sys->i_tty );
182 /* Set keyboard settings */
183 if (tcgetattr(0, &p_vout->p_sys->old_termios) == -1)
185 intf_ErrMsg( "intf error: tcgetattr" );
188 if (tcgetattr(0, &new_termios) == -1)
190 intf_ErrMsg( "intf error: tcgetattr" );
193 /* new_termios.c_lflag &= ~ (ICANON | ISIG);
194 new_termios.c_lflag |= (ECHO | ECHOCTL); */
195 new_termios.c_lflag &= ~ (ICANON);
196 new_termios.c_lflag &= ~(ECHO | ECHOCTL);
197 new_termios.c_iflag = 0;
198 new_termios.c_cc[VMIN] = 1;
199 new_termios.c_cc[VTIME] = 0;
201 if (tcsetattr(0, TCSAFLUSH, &new_termios) == -1)
203 intf_ErrMsg( "intf error: tcsetattr" );
206 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, VT_ACKACQ );
208 /* Set-up tty signal handler to be aware of tty changes */
209 memset( &sig_tty, 0, sizeof( sig_tty ) );
210 sig_tty.sa_handler = SwitchDisplay;
211 sigemptyset( &sig_tty.sa_mask );
212 if( sigaction( SIGUSR1, &sig_tty, &p_vout->p_sys->sig_usr1 ) ||
213 sigaction( SIGUSR2, &sig_tty, &p_vout->p_sys->sig_usr2 ) )
215 intf_ErrMsg( "intf error: can't set up signal handler (%s)",
217 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
218 TextMode( p_vout->p_sys->i_tty );
219 free( p_vout->p_sys );
223 /* Set-up tty according to new signal handler */
224 if( -1 == ioctl( p_vout->p_sys->i_tty,
225 VT_GETMODE, &p_vout->p_sys->vt_mode ) )
227 intf_ErrMsg( "intf error: cant get terminal mode (%s)",
229 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
230 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
231 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
232 TextMode( p_vout->p_sys->i_tty );
233 free( p_vout->p_sys );
236 memcpy( &vt_mode, &p_vout->p_sys->vt_mode, sizeof( vt_mode ) );
237 vt_mode.mode = VT_PROCESS;
239 vt_mode.relsig = SIGUSR1;
240 vt_mode.acqsig = SIGUSR2;
242 if( -1 == ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &vt_mode ) )
244 intf_ErrMsg( "intf error: can't set terminal mode (%s)",
246 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
247 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
248 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
249 TextMode( p_vout->p_sys->i_tty );
250 free( p_vout->p_sys );
254 if( OpenDisplay( p_vout ) )
256 ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &p_vout->p_sys->vt_mode );
257 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
258 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
259 tcsetattr(0, 0, &p_vout->p_sys->old_termios);
260 TextMode( p_vout->p_sys->i_tty );
261 free( p_vout->p_sys );
268 /*****************************************************************************
269 * vout_Init: initialize framebuffer video thread output method
270 *****************************************************************************/
271 static int vout_Init( vout_thread_t *p_vout )
276 I_OUTPUTPICTURES = 0;
278 /* Initialize the output structure: RGB with square pixels, whatever
279 * the input format is, since it's the only format we know */
280 switch( p_vout->p_sys->var_info.bits_per_pixel )
282 case 8: /* FIXME: set the palette */
283 p_vout->output.i_chroma = FOURCC_BI_RGB; break;
285 p_vout->output.i_chroma = FOURCC_RV15; break;
287 p_vout->output.i_chroma = FOURCC_RV16; break;
289 p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
291 p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
293 intf_ErrMsg( "vout error: unknown screen depth" );
297 p_vout->output.i_width = p_vout->p_sys->i_width;
298 p_vout->output.i_height = p_vout->p_sys->i_height;
300 /* Assume we have square pixels */
301 p_vout->output.i_aspect = p_vout->p_sys->i_width
302 * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
304 /* Clear the screen */
305 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
307 /* Try to initialize 1 direct buffer */
310 /* Find an empty picture slot */
311 for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
313 if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
315 p_pic = p_vout->p_picture + i_index;
320 /* Allocate the picture */
326 /* We know the chroma, allocate a buffer which will be used
327 * directly by the decoder */
328 p_pic->p->p_pixels = p_vout->p_sys->p_video;
329 p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
330 p_pic->p->i_lines = p_vout->p_sys->var_info.yres;
332 if( p_vout->p_sys->var_info.xres_virtual )
334 p_pic->p->b_margin = 1;
335 p_pic->p->b_hidden = 1;
336 p_pic->p->i_pitch = p_vout->p_sys->var_info.xres_virtual
337 * p_vout->p_sys->i_bytes_per_pixel;
338 p_pic->p->i_visible_bytes = p_vout->p_sys->var_info.xres
339 * p_vout->p_sys->i_bytes_per_pixel;
343 p_pic->p->b_margin = 0;
344 p_pic->p->i_pitch = p_vout->p_sys->var_info.xres
345 * p_vout->p_sys->i_bytes_per_pixel;
348 /* Only useful for p_vout->p_sys->var_info.bits_per_pixel != 8 */
349 p_pic->p->i_red_mask = ( (1 << p_vout->p_sys->var_info.red.length) - 1 )
350 << p_vout->p_sys->var_info.red.offset;
351 p_pic->p->i_green_mask = ( (1 << p_vout->p_sys->var_info.green.length) - 1 )
352 << p_vout->p_sys->var_info.green.offset;
353 p_pic->p->i_blue_mask = ( (1 << p_vout->p_sys->var_info.blue.length) - 1 )
354 << p_vout->p_sys->var_info.blue.offset;
358 p_pic->i_status = DESTROYED_PICTURE;
359 p_pic->i_type = DIRECT_PICTURE;
361 PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
368 /*****************************************************************************
369 * vout_End: terminate framebuffer video thread output method
370 *****************************************************************************/
371 static void vout_End( vout_thread_t *p_vout )
373 /* Clear the screen */
374 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
377 /*****************************************************************************
378 * vout_Destroy: destroy FB video thread output method
379 *****************************************************************************
380 * Terminate an output method created by vout_CreateOutputMethod
381 *****************************************************************************/
382 static void vout_Destroy( vout_thread_t *p_vout )
384 CloseDisplay( p_vout );
386 /* Reset the terminal */
387 ioctl( p_vout->p_sys->i_tty, VT_SETMODE, &p_vout->p_sys->vt_mode );
389 /* Remove signal handlers */
390 sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
391 sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
393 /* Reset the keyboard state */
394 tcsetattr( 0, 0, &p_vout->p_sys->old_termios );
396 /* Return to text mode */
397 TextMode( p_vout->p_sys->i_tty );
399 /* Destroy structure */
400 free( p_vout->p_sys );
403 /*****************************************************************************
404 * vout_Manage: handle FB events
405 *****************************************************************************
406 * This function should be called regularly by video output thread. It manages
407 * console events. It returns a non null value on error.
408 *****************************************************************************/
409 static int vout_Manage( vout_thread_t *p_vout )
414 if ( read(0, &buf, 1) == 1)
419 p_main->p_intf->b_die = 1;
431 if( p_vout->i_changes & VOUT_SIZE_CHANGE )
433 intf_WarnMsg( 3, "vout: reinitializing framebuffer screen" );
434 p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
436 /* Destroy XImages to change their size */
439 /* Recreate XImages. If SysInit failed, the thread can't go on. */
440 if( vout_Init( p_vout ) )
442 intf_ErrMsg("error: cannot reinit framebuffer screen" );
447 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
450 /* Tell the video output thread that it will need to rebuild YUV
451 * tables. This is needed since conversion buffer size may have changed */
452 p_vout->i_changes |= VOUT_YUV_CHANGE;
459 /*****************************************************************************
460 * vout_Render: renders previously calculated output
461 *****************************************************************************/
462 static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
467 /*****************************************************************************
468 * vout_Display: displays previously rendered output
469 *****************************************************************************
470 * This function send the currently rendered image to FB image, waits until
471 * it is displayed and switch the two rendering buffers, preparing next frame.
472 *****************************************************************************/
473 static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
475 /* swap the two Y offsets if the drivers supports panning */
476 if( p_vout->p_sys->b_pan )
478 p_vout->p_sys->var_info.yoffset = 0;
479 //p_vout->p_sys->var_info.yoffset = p_vout->p_sys->var_info.yres;
481 /* the X offset should be 0, but who knows ...
482 * some other app might have played with the framebuffer */
483 p_vout->p_sys->var_info.xoffset = 0;
485 ioctl( p_vout->p_sys->i_fd,
486 FBIOPAN_DISPLAY, &p_vout->p_sys->var_info );
491 static void vout_SetPalette( p_vout_thread_t p_vout,
492 u16 *red, u16 *green, u16 *blue, u16 *transp )
494 struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
496 ioctl( p_vout->p_sys->i_fd, FBIOPUTCMAP, &cmap );
500 /* following functions are local */
502 /*****************************************************************************
503 * OpenDisplay: initialize framebuffer
504 *****************************************************************************/
505 static int OpenDisplay( vout_thread_t *p_vout )
507 char *psz_device; /* framebuffer device path */
508 struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
510 /* Open framebuffer device */
511 psz_device = main_GetPszVariable( VOUT_FB_DEV_VAR, VOUT_FB_DEV_DEFAULT );
512 p_vout->p_sys->i_fd = open( psz_device, O_RDWR);
513 if( p_vout->p_sys->i_fd == -1 )
515 intf_ErrMsg("vout error: can't open %s (%s)", psz_device, strerror(errno) );
519 /* Get framebuffer device informations */
520 if( ioctl( p_vout->p_sys->i_fd,
521 FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
523 intf_ErrMsg("vout error: can't get fb info (%s)", strerror(errno) );
524 close( p_vout->p_sys->i_fd );
528 if( ioctl( p_vout->p_sys->i_fd,
529 FBIOGET_VSCREENINFO, &p_vout->p_sys->old_info ) )
531 intf_ErrMsg("vout error: can't get 2nd fb info (%s)", strerror(errno) );
532 close( p_vout->p_sys->i_fd );
536 /* Set some attributes */
537 p_vout->p_sys->var_info.activate = FB_ACTIVATE_NXTOPEN;
538 p_vout->p_sys->var_info.xoffset = 0;
539 p_vout->p_sys->var_info.yoffset = 0;
541 if( ioctl( p_vout->p_sys->i_fd,
542 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info ) )
544 intf_ErrMsg(" vout error: can't set fb info (%s)", strerror(errno) );
545 close( p_vout->p_sys->i_fd );
549 /* Get some informations again, in the definitive configuration */
550 if( ioctl( p_vout->p_sys->i_fd, FBIOGET_FSCREENINFO, &fix_info )
551 || ioctl( p_vout->p_sys->i_fd,
552 FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
554 intf_ErrMsg( "vout error: can't get additional fb info (%s)",
557 /* Restore fb config */
558 ioctl( p_vout->p_sys->i_fd,
559 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
561 close( p_vout->p_sys->i_fd );
565 /* FIXME: if the image is full-size, it gets cropped on the left
566 * because of the xres / xres_virtual slight difference */
567 intf_WarnMsg( 3, "vout: %ix%i (virtual %ix%i)",
568 p_vout->p_sys->var_info.xres, p_vout->p_sys->var_info.yres,
569 p_vout->p_sys->var_info.xres_virtual,
570 p_vout->p_sys->var_info.yres_virtual );
572 p_vout->p_sys->i_height = p_vout->p_sys->var_info.yres;
573 p_vout->p_sys->i_width = p_vout->p_sys->var_info.xres_virtual
574 ? p_vout->p_sys->var_info.xres_virtual
575 : p_vout->p_sys->var_info.xres;
577 p_vout->p_sys->p_palette = NULL;
578 p_vout->p_sys->b_pan = ( fix_info.ypanstep || fix_info.ywrapstep );
580 switch( p_vout->p_sys->var_info.bits_per_pixel )
583 p_vout->p_sys->p_palette = malloc( 8 * 256 * sizeof( u16 ) );
584 p_vout->p_sys->fb_cmap.start = 0;
585 p_vout->p_sys->fb_cmap.len = 256;
586 p_vout->p_sys->fb_cmap.red = p_vout->p_sys->p_palette;
587 p_vout->p_sys->fb_cmap.green = p_vout->p_sys->p_palette + 256 * sizeof( u16 );
588 p_vout->p_sys->fb_cmap.blue = p_vout->p_sys->p_palette + 2 * 256 * sizeof( u16 );
589 p_vout->p_sys->fb_cmap.transp = p_vout->p_sys->p_palette + 3 * 256 * sizeof( u16 );
591 /* Save the colormap */
592 ioctl( p_vout->p_sys->i_fd, FBIOGETCMAP, &p_vout->p_sys->fb_cmap );
594 p_vout->p_sys->i_bytes_per_pixel = 1;
599 p_vout->p_sys->i_bytes_per_pixel = 2;
603 p_vout->p_sys->i_bytes_per_pixel = 3;
607 p_vout->p_sys->i_bytes_per_pixel = 4;
611 intf_ErrMsg( "vout error: screen depth %d is not supported",
612 p_vout->p_sys->var_info.bits_per_pixel );
614 /* Restore fb config */
615 ioctl( p_vout->p_sys->i_fd,
616 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
618 close( p_vout->p_sys->i_fd );
622 p_vout->p_sys->i_page_size = p_vout->p_sys->i_width *
623 p_vout->p_sys->i_height * p_vout->p_sys->i_bytes_per_pixel;
625 /* Map a framebuffer at the beginning */
626 p_vout->p_sys->p_video = mmap( 0, p_vout->p_sys->i_page_size,
627 PROT_READ | PROT_WRITE, MAP_SHARED,
628 p_vout->p_sys->i_fd, 0 );
630 if( p_vout->p_sys->p_video == ((void*)-1) )
632 intf_ErrMsg( "vout error: can't map video memory (%s)",
635 if( p_vout->p_sys->var_info.bits_per_pixel == 8 )
637 free( p_vout->p_sys->p_palette );
640 /* Restore fb config */
641 ioctl( p_vout->p_sys->i_fd,
642 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
644 close( p_vout->p_sys->i_fd );
648 intf_WarnMsg( 4, "vout: framebuffer type=%d, visual=%d, ypanstep=%d, "
649 "ywrap=%d, accel=%d", fix_info.type, fix_info.visual,
650 fix_info.ypanstep, fix_info.ywrapstep, fix_info.accel );
654 /*****************************************************************************
655 * CloseDisplay: terminate FB video thread output method
656 *****************************************************************************/
657 static void CloseDisplay( vout_thread_t *p_vout )
660 memset( p_vout->p_sys->p_video, 0, p_vout->p_sys->i_page_size );
662 /* Restore palette */
663 if( p_vout->p_sys->var_info.bits_per_pixel == 8 );
665 ioctl( p_vout->p_sys->i_fd,
666 FBIOPUTCMAP, &p_vout->p_sys->fb_cmap );
667 free( p_vout->p_sys->p_palette );
670 /* Restore fb config */
671 ioctl( p_vout->p_sys->i_fd,
672 FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info );
675 close( p_vout->p_sys->i_fd );
678 /*****************************************************************************
679 * SwitchDisplay: VT change signal handler
680 *****************************************************************************
681 * This function activates or deactivates the output of the thread. It is
682 * called by the VT driver, on terminal change.
683 *****************************************************************************/
684 static void SwitchDisplay(int i_signal)
687 vout_thread_t *p_vout;
689 vlc_mutex_lock( &p_vout_bank->lock );
691 /* XXX: only test the first video output */
692 if( p_vout_bank->i_count )
694 p_vout = p_vout_bank->pp_vout[0];
698 case SIGUSR1: /* vt has been released */
699 p_vout->b_active = 0;
700 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, 1 );
702 case SIGUSR2: /* vt has been acquired */
703 p_vout->b_active = 1;
704 ioctl( p_vout->p_sys->i_tty, VT_RELDISP, VT_ACTIVATE );
705 /* handle blanking */
706 vlc_mutex_lock( &p_vout->change_lock );
707 p_vout->i_changes |= VOUT_SIZE_CHANGE;
708 vlc_mutex_unlock( &p_vout->change_lock );
713 vlc_mutex_unlock( &p_vout_bank->lock );
717 /*****************************************************************************
718 * TextMode and GfxMode : switch tty to text/graphic mode
719 *****************************************************************************
720 * These functions toggle the tty mode.
721 *****************************************************************************/
722 static void TextMode( int i_tty )
724 /* return to text mode */
725 if( -1 == ioctl(i_tty, KDSETMODE, KD_TEXT) )
727 intf_ErrMsg( "intf error: failed ioctl KDSETMODE KD_TEXT" );
731 static void GfxMode( int i_tty )
733 /* switch to graphic mode */
734 if( -1 == ioctl(i_tty, KDSETMODE, KD_GRAPHICS) )
736 intf_ErrMsg( "intf error: failed ioctl KDSETMODE KD_GRAPHICS" );