From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: adaplas@gmail.com
Cc: Andrew Morton <akpm@osdl.org>,
Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Console rotation problems
Date: Thu, 24 Nov 2005 14:05:42 +1100 [thread overview]
Message-ID: <1132801542.26560.402.camel@gaston> (raw)
In-Reply-To: <1132796831.26560.392.camel@gaston>
Remove bogus usage of test/set_bit() from fbcon rotation code and just
manipulate the bits directly. This fixes an oops on powerpc among others
and should be faster. Seems to work fine on the G5 here.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
And here is the fix. Tony, did I miss something ?
Index: linux-serialfix/drivers/video/console/fbcon_rotate.h
===================================================================
--- linux-serialfix.orig/drivers/video/console/fbcon_rotate.h 2005-11-23 11:07:23.000000000 +1100
+++ linux-serialfix/drivers/video/console/fbcon_rotate.h 2005-11-24 14:02:22.000000000 +1100
@@ -21,21 +21,13 @@
(s == SCROLL_REDRAW || s == SCROLL_MOVE || !(i)->fix.xpanstep) ? \
(i)->var.xres : (i)->var.xres_virtual; })
-/*
- * The bitmap is always big endian
- */
-#if defined(__LITTLE_ENDIAN)
-#define FBCON_BIT(b) (7 - (b))
-#else
-#define FBCON_BIT(b) (b)
-#endif
static inline int pattern_test_bit(u32 x, u32 y, u32 pitch, const char *pat)
{
u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
pat +=index;
- return (test_bit(FBCON_BIT(bit), (void *)pat));
+ return (*pat) & (0x80 >> bit);
}
static inline void pattern_set_bit(u32 x, u32 y, u32 pitch, char *pat)
@@ -43,7 +35,8 @@ static inline void pattern_set_bit(u32 x
u32 tmp = (y * pitch) + x, index = tmp / 8, bit = tmp % 8;
pat += index;
- set_bit(FBCON_BIT(bit), (void *)pat);
+
+ (*pat) |= 0x80 >> bit;
}
static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
Index: linux-serialfix/drivers/video/console/fbcon_ccw.c
===================================================================
--- linux-serialfix.orig/drivers/video/console/fbcon_ccw.c 2005-11-15 11:54:14.000000000 +1100
+++ linux-serialfix/drivers/video/console/fbcon_ccw.c 2005-11-24 14:03:48.000000000 +1100
@@ -34,7 +34,7 @@ static inline void ccw_update_attr(u8 *d
msk <<= (8 - mod);
if (offset > mod)
- set_bit(FBCON_BIT(7), (void *)&msk1);
+ msk1 |= 0x01;
for (i = 0; i < vc->vc_font.width; i++) {
for (j = 0; j < width; j++) {
next prev parent reply other threads:[~2005-11-24 3:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-24 0:45 Console rotation problems Benjamin Herrenschmidt
2005-11-24 0:52 ` Benjamin Herrenschmidt
2005-11-24 1:47 ` Benjamin Herrenschmidt
2005-11-24 3:05 ` Benjamin Herrenschmidt [this message]
2005-11-24 6:29 ` Antonino A. Daplas
2005-11-24 9:43 ` [Linux-fbdev-devel] " Geert Uytterhoeven
2005-11-24 10:13 ` Antonino A. Daplas
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=1132801542.26560.402.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=adaplas@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.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