Re: [AD] fbcon driver color depth

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Evert Glebbeek wrote:
On Friday 05 January 2007 23:48, Milan Mimica wrote:
I can easily make set_gfx_mode() fail if the color depth is not supported.

That is the proper behavior. Or see my other post for what could also be proper behavior.

Here's the patch.
It also reverts the changes by the my previous patch (if I haven't applied it no one would have commented on it ::)) although it wouldn't break anything.


--
Milan Mimica
http://sparklet.sf.net
Index: src/linux/fbcon.c
===================================================================
--- src/linux/fbcon.c	(revision 7688)
+++ src/linux/fbcon.c	(working copy)
@@ -332,8 +332,8 @@
 
       /* try to set the mode */
       if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &my_mode) == 0) {
-	 set_color_depth(my_mode.bits_per_pixel);
-	 goto got_a_nice_mode;
+	 if (my_mode.bits_per_pixel == color_depth)
+	    goto got_a_nice_mode;
       }
    }
 
@@ -388,12 +388,11 @@
       v_w = w;
       v_h = h;
 
-      p += (my_mode.xres-w)/2 * BYTES_PER_PIXEL(my_mode.bits_per_pixel) + 
+      p += (my_mode.xres-w)/2 * BYTES_PER_PIXEL(color_depth) + 
 	   (my_mode.yres-h)/2 * stride;
    }
 
-   b = _make_bitmap(v_w, v_h, (unsigned long)p, &gfx_fbcon,
-		    my_mode.bits_per_pixel, stride);
+   b = _make_bitmap(v_w, v_h, (unsigned long)p, &gfx_fbcon, color_depth, stride);
    if (!b) {
       ioctl(fbfd, FBIOPUT_VSCREENINFO, &orig_mode);
       munmap(fbaddr, fix_info.smem_len);
@@ -416,7 +415,7 @@
    gfx_fbcon.desc = fb_desc;
 
    /* set up the truecolor pixel format */
-   switch (my_mode.bits_per_pixel) {
+   switch (color_depth) {
 
       #ifdef ALLEGRO_COLOR16
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/