* s13d...fb fill_rect accel giving wrong color
@ 2009-04-20 18:22 Kristoffer Ericson
2009-04-20 19:08 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Kristoffer Ericson @ 2009-04-20 18:22 UTC (permalink / raw)
To: linux-fbdev-devel@lists.sourceforge.net
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/DIRECTCOLOR
cfb_fillrect : pseudo_palette[0] = 0
cfb_fillrect : bpp=16, width=640, height=232
cfb_fillrect : pat=0
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[3] = 1365
cfb_fillrect : bpp=16, width=248, height=8
cfb_fillrect : pat=89458005
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[1] = 21
cfb_fillrect : bpp=16, width=112, height=8
cfb_fillrect : pat=1376277
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[3] = 1365
cfb_fillrect : bpp=16, width=112, height=8
cfb_fillrect : pat=89458005
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[1] = 21
cfb_fillrect : bpp=16, width=280, height=8
cfb_fillrect : pat=1376277
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[1] = 21
cfb_fillrect : bpp=16, width=280, height=8
cfb_fillrect : pat=1376277
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[1] = 21
cfb_fillrect : bpp=16, width=112, height=8
cfb_fillrect : pat=1376277
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[3] = 1365
cfb_fillrect : bpp=16, width=112, height=8
cfb_fillrect : pat=89458005
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[1] = 21
cfb_fillrect : bpp=16, width=112, height=8
cfb_fillrect : pat=1376277
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[3] = 1365
cfb_fillrect : bpp=16, width=112, height=8
cfb_fillrect : pat=89458005
cfb_fillrect : TRUECOLOR/DIRECTCOLOR
cfb_fillrect : pseudo_palette[0] = 0
cfb_fillrect : bpp=16, width=640, height=240
cfb_fillrect : pat=0
--
Kristoffer Ericson <kristoffer.ericson@gmail.com>
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: s13d...fb fill_rect accel giving wrong color
2009-04-20 18:22 s13d...fb fill_rect accel giving wrong color Kristoffer Ericson
@ 2009-04-20 19:08 ` Geert Uytterhoeven
2009-04-21 13:36 ` Kristoffer Ericson
2009-05-16 18:03 ` Kristoffer Ericson
0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2009-04-20 19:08 UTC (permalink / raw)
To: Kristoffer Ericson; +Cc: linux-fbdev-devel@lists.sourceforge.net
On Mon, Apr 20, 2009 at 20:22, Kristoffer Ericson
<kristoffer.ericson@gmail.com> wrote:
> 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.
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
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: s13d...fb fill_rect accel giving wrong color
2009-04-20 19:08 ` Geert Uytterhoeven
@ 2009-04-21 13:36 ` Kristoffer Ericson
2009-05-16 18:03 ` Kristoffer Ericson
1 sibling, 0 replies; 4+ messages in thread
From: Kristoffer Ericson @ 2009-04-21 13:36 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-fbdev-devel@lists.sourceforge.net
On Mon, 20 Apr 2009 21:08:21 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Mon, Apr 20, 2009 at 20:22, Kristoffer Ericson
> <kristoffer.ericson@gmail.com> wrote:
> > 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.
Ah, thats about what I guessed.
>
> 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.
>
> 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 <kristoffer.ericson@gmail.com>
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: s13d...fb fill_rect accel giving wrong color
2009-04-20 19:08 ` Geert Uytterhoeven
2009-04-21 13:36 ` Kristoffer Ericson
@ 2009-05-16 18:03 ` Kristoffer Ericson
1 sibling, 0 replies; 4+ messages in thread
From: Kristoffer Ericson @ 2009-05-16 18:03 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-fbdev-devel@lists.sourceforge.net
On Mon, 20 Apr 2009 21:08:21 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Mon, Apr 20, 2009 at 20:22, Kristoffer Ericson
> <kristoffer.ericson@gmail.com> wrote:
> > 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 <kristoffer.ericson@gmail.com>
------------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-16 17:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 18:22 s13d...fb fill_rect accel giving wrong color Kristoffer Ericson
2009-04-20 19:08 ` Geert Uytterhoeven
2009-04-21 13:36 ` Kristoffer Ericson
2009-05-16 18:03 ` Kristoffer Ericson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).