2 * output through mga_vid kernel driver
12 #include "video_out.h"
13 #include "video_out_internal.h"
15 #include <sys/ioctl.h>
21 #include "drivers/mga_vid.h"
25 static const vo_info_t info
=
27 "Matrox G200/G4x0/G550 overlay (/dev/mga_vid)",
30 "Based on some code by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>"
33 const LIBVO_EXTERN(mga
)
35 #include "mga_common.c"
37 #define FBDEV "/dev/fb0"
39 static int config(uint32_t width
, uint32_t height
, uint32_t d_width
, uint32_t d_height
, uint32_t flags
, char *title
, uint32_t format
)
42 // if (f >= 0) mga_uninit();
43 if(!vo_screenwidth
|| !vo_screenheight
) {
45 struct fb_var_screeninfo fbinfo
;
47 if(-1 != (fd
= open(FBDEV
, O_RDONLY
))) {
48 if(0 == ioctl(fd
, FBIOGET_VSCREENINFO
, &fbinfo
)) {
49 if(!vo_screenwidth
) vo_screenwidth
= fbinfo
.xres
;
50 if(!vo_screenheight
) vo_screenheight
= fbinfo
.yres
;
52 perror("FBIOGET_VSCREENINFO");
60 if(vo_screenwidth
&& vo_screenheight
){
61 aspect_save_orig(width
,height
);
62 aspect_save_prescale(d_width
,d_height
);
63 aspect_save_screenres(vo_screenwidth
,vo_screenheight
);
65 if(flags
&VOFLAG_FULLSCREEN
) { /* -fs */
66 aspect(&d_width
,&d_height
,A_ZOOM
);
69 aspect(&d_width
,&d_height
,A_NOZOOM
);
72 mp_msg(MSGT_VO
,MSGL_INFO
, MSGTR_LIBVO_MGA_AspectResized
,d_width
,d_height
);
75 vo_dwidth
=d_width
; vo_dheight
=d_height
;
76 mga_vid_config
.dest_width
= d_width
;
77 mga_vid_config
.dest_height
= d_height
;
78 mga_vid_config
.x_org
= 0; // (720-mga_vid_config.dest_width)/2;
79 mga_vid_config
.y_org
= 0; // (576-mga_vid_config.dest_height)/2;
80 if(vo_screenwidth
&& vo_screenheight
){
81 mga_vid_config
.x_org
=(vo_screenwidth
-d_width
)/2;
82 mga_vid_config
.y_org
=(vo_screenheight
-d_height
)/2;
85 return mga_init(width
,height
,format
);
88 static void uninit(void)
90 mp_msg(MSGT_VO
,MSGL_INFO
, MSGTR_LIBVO_MGA_Uninit
);
94 static void flip_page(void)
100 static void check_events(void)