All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reinhard Arlt <reinhard.arlt@esd.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] Wired cursor colors....
Date: Fri, 21 Mar 2014 14:54:04 +0100	[thread overview]
Message-ID: <532C447C.6080802@esd.eu> (raw)

Hello,

here is an idea, how to fix the

void video_invertchar(int xx, int yy)

routine in

cfb_console.c

This is not a patch yet, just a idea.

Reinhard

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 904caf7..33d5a2c 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -619,8 +619,37 @@ static void video_invertchar(int xx, int yy)
         int x, y;
         for (y = firsty; y < lasty; y += VIDEO_LINE_LEN) {
                 for (x = firstx; x < lastx; x++) {
-                       u8 *dest = (u8 *)(video_fb_address) + x + y;
-                       *dest = ~*dest;
+                        u8 *dest8;
+                        u16 *dest16;
+                        u32 *dest32;
+
+                        switch (VIDEO_DATA_FORMAT) {
+                        case GDF__8BIT_INDEX:
+                               dest8 = (u8 *)(video_fb_address) + x + y;
+
+                               *dest8 ^= 0x01;
+                                break;
+
+                       case GDF__8BIT_332RGB:
+                               dest8 = (u8 *)(video_fb_address) + x + y;
+
+                               *dest8 = ~*dest8;
+                                break;
+
+                       case GDF_15BIT_555RGB:
+                       case GDF_16BIT_565RGB:
+                               dest16 = (u16 *)(video_fb_address) + x + y;
+
+                               *dest16 = ~*dest16;
+                                break;
+
+                       case GDF_32BIT_X888RGB:
+                       case GDF_24BIT_888RGB:
+                               dest32 = (u32 *)(video_fb_address) + x + y;
+
+                               *dest32 = ~*dest32;
+                                break;
+                       }
                 }
         }
  }

             reply	other threads:[~2014-03-21 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 13:54 Reinhard Arlt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-21 12:17 [U-Boot] Wired cursor colors Reinhard Arlt

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=532C447C.6080802@esd.eu \
    --to=reinhard.arlt@esd.eu \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.