[PATCH] Fix get_std_timing

STALE8183d

18 messages, 4 authors, 2004-03-12 · open the first message on its own page

[PATCH] Fix get_std_timing

From: Kronos <hidden>
Date: 2004-03-04 22:29:44

Hi,
I thought that this was fixed ages ago, but I see that the bug it's still
here. To recap, get_std_timing will exit after the first iteration on
VESA modedb. Fix is trivial, James please apply:
--- linux-2.6/drivers/video/fbmon.c.orig	Thu Mar  4 23:11:43 2004
+++ linux-2.6/drivers/video/fbmon.c	Thu Mar  4 23:12:46 2004
@@ -572,12 +572,12 @@
 		    vesa_modes[i].yres == yres &&
 		    vesa_modes[i].refresh == refresh) {
 			*mode = vesa_modes[i];
-			break;
-		} else {
-			calc_mode_timings(xres, yres, refresh, mode);
-			break;
+			return 1;
 		}
 	}
+	
+	calc_mode_timings(xres, yres, refresh, mode);
+
 	return 1;
 }
 
Luca
-- 
Home: http://kronoz.cjb.net
Tentare e` il primo passo verso il fallimento.
Homer J. Simpson


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-04 22:45:35

Ug. I applied the fix. I will be pushing the new monitor code as soon as 
ben sends me bugs he found as well.


On Thu, 4 Mar 2004, Kronos wrote:
quoted hunk
Hi,
I thought that this was fixed ages ago, but I see that the bug it's still
here. To recap, get_std_timing will exit after the first iteration on
VESA modedb. Fix is trivial, James please apply:
--- linux-2.6/drivers/video/fbmon.c.orig	Thu Mar  4 23:11:43 2004
+++ linux-2.6/drivers/video/fbmon.c	Thu Mar  4 23:12:46 2004
@@ -572,12 +572,12 @@
 		    vesa_modes[i].yres == yres &&
 		    vesa_modes[i].refresh == refresh) {
 			*mode = vesa_modes[i];
-			break;
-		} else {
-			calc_mode_timings(xres, yres, refresh, mode);
-			break;
+			return 1;
 		}
 	}
+	
+	calc_mode_timings(xres, yres, refresh, mode);
+
 	return 1;
 }
 
Luca


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2004-03-05 02:52:31

On Fri, 2004-03-05 at 09:31, James Simmons wrote:
Ug. I applied the fix. I will be pushing the new monitor code as soon as 
ben sends me bugs he found as well.
I don't have anything with the fbmon at this point. The problems I
have are local to radeonfb, you can go & push that update

Ben.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 18:02:28

On Fri, 5 Mar 2004, Benjamin Herrenschmidt wrote:
On Fri, 2004-03-05 at 09:31, James Simmons wrote:
quoted
Ug. I applied the fix. I will be pushing the new monitor code as soon as 
ben sends me bugs he found as well.
I don't have anything with the fbmon at this point. The problems I
have are local to radeonfb, you can go & push that update
Okay. Then I will send the patch to andrew. The patch is pretty big.
You can grab it at 

http://pheonix.infradead.org/~jsimmons/monitor.diff

Also you can take a look and comment. Its against 2.6.4.





-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Andrew Morton <hidden>
Date: 2004-03-11 18:09:32

James Simmons [off-list ref] wrote:
On Fri, 5 Mar 2004, Benjamin Herrenschmidt wrote:
quoted
On Fri, 2004-03-05 at 09:31, James Simmons wrote:
quoted
Ug. I applied the fix. I will be pushing the new monitor code as soon as 
ben sends me bugs he found as well.
I don't have anything with the fbmon at this point. The problems I
have are local to radeonfb, you can go & push that update
Okay. Then I will send the patch to andrew. The patch is pretty big.
You can grab it at 

http://pheonix.infradead.org/~jsimmons/monitor.diff
         ^^^^^^^  phoenix
Also you can take a look and comment. Its against 2.6.4.
What's it do?


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 18:24:37

Various fixes and enhancements to the monitor hardware detection code.
The only driver that uses it is the radeon driver. Give it a try before 
you apply it.


On Thu, 11 Mar 2004, Andrew Morton wrote:
James Simmons [off-list ref] wrote:
quoted
On Fri, 5 Mar 2004, Benjamin Herrenschmidt wrote:
quoted
On Fri, 2004-03-05 at 09:31, James Simmons wrote:
quoted
Ug. I applied the fix. I will be pushing the new monitor code as soon as 
ben sends me bugs he found as well.
I don't have anything with the fbmon at this point. The problems I
have are local to radeonfb, you can go & push that update
Okay. Then I will send the patch to andrew. The patch is pretty big.
You can grab it at 

http://pheonix.infradead.org/~jsimmons/monitor.diff
         ^^^^^^^  phoenix
quoted
Also you can take a look and comment. Its against 2.6.4.
What's it do?


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Andrew Morton <hidden>
Date: 2004-03-11 18:32:16

James Simmons [off-list ref] wrote:

 Various fixes and enhancements to the monitor hardware detection code.
 The only driver that uses it is the radeon driver. Give it a try before 
 you apply it.
None of my test boxes have radeon.   Your comment makes me worry about the
readiness of this code.   Please say reassuring things to me ;)


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 18:38:32

I tested it with a few drivers in my tree. I'm about to test the radeon 
with the patch. This will be a interesting test since my monitor is a 
Apple cinerma display. 

On Thu, 11 Mar 2004, Andrew Morton wrote:
James Simmons [off-list ref] wrote:
quoted

 Various fixes and enhancements to the monitor hardware detection code.
 The only driver that uses it is the radeon driver. Give it a try before 
 you apply it.
None of my test boxes have radeon.   Your comment makes me worry about the
readiness of this code.   Please say reassuring things to me ;)


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 18:42:00

Ben does your driver support the Rage Theater? That is the card I have at 
my desk.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Kronos <hidden>
Date: 2004-03-11 18:48:08

Il Thu, Mar 11, 2004 at 10:13:34AM -0800, Andrew Morton ha scritto: 
James Simmons [off-list ref] wrote:
quoted

 Various fixes and enhancements to the monitor hardware detection code.
 The only driver that uses it is the radeon driver. Give it a try before 
 you apply it.
None of my test boxes have radeon.   Your comment makes me worry about the
readiness of this code.   Please say reassuring things to me ;)
Old EDID parsing code was very verbose, half of the patch address this
(ie. print lots of stuff iff DEBUG). The other big change is the
FB_MODE_IS_* stuff: we really need a way to know the origin of a video
mode. In this way we can select video mode that comes from EDID instead
of VESA or GTF.

Drivers other than radeonfb won't be affected because they cannot (yet)
get EDID from the monitor and don't use EDID related code.

Luca
-- 
Home: http://kronoz.cjb.net
This message will self distruct in 5 seconds.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 19:50:50

quoted
 Various fixes and enhancements to the monitor hardware detection 
code.
quoted
 The only driver that uses it is the radeon driver. Give it a try before 
 you apply it.
None of my test boxes have radeon.   Your comment makes me worry about the
readiness of this code.   Please say reassuring things to me ;)
I just tested the vanilla kernel with the radeon card. Then I tested it 
with my montior patch. It worked :-) I'm writing to you from that machine. 
So it is safe to apply the patch.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2004-03-11 23:09:59

On Fri, 2004-03-12 at 06:32, James Simmons 
quoted
None of my test boxes have radeon.   Your comment makes me worry about the
readiness of this code.   Please say reassuring things to me ;)
I just tested the vanilla kernel with the radeon card. Then I tested it 
with my montior patch. It worked :-) I'm writing to you from that machine. 
So it is safe to apply the patch.
I'll give it a try. Note that if that's the fbmon changes (plus GTF fix)
that were in the fbdev tree so far, I can confirm they work fine.

Ben.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2004-03-11 23:11:24

On Fri, 2004-03-12 at 05:23, James Simmons wrote:
Ben does your driver support the Rage Theater? That is the card I have at 
my desk.
The Rage Theater per-se isn't a card, but a brand name for cards wich
an additional chip dedicated to video input and TV stuffs.

The core ASIC is one of the normal radeons. Radeonfb should work.

Note that the name "Rage Theater" was also used for mach64 and r128 cards
with the "thater" extension, so it could be any of those ;)

Ben.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2004-03-11 23:12:36

On Fri, 2004-03-12 at 05:20, James Simmons wrote:
I tested it with a few drivers in my tree. I'm about to test the radeon 
with the patch. This will be a interesting test since my monitor is a 
Apple cinerma display. 
Which cinema display ? There is a known problem with the 23" that
I haven't fixed yet that cause some "noise" on the screen.
(well, I have a patch for XFree at least, I can get dual head with 2
cinema displays working :)

Ben.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 23:45:00

quoted
Ben does your driver support the Rage Theater? That is the card I have at 
my desk.
The Rage Theater per-se isn't a card, but a brand name for cards wich
an additional chip dedicated to video input and TV stuffs.

The core ASIC is one of the normal radeons. Radeonfb should work.

Note that the name "Rage Theater" was also used for mach64 and r128 cards
with the "thater" extension, so it could be any of those ;)
I tried it out. Yes I have had fun with eth weird ATI naming scheme 
before :-/ It is a radeon. I plan to do more testing tonight for the stty 
crashes. 




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 23:50:35

quoted
I tested it with a few drivers in my tree. I'm about to test the radeon 
with the patch. This will be a interesting test since my monitor is a 
Apple cinerma display. 
Which cinema display ? 
I use a cinema 22" display. No 23' :-(
There is a known problem with the 23" that
I haven't fixed yet that cause some "noise" on the screen.
(well, I have a patch for XFree at least, I can get dual head with 2
cinema displays working :)
Cool. At work we all use cinem 22" screens. I will see if I can borrow a 
extra monitor. I just have to look for a dual head card.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

Re: Re: [PATCH] Fix get_std_timing

From: James Simmons <hidden>
Date: 2004-03-11 23:51:35

quoted
I just tested the vanilla kernel with the radeon card. Then I tested it 
with my montior patch. It worked :-) I'm writing to you from that machine. 
So it is safe to apply the patch.
I'll give it a try. Note that if that's the fbmon changes (plus GTF fix)
that were in the fbdev tree so far, I can confirm they work fine.
Yes they are. I plan to work on the stty crashes tonight.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

character drawing enhancement.

From: James Simmons <hidden>
Date: 2004-03-12 23:47:06

This patch merges two of the drawing functions. The patch uses aligned 
transfers when possible even on displays where the characters are not byte 
align. Tested on my my laptop for 12 bit width fonts and 8 bit wide fonts. 
It works very nicely. Please apply to your tree for wider testing.
--- linus-2.6/drivers/video/console/fbcon.c	2004-03-10 13:13:16.000000000 -0800
+++ fbdev-2.5/drivers/video/console/fbcon.c	2004-03-10 13:32:10.000000000 -0800
@@ -309,94 +309,6 @@
 }
 
 /*
- * drawing helpers
- */
-static void putcs_unaligned(struct vc_data *vc, struct fb_info *info,
-			    struct fb_image *image, int count,
-			    const unsigned short *s)
-{
-	unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
-	unsigned int width = (vc->vc_font.width + 7) >> 3;
-	unsigned int cellsize = vc->vc_font.height * width;
-	unsigned int maxcnt = info->pixmap.size/cellsize;
-	unsigned int shift_low = 0, mod = vc->vc_font.width % 8;
-	unsigned int shift_high = 8, size, pitch, cnt, k;
-	unsigned int buf_align = info->pixmap.buf_align - 1;
-	unsigned int scan_align = info->pixmap.scan_align - 1;
-	unsigned int idx = vc->vc_font.width >> 3;
-	u8 *src, *dst, *dst0;
-
-	while (count) {
-		if (count > maxcnt)
-			cnt = k = maxcnt;
-		else
-			cnt = k = count;
-
-		image->width = vc->vc_font.width * cnt;
-		pitch = ((image->width + 7) >> 3) + scan_align;
-		pitch &= ~scan_align;
-		size = pitch * vc->vc_font.height + buf_align;
-		size &= ~buf_align;
-		dst0 = fb_get_buffer_offset(info, &info->pixmap, size);
-		image->data = dst0;
-		while (k--) {
-			src = vc->vc_font.data + (scr_readw(s++) & charmask)*
-			cellsize;
-			dst = dst0;
-			fb_move_buf_unaligned(info, &info->pixmap, dst, pitch, src,
-						idx, image->height, shift_high,
-						shift_low, mod);
-			shift_low += mod;
-			dst0 += (shift_low >= 8) ? width : width - 1;
-			shift_low &= 7;
-			shift_high = 8 - shift_low;
-		}
-		info->fbops->fb_imageblit(info, image);
-		image->dx += cnt * vc->vc_font.width;
-		count -= cnt;
-	}
-}
-
-static void putcs_aligned(struct vc_data *vc, struct fb_info *info,
-			  struct fb_image *image, int count,
-			  const unsigned short *s)
-{
-	unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
-	unsigned int width = vc->vc_font.width >> 3;
-	unsigned int cellsize = vc->vc_font.height * width;
-	unsigned int maxcnt = info->pixmap.size/cellsize;
-	unsigned int scan_align = info->pixmap.scan_align - 1;
-	unsigned int buf_align = info->pixmap.buf_align - 1;
-	unsigned int pitch, cnt, size, k;
-	u8 *src, *dst, *dst0;
-
-	while (count) {
-		if (count > maxcnt)
-			cnt = k = maxcnt;
-		else
-			cnt = k = count;
-		
-		pitch = width * cnt + scan_align;
-		pitch &= ~scan_align;
-		size = pitch * vc->vc_font.height + buf_align;
-		size &= ~buf_align;
-		image->width = vc->vc_font.width * cnt;
-		dst0 = fb_get_buffer_offset(info, &info->pixmap, size);
-		image->data = dst0;
-		while (k--) {
-			src = vc->vc_font.data + (scr_readw(s++)&charmask)*cellsize;
-			dst = dst0;
-			fb_move_buf_aligned(info, &info->pixmap, dst, pitch, src,
-						width, image->height);
-			dst0 += width;
-		}
-		info->fbops->fb_imageblit(info, image);
-		image->dx += cnt * vc->vc_font.width;
-		count -= cnt;
-	}
-}
-
-/*
  * Accelerated handlers.
  */
 void accel_bmove(struct vc_data *vc, struct fb_info *info, int sy, 
@@ -430,49 +342,24 @@
 	info->fbops->fb_fillrect(info, &region);
 }	
 
-static void accel_putc(struct vc_data *vc, struct fb_info *info,
-                      int c, int ypos, int xpos)
+void accel_putcs(struct vc_data *vc, struct fb_info *info,
+			const unsigned short *s, int count, int yy, int xx)
 {
 	unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
 	unsigned int width = (vc->vc_font.width + 7) >> 3;
+	unsigned int cellsize = vc->vc_font.height * width;
+	unsigned int maxcnt = info->pixmap.size/cellsize;
 	unsigned int scan_align = info->pixmap.scan_align - 1;
 	unsigned int buf_align = info->pixmap.buf_align - 1;
+	unsigned int shift_low = 0, mod = vc->vc_font.width % 8;
+	unsigned int shift_high = 8, pitch, cnt, size, k;
 	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
 	int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;
-	unsigned int size, pitch;
-	struct fb_image image;
-	u8 *src, *dst;
-
-	image.dx = xpos * vc->vc_font.width;
-	image.dy = ypos * vc->vc_font.height;
-	image.width = vc->vc_font.width;
-	image.height = vc->vc_font.height;
-	image.fg_color = attr_fgcol(fgshift, c);
-	image.bg_color = attr_bgcol(bgshift, c);
-	image.depth = 1;
-
-	pitch = width + scan_align;
-	pitch &= ~scan_align;
-	size = pitch * vc->vc_font.height;
-	size += buf_align;
-	size &= ~buf_align;
-	dst = fb_get_buffer_offset(info, &info->pixmap, size);
-	image.data = dst;
-	src = vc->vc_font.data + (c & charmask) * vc->vc_font.height * width;
-
-	fb_move_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height);
-
-	info->fbops->fb_imageblit(info, &image);
-}
-
-void accel_putcs(struct vc_data *vc, struct fb_info *info,
-			const unsigned short *s, int count, int yy, int xx)
-{
-	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
-	int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;
+	unsigned int idx = vc->vc_font.width >> 3;
 	struct fb_image image;
 	u16 c = scr_readw(s);
-
+	u8 *src, *dst, *dst0;
+	
 	image.fg_color = attr_fgcol(fgshift, c);
 	image.bg_color = attr_bgcol(bgshift, c);
 	image.dx = xx * vc->vc_font.width;
@@ -480,10 +367,41 @@
 	image.height = vc->vc_font.height;
 	image.depth = 1;
 
-	if (!(vc->vc_font.width & 7))
-               putcs_aligned(vc, info, &image, count, s);
-        else
-               putcs_unaligned(vc, info, &image, count, s);
+	while (count) {
+		if (count > maxcnt)
+			cnt = k = maxcnt;
+		else
+			cnt = k = count;
+
+		image.width = vc->vc_font.width * cnt;
+		pitch = ((image.width + 7) >> 3) + scan_align;
+		pitch &= ~scan_align;
+		size = pitch * image.height + buf_align;
+		size &= ~buf_align;
+		dst0 = fb_get_buffer_offset(info, &info->pixmap, size);
+		image.data = dst0;
+		while (k--) {
+			src = vc->vc_font.data + (scr_readw(s++) & charmask)*cellsize;
+			dst = dst0;
+		
+			if (mod) {
+				fb_move_buf_unaligned(info, &info->pixmap, dst, pitch,
+						   src, idx, image.height, shift_high, 
+						   shift_low, mod);
+				shift_low += mod;
+				dst0 += (shift_low >= 8) ? width : width - 1;
+				shift_low &= 7;
+				shift_high = 8 - shift_low;
+			} else {
+				fb_move_buf_aligned(info, &info->pixmap, dst, pitch, 
+						 src, idx, image.height);
+				dst0 += width;
+			}	
+		}
+		info->fbops->fb_imageblit(info, &image);
+		image.dx += cnt * vc->vc_font.width;
+		count -= cnt;
+	}
 }
 
 void accel_clear_margins(struct vc_data *vc, struct fb_info *info,
@@ -724,15 +642,13 @@
 static void fbcon_set_display(struct vc_data *vc, int init, int logo)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
+	int nr_rows, nr_cols, old_rows, old_cols, i, charcnt = 256;
 	struct display *p = &fb_display[vc->vc_num];
-	int nr_rows, nr_cols;
-	int old_rows, old_cols;
 	unsigned short *save = NULL, *r, *q;
-	int i, charcnt = 256;
 	struct font_desc *font;
 
 	if (vc->vc_num != fg_console || (info->flags & FBINFO_FLAG_MODULE) ||
-	    info->fix.type == FB_TYPE_TEXT)
+	    (info->fix.type == FB_TYPE_TEXT))
 		logo = 0;
 
 	info->var.xoffset = info->var.yoffset = p->yscroll = 0;	/* reset wrap/pan */
@@ -958,12 +873,20 @@
 		accel_clear(vc, info, real_y(p, sy), sx, height, width);
 }
 
-
 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
+	unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
+	unsigned int scan_align = info->pixmap.scan_align - 1;
+	unsigned int buf_align = info->pixmap.buf_align - 1;
+	unsigned int width = (vc->vc_font.width + 7) >> 3;
+	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
+	int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;
 	struct display *p = &fb_display[vc->vc_num];
-
+	unsigned int size, pitch;
+	struct fb_image image;
+	u8 *src, *dst;
+	
 	if (!info->fbops->fb_blank && console_blanked)
 		return;
 	if (info->state != FBINFO_STATE_RUNNING)
@@ -972,7 +895,28 @@
 	if (vt_cons[vc->vc_num]->vc_mode != KD_TEXT)
 		return;
 
-	accel_putc(vc, info, c, real_y(p, ypos), xpos);
+	image.dx = xpos * vc->vc_font.width;
+	image.dy = real_y(p, ypos) * vc->vc_font.height;
+	image.width = vc->vc_font.width;
+	image.height = vc->vc_font.height;
+	image.fg_color = attr_fgcol(fgshift, c);
+	image.bg_color = attr_bgcol(bgshift, c);
+	image.depth = 1;
+
+	src = vc->vc_font.data + (c & charmask) * vc->vc_font.height * width;
+
+	pitch = width + scan_align;
+	pitch &= ~scan_align;
+	size = pitch * vc->vc_font.height;
+	size += buf_align;
+	size &= ~buf_align;
+
+	dst = fb_get_buffer_offset(info, &info->pixmap, size);
+	image.data = dst;
+	
+	fb_move_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height);
+
+	info->fbops->fb_imageblit(info, &image);
 }
 
 static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
 




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help