|
From: Geert U. <ge...@li...> - 2002-08-19 09:02:26
|
Hi,
In cfb_copyarea(), `tmp' must be unsigned long because it is used to store
unsigned long values (see patch at the end).
cfb_copyarea() also doesn't clear the bits to modify in the first and last
words of a line, e.g. it does
| last = (FB_READ(src) & start_mask);
|
| if (shift > 0)
| FB_WRITE(FB_READ(dst) | (last >> shift_right), dst);
^^^^^^^^^^^^
After this read, the bits to modify must be cleared first, before the OR!
I'm working on a version of cfb_copyarea() that fixes this and handles _all_
possible values of var.bits_per_pixel (the current code assumes
var.bits_per_pixel is a multiple of 8). Stay tuned!
--- fbdev-2.5/drivers/video/cfbcopyarea.c Mon Aug 19 10:49:58 2002
+++ geert-2.5/devivers/video/cfbcopyarea.c Mon Aug 19 10:55:53 2002
@@ -40,10 +40,10 @@
{
int x2, y2, lineincr, shift, shift_right, shift_left, old_dx, old_dy;
int j, linesize = p->fix.line_length, bpl = sizeof(unsigned long);
- unsigned long start_index, end_index, start_mask, end_mask, last;
+ unsigned long start_index, end_index, start_mask, end_mask, last, tmp;
unsigned long *dst = NULL, *src = NULL;
char *src1, *dst1;
- int tmp, height;
+ int height;
/* clip the destination */
old_dx = area->dx;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li...
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|