summaryrefslogtreecommitdiffstats
path: root/libvo/vo_mga.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-09 01:10:22 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-09 01:10:22 +0000
commit5f2a21728eba00e1e8eab6990051fdc45b6eac6d (patch)
treee80d5ca2884027565a868a1557ee5b23eabd37c5 /libvo/vo_mga.c
parent6fe71521d734a29f63020cac1cbd3f2b21c7a0b0 (diff)
downloadmpv-5f2a21728eba00e1e8eab6990051fdc45b6eac6d.tar.bz2
mpv-5f2a21728eba00e1e8eab6990051fdc45b6eac6d.tar.xz
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4596 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_mga.c')
-rw-r--r--libvo/vo_mga.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libvo/vo_mga.c b/libvo/vo_mga.c
index a3836b1002..5e0314cfff 100644
--- a/libvo/vo_mga.c
+++ b/libvo/vo_mga.c
@@ -38,6 +38,7 @@ LIBVO_EXTERN(mga)
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
+#include <linux/fb.h>
#include "drivers/mga_vid.h"
#include "sub.h"
@@ -54,11 +55,30 @@ static vo_info_t vo_info =
#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);