From: Andrew Morton <akpm@osdl.org>
To: Franck <vagabon.xyz@gmail.com>
Cc: adaplas@pol.net, gregkh@suse.de,
linux-fbdev-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fbcon: Re-fix little-endian bogosity in slow_imageblit()
Date: Fri, 3 Nov 2006 10:58:57 -0800 [thread overview]
Message-ID: <20061103105857.874f566c.akpm@osdl.org> (raw)
In-Reply-To: <454B5866.6000207@innova-card.com>
On Fri, 03 Nov 2006 15:55:34 +0100
Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> From: Franck Bui-Huu <fbuihuu@gmail.com>
>
> This bug has been introduced by commit:
>
> a536093a2f07007aa572e922752b7491b9ea8ff2
>
> This commit fixed the big-endian case but broke the little-endian one.
> This patch revert the previous change and swap the definition of
> FB_BIT_NR() macro between big and little endian. It should work for
> both endianess now.
>
I get worried when I see the word "should" in a changelog.
> ---
>
> This is the most obvious fix for me although it's a bit weird
> that bit ordering depend on platform endianess. I don't know
> fb code so I prefer submitting this trivial fix rather than
> breaking every thing else ;)
>
> drivers/video/cfbimgblt.c | 4 ++--
> include/linux/fb.h | 2 ++
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
> index 51d3538..8f47bf4 100644
> --- a/drivers/video/cfbimgblt.c
> +++ b/drivers/video/cfbimgblt.c
> @@ -168,7 +168,7 @@ static inline void slow_imageblit(const
>
> while (j--) {
> l--;
> - color = (*s & (1 << l)) ? fgcolor : bgcolor;
> + color = (*s & (1 << FB_BIT_NR(l))) ? fgcolor : bgcolor;
> val |= FB_SHIFT_HIGH(color, shift);
So that takes us back to the pre-March 31 code, which was allegedly broken
on big-endian.
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -854,10 +854,12 @@ #define fb_memset memset
> #endif
>
> #if defined (__BIG_ENDIAN)
> +#define FB_BIT_NR(b) (b)
> #define FB_LEFT_POS(bpp) (32 - bpp)
> #define FB_SHIFT_HIGH(val, bits) ((val) >> (bits))
> #define FB_SHIFT_LOW(val, bits) ((val) << (bits))
> #else
> +#define FB_BIT_NR(b) (7 - (b))
> #define FB_LEFT_POS(bpp) (0)
> #define FB_SHIFT_HIGH(val, bits) ((val) << (bits))
> #define FB_SHIFT_LOW(val, bits) ((val) >> (bits))
And that swaps the little-endian and bit-endian implementations of
FB_BIT_NR(). So if it was previously broken on big-endian and was working
on little-endian then it's presumably now broken on little-endian and
working on big-endian. Or something.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
next prev parent reply other threads:[~2006-11-03 18:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 14:55 [PATCH] fbcon: Re-fix little-endian bogosity in slow_imageblit() Franck Bui-Huu
2006-11-03 18:58 ` Andrew Morton [this message]
2006-11-04 9:22 ` Franck Bui-Huu
2006-11-06 9:28 ` [PATCH] fbcon: ReRe-fix " Franck Bui-Huu
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=20061103105857.874f566c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=adaplas@pol.net \
--cc=gregkh@suse.de \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=vagabon.xyz@gmail.com \
/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).