[AD] Framebuffer resolution problems

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


I've gone back to old hardware so I have now again a framebuffer
aware computer with a 2.6.10 kernel. The latest CVS doesn't work at
all. Running any program will fail on src/graphics.c:823 which is
a clear_bitmap() call. The problem is that when the code reaches
that line, instead of a 320x200 sized screen I have a 320x32767
sized screen, and on some Y value clear_bitmap starts writting out
of the reserved memory space for the screen, crashing the program.

I reverted modifications by John Utz and Eric (no attribution in
cvs log), basically from 1.29 to 1.27 and now it works again:

Index: fbcon.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/linux/fbcon.c,v
retrieving revision 1.32
diff -u -r1.32 fbcon.c
--- fbcon.c     12 Mar 2005 06:29:05 -0000      1.32
+++ fbcon.c     25 Apr 2005 21:21:10 -0000
@@ -272,7 +272,7 @@
 
    gfx_fbcon.vid_mem = fix_info.smem_len;
 
-   stride = fix_info.line_length;
+   stride = my_mode.xres_virtual * BYTES_PER_PIXEL(color_depth);
    v_w = my_mode.xres_virtual;
    v_h = my_mode.yres_virtual;
    p = fbaddr;

But if the current code works for other framebuffer users, possibly
we have to check some flag in some struct and depending on it use the
old code (which works for me, with a matrox g450) or the current one
(which works for the people requesting those changes).




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