From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757377AbWKWOxT (ORCPT ); Thu, 23 Nov 2006 09:53:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757378AbWKWOxS (ORCPT ); Thu, 23 Nov 2006 09:53:18 -0500 Received: from ug-out-1314.google.com ([66.249.92.169]:10680 "EHLO ug-out-1314.google.com") by vger.kernel.org with ESMTP id S1757377AbWKWOxS (ORCPT ); Thu, 23 Nov 2006 09:53:18 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eXKIDBmn1iOgnNDRHr4uop1wOo1Q1ggiizCUAKxiBShKF077AT4bXDuBnRCDTi50mU73KRRWuvyvJbNxXLzjNta0haVXI5EIM/zVzRJYFG2S2WpUaMSflgXCT1ev4+7aAxT0W9TLXTAn7MvgRhwrWWTFAUfUrMCeIp5r/leAvxM= Message-ID: Date: Thu, 23 Nov 2006 15:53:16 +0100 From: "Franck Bui-Huu" To: "James Simmons" Subject: Re: [Linux-fbdev-devel] fbmem: is bootup logo broken for monochrome LCD ? Cc: "Andrew Morton" , "Linux Fbdev development list" , "Linux Kernel Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45535C08.5020607@innova-card.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/06, James Simmons wrote: > Replace the below line in my patch I sent > > > > 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. > > > /* 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