# HG changeset patch # User arpi # Date 1013217022 0 # Node ID 6f54ae46ac27e0fed8d384e65a6e3f17756f051a # Parent ca6d74f72734fd444c675b69a799e3bdabcc5541 screensize from fbdev ioctl - patch by Jason Lunz diff -r ca6d74f72734 -r 6f54ae46ac27 libvo/vo_mga.c --- a/libvo/vo_mga.c Sat Feb 09 00:49:38 2002 +0000 +++ b/libvo/vo_mga.c Sat Feb 09 01:10:22 2002 +0000 @@ -38,6 +38,7 @@ #include #include #include +#include #include "drivers/mga_vid.h" #include "sub.h" @@ -54,11 +55,30 @@ #include "mga_common.c" +#define FBDEV "/dev/fb0" + static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) { char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid"; + if(!vo_screenwidth || !vo_screenheight) { + int fd; + struct fb_var_screeninfo fbinfo; + + if(-1 != (fd = open(FBDEV, O_RDONLY))) { + if(0 == ioctl(fd, FBIOGET_VSCREENINFO, &fbinfo)) { + if(!vo_screenwidth) vo_screenwidth = fbinfo.xres; + if(!vo_screenheight) vo_screenheight = fbinfo.yres; + } else { + perror("FBIOGET_VSCREENINFO"); + } + close(fd); + } else { + perror(FBDEV); + } + } + if(vo_screenwidth && vo_screenheight){ aspect_save_orig(width,height); aspect_save_prescale(d_width,d_height);