linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fbtest 24bpp bug?
@ 2011-08-21 21:07 Ondrej Zary
  0 siblings, 0 replies; only message in thread
From: Ondrej Zary @ 2011-08-21 21:07 UTC (permalink / raw)
  To: linux-fbdev

Hello,
I have problems testing "new" driver (i740fb) with fbtest. 8bpp, 16bpp and
32bpp modes work fine. But 24bpp does not. In test003, colors are completely
wrong - I get 1- or 2-pixel wide vertical lines instead of color bars.
The same problem appears with matroxfb but not with aty128fb (see below).

cfb_fill_rect() in drawops/cfb.c tries to do some magic to speed things up.
But it seems that it does it wrong. I replaced that code with this:
    int i,j;
    for (i = y; i < y+height; i++) {
        for (j = x; j < x+width; j++) {
                fb[(j + i*1280)*3 + 0] = pixel & 0xff;
                fb[(j + i*1280)*3 + 1] = (pixel & 0xff00) >> 8;
                fb[(j + i*1280)*3 + 2] = (pixel & 0xff0000) >> 16;
        }
    }
(testing at 1280x1024)
and it works fine! So next thing: dump fb contents (for the first blue bar)
in both cases and compare:

original code resulted in this:
cfb_fill_rect x=0 y=0 w€ h\x1024, pixel=0xaa, bpp$, next_line840
pat=0xaa00
00aa00 000000 aa00aa 0000aa 00aa00 000000 aa00aa 0000aa ...... (by pixels)
00aa0000 0000aa00 aa0000aa 00aa0000 0000aa00 aa0000aa ........ (by patterns)

my code:
cfb_fill_rect x=0 y=0 w€ h\x1024, pixel=0xaa, bpp$, next_line840
aa0000 aa0000 aa0000 aa0000 aa0000 aa0000 aa0000 aa0000 ...... (by pixels)
aa0000aa 0000aa00 00aa0000 aa0000aa 0000aa00 00aa0000 ........ (by patterns)

So the first pattern is wrong? And seems to rotate the wrong way too?


aty128fb seems to use some HW palette?:
cfb_fill_rect x=0 y=0 w€ h\x1024, pixel=0x10101, bpp$, next_line840
pat=0x1010101
010101 010101 010101 010101 010101 010101 010101 010101 ...... (by pixels)
01010101 01010101 01010101 01010101 01010101 01010101 ........ (by patterns)

No matter how you rotate that, it will be always ok!

-- 
Ondrej Zary

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-21 21:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-21 21:07 fbtest 24bpp bug? Ondrej Zary

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).