linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Hague <jim.hague@acm.org>
To: linux-fbdev-devel@lists.sourceforge.net,
	Andrew Morton <akpm@osdl.org>, Antonino Daplas <adaplas@pol.net>
Cc: Ron Murray <murrayr@dor.state.ma.us>
Subject: [PATCH] pm2fb: fix fbi image display on 24 bit depth big endian
Date: Fri, 10 Dec 2004 11:50:25 +0000	[thread overview]
Message-ID: <20041210115025.3cf76342@hagrid.bear-cave.org.uk> (raw)

  Handle 24bit on big-endian by leaving the hardware in RGB and using the
  colour offset to reverse red/blue. Leaving the hardware in RGB means
  that fbi displays images correctly (abeit fortuitously) and the console
  is correct, thanks to a recent patch to the console code correcting
  an endian bug in fbcon_putc().

  Signed-off-by: Jim Hague <jim.hague@acm.org>

diff -rN -u linux-old/drivers/video/pm2fb.c linux-new/drivers/video/pm2fb.c
--- linux-old/drivers/video/pm2fb.c     2004-12-10 11:25:35.000000000 +0000
+++ linux-new/drivers/video/pm2fb.c     2004-12-08 19:53:35.000000000 +0000
@@ -646,12 +646,22 @@
        case 32:
                var->transp.offset = 24;
                var->transp.length = 8;
-       case 24:
                var->red.offset   = 16;
                var->green.offset = 8;
                var->blue.offset  = 0;
                var->red.length = var->green.length = var->blue.length = 8;
                break;
+       case 24:
+#ifdef __BIG_ENDIAN
+               var->red.offset   = 0;
+               var->blue.offset  = 16;
+#else
+               var->red.offset   = 16;
+               var->blue.offset  = 0;
+#endif
+               var->green.offset = 8;
+               var->red.length = var->green.length = var->blue.length = 8;
+               break;
        }
        var->height = var->width = -1;

@@ -789,10 +799,6 @@
        case 24:
                pm2_WR(par, PM2R_FB_READ_PIXEL, 4);
                clrmode |= PM2F_RD_TRUECOLOR | PM2F_RD_PIXELFORMAT_RGB888;
-#ifdef __BIG_ENDIAN
-               /* Use BGR not RGB */
-               clrmode &= ~PM2F_RD_COLOR_MODE_RGB;
-#endif
                txtmap = PM2F_TEXTEL_SIZE_24;
                pixsize = 4;
                clrformat = 0x20;


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

                 reply	other threads:[~2004-12-10 11:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041210115025.3cf76342@hagrid.bear-cave.org.uk \
    --to=jim.hague@acm.org \
    --cc=adaplas@pol.net \
    --cc=akpm@osdl.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=murrayr@dor.state.ma.us \
    /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).