linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Franck Bui-Huu" <vagabon.xyz@gmail.com>
To: James Simmons <jsimmons@infradead.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Fbdev development list
	<linux-fbdev-devel@lists.sourceforge.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: fbmem: is bootup logo broken for monochrome LCD ?
Date: Tue, 21 Nov 2006 10:45:41 +0100	[thread overview]
Message-ID: <cda58cb80611210145ic52001cr38aed6e38797e3a@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0611201636500.17639@pentafluge.infradead.org>

On 11/20/06, James Simmons <jsimmons@infradead.org> wrote:
>
> > On 11/17/06, James Simmons <jsimmons@infradead.org> wrote:
> > >
> > > Are those actually numbers? If they are the problem isn't byte reversal
> > > but bit shifting.
> > >
> > > 1010100 = 54
> > > 0101010 = 2A
> >
> > It's not byte reversal, but _bits_ of each bytes have been inversed
> > (bit7->bit0, bit6->bit1, bit5->bit2, bit4->bit3, bit3->bit4, ...)
> > after calling slow_imageblit(). Is it something expected ?
>
> Yipes!! Bit reversal. I have never seen that before. Is only the logo
> messed up? Slow_imageblit can be called if there is no dword alignment
> for the font bitmaps. So the question is do most if not all our fonts
> look okay?
>

No, it's not an only logo issue. Bit reversals happen for all images
which are passed to slow_imageblit() including all fonts.

Can it be a 'bit_per_pixel = 1' issue ? It seems that this config has
not been widely tested.

If you look at slow_imageblit() current implementation and for example
let's say that at the begining of the function we have:

	- __LITTLE_ENDIAN is defined
	- bpp = 1
	- fgcolor = 1
	- bgcolor = 0
	- start_index = 0

The function core can be simplified into:

	for (i = image->height; i--; ) {
		shift = val = 0;
		l = 8;
		j = image->width;
		dst = (u32 __iomem *) dst1;
		s = src;

		while (j--) {
			l--;
			color = (*s & (1 << l)) ? 1 : 0;
			val |= color << shift;
			
			/* Did the bitshift spill bits to the next long? */
			if (shift >= null_bits) {
				FB_WRITEL(val, dst++);
				val = (shift == null_bits) ? 0 :
					FB_SHIFT_LOW(color,32 - shift);
			}
			shift += 1;
			shift &= (32 - 1);
			if (!l) { l = 8; s++; };
		}

		[ ...]

Doesn't this bit of code do a bit reversal ? Specially these 2
following lines of code:

	color = (*s & (1 << l)) ? 1 : 0;
	val |= color << shift;


with 'l' taking values from 7 to 0, and 'shift' taking values from 0
to 31.

Thanks
		Franck

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  reply	other threads:[~2006-11-21  9:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 16:49 fbmem: is bootup logo broken for monochrome LCD ? Franck Bui-Huu
2006-11-12 22:04 ` James Simmons
2006-11-13  9:53   ` Franck Bui-Huu
2006-11-13 14:17     ` James Simmons
2006-11-13 14:31       ` Franck Bui-Huu
2006-11-13 18:55         ` James Simmons
2006-11-13 18:27       ` Franck Bui-Huu
2006-11-13 18:51         ` James Simmons
2006-11-14  9:44           ` Franck Bui-Huu
2006-11-17 18:40             ` James Simmons
2006-11-17 20:42               ` [Linux-fbdev-devel] " Franck Bui-Huu
2006-11-20 16:42                 ` James Simmons
2006-11-21  9:45                   ` Franck Bui-Huu [this message]
2006-11-21 18:02                     ` James Simmons
2006-11-22  8:48                       ` Franck Bui-Huu
2006-11-22 19:43                         ` James Simmons
2006-11-22 21:04                         ` James Simmons
2006-11-23 14:53                           ` Franck Bui-Huu
2006-11-27 16:01                             ` James Simmons

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=cda58cb80611210145ic52001cr38aed6e38797e3a@mail.gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=akpm@osdl.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@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).