lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0611211507290.32103@pentafluge.infradead.org>
Date:	Tue, 21 Nov 2006 18:02:12 +0000 (GMT)
From:	James Simmons <jsimmons@...radead.org>
To:	Franck Bui-Huu <vagabon.xyz@...il.com>
cc:	Linux Fbdev development list 
	<linux-fbdev-devel@...ts.sourceforge.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...l.org>
Subject: Re: [Linux-fbdev-devel] fbmem: is bootup logo broken for monochrome
 LCD ?


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

I thought so. 

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

Nope. I have tested it on 4bpp and above. No monochrome. 
 
> 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.

Lets look at the new code that I have done with your above parameters. 

       for (i = image->height; i--; ) {
               shift = val = 0;
               n = image->width;
               dst = (u32 __iomem *) dst1;

		while (n--) {
			if (!s) { src++; s = 32; }
			s -= 1;
			color = (swapb32p(src) & (1 << s)) ? 1 : 0;
			val |= color << shift;

		       /* Did the bitshift spill bits to the next long? */
                       if (shift >= 31) {
                               FB_WRITEL(val, dst++);
                               val = (shift == 31) ? 0 :(color >> (32 - shift));
                       }
                       shift += 1;
                       shift &= (32 - 1);
               }

               [ ...]

with 's' taking values from 31 to 0, and 'shift' taking values from 0 to 
31. In the case of bits_per_pixel = 1 we have 

s -= 1;
color = (swapb32p(src) & (1 << s)) ? 1 : 0;
val |= color << shift;

which reduces to val = color;

I'm I seeing it wrong? BTW what is your visual? 



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ