linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: linux-fbdev@vger.kernel.org
Subject: fbtest 24bpp bug?
Date: Sun, 21 Aug 2011 21:07:31 +0000	[thread overview]
Message-ID: <201108212307.34480.linux@rainbow-software.org> (raw)

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

                 reply	other threads:[~2011-08-21 21:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201108212307.34480.linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).