From: Antonino Daplas <adaplas@pol.net>
To: Paul Mackerras <paulus@samba.org>
Cc: James Simmons <jsimmons@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: [Linux-fbdev-devel] [PATCH] fix endian problem in color_imageblit
Date: 15 Dec 2002 06:05:24 +0500 [thread overview]
Message-ID: <1039914261.1131.70.camel@localhost.localdomain> (raw)
In-Reply-To: <15864.1386.543811.337732@argo.ozlabs.ibm.com>
On Thu, 2002-12-12 at 08:41, Paul Mackerras wrote:
> This patch fixes the endian problems in color_imageblit(). With this
> patch, I get the penguin drawn properly on boot.
>
> The main change is that on big-endian systems, when we load a pixel
> from the source, we now shift it to the left-hand (most significant)
> end of the word. With this change the rest of the logic is correct on
> big-endian systems. This may not be the most efficient way to do
> things but it is a simple change that works and avoids disturbing the
> rest of the code.
>
Nice catch :-) We also need a similar fix for slow_imageblit(), so
James can you apply the attached patch also:
Also, I noticed that some drivers load the pseudo_palette with entries
whose length matches the length of the pixel. The cfb_* functions
always assume that each pseudo_palette entry is an "unsigned long", so
bpp16 will segfault, and so will bpp24/32 for 64-bit machines.
Tony
diff -Naur linux-2.5.51/drivers/video/cfbimgblt.c linux/drivers/video/cfbimgblt.c
--- linux-2.5.51/drivers/video/cfbimgblt.c 2002-12-15 00:54:04.000000000 +0000
+++ linux/drivers/video/cfbimgblt.c 2002-12-15 00:54:21.000000000 +0000
@@ -189,6 +189,7 @@
color = fgcolor;
else
color = bgcolor;
+ color <<= LEFT_POS(bpp);
val |= SHIFT_HIGH(color, shift);
/* Did the bitshift spill bits to the next long? */
Tony
next prev parent reply other threads:[~2002-12-15 1:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-12 3:41 [PATCH] fix endian problem in color_imageblit Paul Mackerras
2002-12-15 1:05 ` Antonino Daplas [this message]
2002-12-20 19:54 ` [Linux-fbdev-devel] " James Simmons
2002-12-21 3:45 ` Antonino Daplas
2002-12-21 9:27 ` [Linux-fbdev-devel] " Russell King
2002-12-23 9:07 ` Geert Uytterhoeven
2002-12-23 11:18 ` Russell King
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=1039914261.1131.70.camel@localhost.localdomain \
--to=adaplas@pol.net \
--cc=jsimmons@infradead.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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).