Thread (19 messages) 19 messages, 2 authors, 2006-11-27

Re: fbmem: is bootup logo broken for monochrome LCD ?

From: Franck Bui-Huu <hidden>
Date: 2006-11-23 14:53:19
Also in: lkml

On 11/22/06, James Simmons [off-list ref] wrote:
Replace the below line in my patch I sent
quoted
quoted
                    val |= color << shift;
with
                        val <<= shift;
                        val |= color;
I think it can't work since shift is 0 to 31, you'll end up with 'val
<<= 31' which I don't think is what you want.

doing
                         val <<= 1;

make it works but it's still very fragile. Code which deals with
trailing bit seems bogus since new value of 'val' is simply discarded
here.

                /* write trailing bits */
                if (shift) {
                        u32 end_mask = (~(u32)0 << shift);

                        val = FB_READL(dst1);
                        val &= end_mask;
                        FB_WRITEL(val, dst1);
                }

Another thing is that I don't see how very small images (for example
when image->width = 4) will be handled.
quoted
quoted
                   /* 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);
               }

               [ ...]
Let me know if that works.
I'm wondering if working with 32 bits words really worth... I mean the
code is quite hard to follow because it needs to deal with endianess,
heading bits, trailings bits whereas working with 8 bits would be so
much easier, wouldn't it ? Are writings in video RAM very long ?

-- 
               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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help