linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-fbdev-devel@lists.sourceforge.net,
	Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: funny framebuffer fonts on PowerBook with radeonfb
Date: Mon, 27 Mar 2006 09:19:55 +0800	[thread overview]
Message-ID: <44273DBB.9070207@gmail.com> (raw)
In-Reply-To: <20060327004741.GA19187@MAIL.13thfloor.at>

Herbert Poetzl wrote:
> Hey Ben!
> 
> 2.6.16 and 2.6.15-something show a funny behaviour
> when using the radeonfb driver (for text mode), they
> kind of twist and break the fonts in various places
> some characters or parts seem to be mirrored like
> '[' becoming ']' but not on character boundary but
> more on N pixels, colors seem to be correct for the
> characters, and sometimes the font is perfectly fine
> for larger runs, e.g. I can read the logon prompt
> fine, but everything I type is garbled ...
> 
> just for an example, when I type 'echo "Test"' then
> all characters are mirrored and cut off on the right
> side but the locations are as shown above, on enter
> the T is only a few pixels wide, but the est part is
> written perfectly fine ... this is a new behaviour
> and going back to 2.6.13.3 doesn't show this ...
> 
> if there is some testing I can do for you, or when
> you need more info, please let me know. here a few
> details for the machine:
> 

What font are you using? I presume the dimensions are
not divisible by 8.  Can you try this patch?

Tony

diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
index 910e233..8ba6152 100644
--- a/drivers/video/cfbimgblt.c
+++ b/drivers/video/cfbimgblt.c
@@ -169,7 +169,7 @@ static inline void slow_imageblit(const 
 
 		while (j--) {
 			l--;
-			color = (*s & 1 << (FB_BIT_NR(l))) ? fgcolor : bgcolor;
+			color = (*s & (1 << l)) ? fgcolor : bgcolor;
 			val |= FB_SHIFT_HIGH(color, shift);
 			
 			/* Did the bitshift spill bits to the next long? */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 17fc771..4fe1d2d 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -841,12 +841,10 @@ struct fb_info {
 #define FB_LEFT_POS(bpp)          (32 - bpp)
 #define FB_SHIFT_HIGH(val, bits)  ((val) >> (bits))
 #define FB_SHIFT_LOW(val, bits)   ((val) << (bits))
-#define FB_BIT_NR(b)              (7 - (b))
 #else
 #define FB_LEFT_POS(bpp)          (0)
 #define FB_SHIFT_HIGH(val, bits)  ((val) << (bits))
 #define FB_SHIFT_LOW(val, bits)   ((val) >> (bits))
-#define FB_BIT_NR(b)              (b)
 #endif
 
     /*

  parent reply	other threads:[~2006-03-27  1:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-27  0:47 funny framebuffer fonts on PowerBook with radeonfb Herbert Poetzl
2006-03-27  1:17 ` Benjamin Herrenschmidt
2006-03-27  3:37   ` Herbert Poetzl
2006-03-27  5:26     ` Benjamin Herrenschmidt
2006-03-27  7:11       ` [Linux-fbdev-devel] " Antonino A. Daplas
2006-03-27  7:24         ` Kyle Moffett
2006-03-27 11:06       ` Herbert Poetzl
2006-03-27  1:19 ` Antonino A. Daplas [this message]
2006-03-27 11:01   ` Herbert Poetzl
2006-03-27  1:24 ` D. Hazelton

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=44273DBB.9070207@gmail.com \
    --to=adaplas@gmail.com \
    --cc=benh@kernel.crashing.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;
as well as URLs for NNTP newsgroup(s).