bug in fbmem.c,

Vignaud Jean-Baptiste (jbv@club-internet.fr)
Tue, 22 Jun 1999 10:57:12 +0200


Hi,

I'v traced a little bug in the fbmem code. i don't know if it's the right
way to
correct it, but on my SX164 alpha this seems to work.

before the patch: cat /dev/fb0 > foo end with an execption.
after the patch: cat /dev/fb0 > foo ; cat foo > /dev/fb0 work.

There are others problems with the fbdriver on alpha:
mmapping the /dev/fb0 and writing to it give me a *RANDOM* 'PYXIS machine
check NOT expected'
with no effect on the screen.
Maybe someone have an idea?

Jean-Baptiste Vignaud.

--- fbmem.c Wed Mar 17 18:17:22 1999
+++ fbmem.c.new Tue Jun 22 11:04:03 1999
@@ -30,7 +30,7 @@
#if defined(__mc68000__) || defined(CONFIG_APUS)
#include <asm/setup.h>
#endif
-#ifdef __powerpc__
+#if defined(__powerpc__) || defined(__alpha__)
#include <asm/io.h>
#endif
#include <asm/uaccess.h>
@@ -251,8 +251,7 @@
fb->fb_get_fix(&fix,PROC_CONSOLE(), info);
base_addr=info->disp->screen_base;
copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
- if (copy_to_user(buf, base_addr+p, copy_size))
- return -EFAULT;
+ memcpy_fromio(buf, base_addr+p, copy_size);
*ppos += copy_size;
return copy_size;
}
@@ -275,8 +274,7 @@
fb->fb_get_fix(&fix, PROC_CONSOLE(), info);
base_addr=info->disp->screen_base;
copy_size=(count + p <= fix.smem_len ? count : fix.smem_len - p);
- if (copy_from_user(base_addr+p, buf, copy_size))
- return -EFAULT;
+ memcpy_toio(base_addr+p, buf, copy_size);
file->f_pos += copy_size;
return copy_size;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/