[MPlayer-dev-eng] [PATCH] fix vo fbdev in directcolor modes

Alan Curry pacman at theworld.com
Mon Feb 13 08:02:58 CET 2006


The colormap save and restore code in vo_fbdev is broken; the caller of
FBIOGETCMAP must allocate space for the reds, greens, and blues as well as
for the struct that points to them. This only affects fb drivers that work in
directcolor mode instead of truecolor mode, like radeonfb. This patch makes
vo_fbdev work for me with radeonfb, which it didn't before.

The patch also fixes the same problem with fbdev2, and afterward fbdev2 works
at least some of the time (it still has some other problems)

-------------- next part --------------
Index: libvo/vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.92
diff -u -r1.92 vo_fbdev.c
--- libvo/vo_fbdev.c	5 Aug 2005 01:24:36 -0000	1.92
+++ libvo/vo_fbdev.c	13 Feb 2006 06:07:56 -0000
@@ -549,7 +549,8 @@
 static struct fb_fix_screeninfo fb_finfo;
 static struct fb_var_screeninfo fb_orig_vinfo;
 static struct fb_var_screeninfo fb_vinfo;
-static struct fb_cmap fb_oldcmap;
+static unsigned short fb_ored[256], fb_ogreen[256], fb_oblue[256];
+static struct fb_cmap fb_oldcmap = { 0, 256, fb_ored, fb_ogreen, fb_oblue };
 static int fb_cmap_changed = 0;
 static int fb_pixel_size;	// 32:  4  24:  3  16:  2  15:  2
 static int fb_bpp;		// 32: 32  24: 24  16: 16  15: 15
Index: libvo/vo_fbdev2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev2.c,v
retrieving revision 1.7
diff -u -r1.7 vo_fbdev2.c
--- libvo/vo_fbdev2.c	5 Aug 2005 01:24:36 -0000	1.7
+++ libvo/vo_fbdev2.c	13 Feb 2006 06:07:58 -0000
@@ -72,7 +72,8 @@
 static struct fb_fix_screeninfo fb_finfo; // fixed info
 static struct fb_var_screeninfo fb_vinfo; // variable info
 static struct fb_var_screeninfo fb_orig_vinfo; // variable info to restore later
-static struct fb_cmap fb_oldcmap; // cmap to restore later
+static unsigned short fb_ored[256], fb_ogreen[256], fb_oblue[256];
+static struct fb_cmap fb_oldcmap = { 0, 256, fb_ored, fb_ogreen, fb_oblue };
 static int fb_cmap_changed = 0; //  to restore map
 static int fb_pixel_size;	// 32:  4  24:  3  16:  2  15:  2
 static int fb_bpp;		// 32: 32  24: 24  16: 16  15: 15


More information about the MPlayer-dev-eng mailing list