(no subject)

4 messages, 2 authors, 2002-08-25 · open the first message on its own page

(no subject)

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2002-08-19 09:02:18

	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 -- geert@linux-m68k.org

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



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

Re: cfb_copyarea()

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2002-08-19 09:11:55

On Mon, 19 Aug 2002, Geert Uytterhoeven wrote:
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!
                        ^^^^^^^^^^^^^^^
Oops, actually 8, 16, or 32 only (and 24 after Antonino Daplas' patch). I also
plan on relaxing the current limitation that line_size must be a multiple of
sizeof(unsigned long).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

Re: (no subject)

From: James Simmons <hidden>
Date: 2002-08-22 18:53:38

	Hi,

In cfb_copyarea(), `tmp' must be unsigned long because it is used to store
unsigned long values (see patch at the end).
Oops. This might fix the one bug I see sometimes. When I delete some
characters some of the remaining characters get corrputed.
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!
Yeah!!! Will test.




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

Re: cfb_copyarea()

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2002-08-25 15:19:19

On Mon, 19 Aug 2002, Geert Uytterhoeven wrote:
On Mon, 19 Aug 2002, Geert Uytterhoeven wrote:
quoted
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!
                        ^^^^^^^^^^^^^^^
Oops, actually 8, 16, or 32 only (and 24 after Antonino Daplas' patch). I also
plan on relaxing the current limitation that line_size must be a multiple of
sizeof(unsigned long).
A very first version is available in fbtest (module `fbtest' in linux-fbdev's
CVS at sourceforge.net).

More optimizations (e.g. cached first/last masks) to be released later...

Gr{oetje,eeting}s,

						Geert

P.S. Yes, I work in userspace right know ;-)
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help