s13d...fb fill_rect accel giving wrong color
Greetings,
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.
So any pointers would be great!
Best wishes
Kristoffer
debug_logs :s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=32, dy=24, stride=1280, dest=30784 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[3] = 1365 s1d13xxxfb_bitblt_solidfill : dx=352, dy=24, stride=1280, dest=31424 s1d13xxxfb_bitblt_solidfill : rect_width=111, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[1] = 21 s1d13xxxfb_bitblt_solidfill : dx=88, dy=64, stride=1280, dest=82096 s1d13xxxfb_bitblt_solidfill : rect_width=463, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[7] = 44373 s1d13xxxfb_bitblt_solidfill : dx=104, dy=88, stride=1280, dest=112848 s1d13xxxfb_bitblt_solidfill : rect_width=431, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[7] = 44373 s1d13xxxfb_bitblt_solidfill : dx=104, dy=96, stride=1280, dest=123088 s1d13xxxfb_bitblt_solidfill : rect_width=151, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[7] = 44373 s1d13xxxfb_bitblt_solidfill : dx=376, dy=96, stride=1280, dest=123632 s1d13xxxfb_bitblt_solidfill : rect_width=159, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[7] = 44373 s1d13xxxfb_bitblt_solidfill : dx=88, dy=112, stride=1280, dest=143536 s1d13xxxfb_bitblt_solidfill : rect_width=463, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[7] = 44373 s1d13xxxfb_bitblt_solidfill : dx=0, dy=0, stride=1280, dest=0 s1d13xxxfb_bitblt_solidfill : rect_width=639, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[0] = 0 s1d13xxxfb_bitblt_solidfill : dx=0, dy=8, stride=1280, dest=10240 s1d13xxxfb_bitblt_solidfill : rect_width=639, rect_height=231 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[0] = 0 s1d13xxxfb_bitblt_solidfill : dx=0, dy=232, stride=1280, dest=296960 s1d13xxxfb_bitblt_solidfill : rect_width=639, rect_height=7 s1d13xxxfb_bitblt_solidfill : xres=640, yres=240, bpp=16 s1d13xxxfb_bitblt_solidfill : ROP=0 s1d13xxxfb_bitblt_solidfill : TRUECOLOR/DIRECTCOLOR s1d13xxxfb_bitblt_solidfill : pseudo_palette[0] = 0
cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[0] = 0cfb_fillrect : bpp=16, width=640, height=232cfb_fillrect : pat=0cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[3] = 1365cfb_fillrect : bpp=16, width=248, height=8cfb_fillrect : pat=89458005cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[1] = 21cfb_fillrect : bpp=16, width=112, height=8cfb_fillrect : pat=1376277cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[3] = 1365cfb_fillrect : bpp=16, width=112, height=8cfb_fillrect : pat=89458005cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[1] = 21cfb_fillrect : bpp=16, width=280, height=8cfb_fillrect : pat=1376277cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[1] = 21cfb_fillrect : bpp=16, width=280, height=8cfb_fillrect : pat=1376277cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[1] = 21cfb_fillrect : bpp=16, width=112, height=8cfb_fillrect : pat=1376277cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[3] = 1365cfb_fillrect : bpp=16, width=112, height=8cfb_fillrect : pat=89458005cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[1] = 21cfb_fillrect : bpp=16, width=112, height=8cfb_fillrect : pat=1376277cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[3] = 1365cfb_fillrect : bpp=16, width=112, height=8cfb_fillrect : pat=89458005cfb_fillrect : TRUECOLOR/DIRECTCOLORcfb_fillrect : pseudo_palette[0] = 0cfb_fillrect : bpp=16, width=640, height=240cfb_fillrect : pat=0
Signature · 8 lines
Kristoffer Ericson <[email protected]> ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
Quoted 11 lines · Kristoffer Ericson
My accelerated
fill_rectis 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_fillrectand my routine and its accessing the same pseudo_palette[x] color.
cfb_fillrectusespixel_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.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
Quoted 14 lines · On Mon, 20 Apr 2009 21:08:21 +0200 Geert Uytterhoeven <[email protected]>…
Quoted 11 lines · Kristoffer Ericson
My accelerated
fill_rectis 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_fillrectand my routine and its accessing the same pseudo_palette[x] color.
cfb_fillrectusespixel_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.
Quoted 5 lines
As
cfb_fillrect()tries to write using quantities of `unsigned long' (either 32 or
64 bit), while your pixels are 16 bit, it usespixel_to_pat()to duplicate the 16 bit
pixel values to fill an `unsigned long' quantity.
Ah, thats about what I guessed.
Quoted 4 lines
For hardware accelerated fillrect, I'd expect you just have to write the 16 bit pixel
value to your hardware's color register.
I tried that, it works well in console (probably due because it always writes black), in mc though instead of filling the "empty" spaces with blue it fills them with black. cfb_fillrect does not have this issue. Got any idea where I could look?
Im basicly down to either rect->color being wrong or that Im writing to the wrong location (which would be odd since everything looks okey aside from the color). *shrug*
I also created an copyarea function which works perfectly fine.
Any guesses are helpful at this point.
Quoted 11 lines
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]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
Signature · 8 lines
Kristoffer Ericson <[email protected]> ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
Quoted 20 lines · On Mon, 20 Apr 2009 21:08:21 +0200 Geert Uytterhoeven <[email protected]>…
Quoted 11 lines · Kristoffer Ericson
My accelerated
fill_rectis 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_fillrectand my routine and its accessing the same pseudo_palette[x] color.
cfb_fillrectusespixel_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 usespixel_to_pat()to duplicate the 16 bit
pixel values to fill an `unsigned long' quantity.
Quoted 3 lines
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.
Quoted 11 lines
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]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
Signature · 8 lines
Kristoffer Ericson <[email protected]> ------------------------------------------------------------------------------ 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