Re: s13d...fb fill_rect accel giving wrong color
From: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Date: 2009-05-16 17:58:44
On Mon, 20 Apr 2009 21:08:21 +0200 Geert Uytterhoeven [off-list ref] wrote:
On Mon, Apr 20, 2009 at 20:22, Kristoffer Ericson [off-list ref] wrote:quoted
My accelerated fill_rect is working nicely apart from the fact that its giving me the wrong colors. For instance mc has its empty spaces being black when they should be blue.Its doesnt show up in pure console but thats probably since its generally black :) Ive added some debugging code to both cfb_fillrect and my routine and its accessing the same pseudo_palette[x] color. cfb_fillrect uses pixel_to_pat() to get its color value. I havent completely understod whats the purpose of it. I cannot push an 32bit value into my color registers since its only 16bit.As cfb_fillrect() tries to write using quantities of `unsigned long' (either 32 or 64 bit), while your pixels are 16 bit, it uses pixel_to_pat() to duplicate the 16 bit pixel values to fill an `unsigned long' quantity. For hardware accelerated fillrect, I'd expect you just have to write the 16 bit pixel value to your hardware's color register.
Just for future reference. My error was a stupid, I split up the color into 2 bytes and sent them off individually (color >> 8) && 0xff and (color && 0xff). As you can see the correct way would have been (color >> 8) & 0xff and (color & 0xff). Explains why I got the strange colors I got. I had looked at it for so long that I was looking in all the wrong areas. Works like a charm now.
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-- Kristoffer Ericson [off-list ref] ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects