* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
[not found] <58c2Z-8jG-23@gated-at.bofh.it>
@ 2005-11-13 19:41 ` Bodo Eggert
2005-11-13 22:11 ` Antonino A. Daplas
2005-11-13 22:24 ` Samuel Thibault
0 siblings, 2 replies; 22+ messages in thread
From: Bodo Eggert @ 2005-11-13 19:41 UTC (permalink / raw)
To: Antonino A. Daplas, Linus Torvalds, Andrew Morton, Dave Jones,
Jason, Samuel Thibault, Linux Kernel Development
Antonino A. Daplas <adaplas@gmail.com> wrote:
> +++ b/drivers/video/console/vgacon.c
> +#define VGA_FONTWIDTH 8 /* VGA does not support fontwidths != 8 */
This is not true, VGA cards do support fontwidth=9, but the ninth column
can only be blank or (optionally and only in the range of the IBM block
chars) copied from the eighth column, cloning the behaviour of the MDA
graphics card. If you disable this feature, you'll get 90x25 text resolution
within standard VGA timings.
BTW while looking at this file:
1) I see ORIG_VIDEO_EGA_BX (defined to (screen_info.orig_video_ega_bx)
being checked to be 0x10, but I don't find a place where the associated
variable is set to this value. Nor do I get the meaning of this variable
by reading it's name.
2) If the videomode is 7, the card is asumed not to be a VGA card.
VGA does support videomode 7, so this test is wrong. However, I don't
asume this mode to be used on normal systems as nobody complained.
I asume from the fragments I read that the correct fix would be to read
the Display Combination Code for VGA (detects additional CGA and MDA
adapters), then detect EGA (if it is, don't forget to check to check bit
3 of 0x487) and use the return code and finally to use the CRTC address
from the BIOS (The video mode may be set to 5 or 6 in order to make a
mouse driver work in Hercules graphics). In case of EGA, we'll
have to detect additional adapters manually. (Unfortunaly I threw away my
EGA-compatible monitor, so I don't know if I can test it.)
3) Having a text mode is tested by a blacklist of graphic modes. I don't
think this is good, but I've not yet read everything in this file.
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 19:41 ` [PATCH] vgacon: Workaround for resize bug in some chipsets Bodo Eggert
@ 2005-11-13 22:11 ` Antonino A. Daplas
2005-11-13 22:26 ` Mika Penttilä
2005-11-13 22:24 ` Samuel Thibault
1 sibling, 1 reply; 22+ messages in thread
From: Antonino A. Daplas @ 2005-11-13 22:11 UTC (permalink / raw)
To: 7eggert
Cc: Linus Torvalds, Andrew Morton, Dave Jones, Jason, Samuel Thibault,
Linux Kernel Development
Bodo Eggert wrote:
> Antonino A. Daplas <adaplas@gmail.com> wrote:
>
>> +++ b/drivers/video/console/vgacon.c
>> +#define VGA_FONTWIDTH 8 /* VGA does not support fontwidths != 8 */
>
> This is not true, VGA cards do support fontwidth=9, but the ninth column
Yes. What it should mean is that vgacon does not support fontwidths != 8.
> can only be blank or (optionally and only in the range of the IBM block
> chars) copied from the eighth column, cloning the behaviour of the MDA
> graphics card. If you disable this feature, you'll get 90x25 text resolution
> within standard VGA timings.
>
> BTW while looking at this file:
>
> 1) I see ORIG_VIDEO_EGA_BX (defined to (screen_info.orig_video_ega_bx)
> being checked to be 0x10, but I don't find a place where the associated
> variable is set to this value. Nor do I get the meaning of this variable
> by reading it's name.
Set at arch/i386/boot/video.S. It contains the contents of register bx
after calling int 0x10 ah=0x12 bl=0x10.
Tony
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 22:11 ` Antonino A. Daplas
@ 2005-11-13 22:26 ` Mika Penttilä
2005-11-13 23:35 ` Antonino A. Daplas
0 siblings, 1 reply; 22+ messages in thread
From: Mika Penttilä @ 2005-11-13 22:26 UTC (permalink / raw)
To: Antonino A. Daplas
Cc: 7eggert, Linus Torvalds, Andrew Morton, Dave Jones, Jason,
Samuel Thibault, Linux Kernel Development
Antonino A. Daplas wrote:
>Bodo Eggert wrote:
>
>
>>Antonino A. Daplas <adaplas@gmail.com> wrote:
>>
>>
>>
>>>+++ b/drivers/video/console/vgacon.c
>>>+#define VGA_FONTWIDTH 8 /* VGA does not support fontwidths != 8 */
>>>
>>>
>>This is not true, VGA cards do support fontwidth=9, but the ninth column
>>
>>
>
>Yes. What it should mean is that vgacon does not support fontwidths != 8.
>
>
>
I think vgacon doesn't touch the 8/9 pixel setting, so the fonts are hw
extended to 9 pixels by VGA in many modes.
--Mika
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 22:26 ` Mika Penttilä
@ 2005-11-13 23:35 ` Antonino A. Daplas
2005-11-14 3:32 ` H. Peter Anvin
0 siblings, 1 reply; 22+ messages in thread
From: Antonino A. Daplas @ 2005-11-13 23:35 UTC (permalink / raw)
To: Mika Penttilä
Cc: 7eggert, Linus Torvalds, Andrew Morton, Dave Jones, Jason,
Samuel Thibault, Linux Kernel Development
Mika Penttilä wrote:
> Antonino A. Daplas wrote:
>
>> Bodo Eggert wrote:
>>
>>
>>> Antonino A. Daplas <adaplas@gmail.com> wrote:
>>>
>>>
>>>> +++ b/drivers/video/console/vgacon.c
>>>> +#define VGA_FONTWIDTH 8 /* VGA does not support fontwidths
>>>> != 8 */
>>>>
>>> This is not true, VGA cards do support fontwidth=9, but the ninth column
>>>
>>
>> Yes. What it should mean is that vgacon does not support fontwidths
>> != 8.
>>
>>
>>
> I think vgacon doesn't touch the 8/9 pixel setting, so the fonts are hw
> extended to 9 pixels by VGA in many modes.
>
It's not a hardware limitation, but vgacon is hardcoded to accept fonts that are
only 8 pixels wide. You can try it by doing a setfont.
Tony
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 23:35 ` Antonino A. Daplas
@ 2005-11-14 3:32 ` H. Peter Anvin
0 siblings, 0 replies; 22+ messages in thread
From: H. Peter Anvin @ 2005-11-14 3:32 UTC (permalink / raw)
To: linux-kernel
Followup to: <4377CDD8.1000509@gmail.com>
By author: "Antonino A. Daplas" <adaplas@gmail.com>
In newsgroup: linux.dev.kernel
> >>
> >>
> > I think vgacon doesn't touch the 8/9 pixel setting, so the fonts are hw
> > extended to 9 pixels by VGA in many modes.
> >
>
> It's not a hardware limitation, but vgacon is hardcoded to accept fonts that are
> only 8 pixels wide. You can try it by doing a setfont.
>
The *font* is always 8 pixels wide. Whether or not you display it in
8- or 9-pixel mode is irrelevant to the formatting of the font.
In general, for vgacon, it should use the 9-pixel mode, at least by default.
-hpa
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 19:41 ` [PATCH] vgacon: Workaround for resize bug in some chipsets Bodo Eggert
2005-11-13 22:11 ` Antonino A. Daplas
@ 2005-11-13 22:24 ` Samuel Thibault
1 sibling, 0 replies; 22+ messages in thread
From: Samuel Thibault @ 2005-11-13 22:24 UTC (permalink / raw)
To: 7eggert
Cc: Antonino A. Daplas, Linus Torvalds, Andrew Morton, Dave Jones,
Jason, Linux Kernel Development
Bodo Eggert, le Sun 13 Nov 2005 20:41:04 +0100, a écrit :
> 2) If the videomode is 7, the card is asumed not to be a VGA card.
> VGA does support videomode 7, so this test is wrong.
But IIRC, in that case, the VGA board just emulates a MDA adapter, so
using it as an MDA adapter makes sense.
Regards,
Samuel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
@ 2005-11-16 17:58 Jason Dravet
2005-11-16 23:52 ` Samuel Thibault
0 siblings, 1 reply; 22+ messages in thread
From: Jason Dravet @ 2005-11-16 17:58 UTC (permalink / raw)
To: samuel.thibault; +Cc: 7eggert, adaplas, torvalds, akpm, davej, linux-kernel
>From: Samuel Thibault <samuel.thibault@ens-lyon.org>
>To: Jason Dravet <dravet@hotmail.com>
>CC: 7eggert@gmx.de, adaplas@gmail.com, torvalds@osdl.org,
>akpm@osdl.org,davej@redhat.com, linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
>Date: Wed, 16 Nov 2005 03:25:08 +0100
>
>Hi,
>
>Jason Dravet, le Tue 15 Nov 2005 19:50:39 -0600, a écrit :
> > Here are the results:
> > y=25 fonth=16 deffh=16 vidfh=16 scanl=400
> > overflow=ff
> > vsync_end=8f
> > vdisp_end=1f
>
>Ah, this is odd indeed: your hardware uses 800 scanlines
>(overflow:(512+256)+vdisp_end:0x1f), while the actual needed lines
>should be y:25*fonth:16 ... Maybe it is actually using a 32 lines font.
>
>Just to make sure about every VGA bits, could you install the
>svgatextmode package, which holds a getVGAreg command, and run twice
>
>for i in `seq 0 24` ; do getVGAreg CRTC $i ; done
>
>The first time while having a correct full text screen rendering, and
>the second time after vgacon_doresize() has blanked the bottom half of
>the screen.
>
>Regards,
>Samuel
For some reason my custom 2.6.14 kernels no longer boot. While I look into
this here are the results when only half the screen works:
VGA 'CRTC' register, index 0 (=0x0) contains 89 (=0x59 =b01011001)
VGA 'CRTC' register, index 1 (=0x1) contains 79 (=0x4f =b01001111)
VGA 'CRTC' register, index 2 (=0x2) contains 79 (=0x4f =b01001111)
VGA 'CRTC' register, index 3 (=0x3) contains 157 (=0x9d =b10011101)
VGA 'CRTC' register, index 4 (=0x4) contains 84 (=0x54 =b01010100)
VGA 'CRTC' register, index 5 (=0x5) contains 27 (=0x1b =b00011011)
VGA 'CRTC' register, index 6 (=0x6) contains 255 (=0xff =b11111111)
VGA 'CRTC' register, index 7 (=0x7) contains 191 (=0xbf =b10111111)
VGA 'CRTC' register, index 8 (=0x8) contains 0 (=0x00 =b00000000)
VGA 'CRTC' register, index 9 (=0x9) contains 239 (=0xef =b11101111)
VGA 'CRTC' register, index 10 (=0xa) contains 13 (=0x0d =b00001101)
VGA 'CRTC' register, index 11 (=0xb) contains 14 (=0x0e =b00001110)
VGA 'CRTC' register, index 12 (=0xc) contains 40 (=0x28 =b00101000)
VGA 'CRTC' register, index 13 (=0xd) contains 240 (=0xf0 =b11110000)
VGA 'CRTC' register, index 14 (=0xe) contains 42 (=0x2a =b00101010)
VGA 'CRTC' register, index 15 (=0xf) contains 32 (=0x20 =b00100000)
VGA 'CRTC' register, index 16 (=0x10) contains 125 (=0x7d =b01111101)
VGA 'CRTC' register, index 17 (=0x11) contains 143 (=0x8f =b10001111)
VGA 'CRTC' register, index 18 (=0x12) contains 143 (=0x8f =b10001111)
VGA 'CRTC' register, index 19 (=0x13) contains 40 (=0x28 =b00101000)
VGA 'CRTC' register, index 20 (=0x14) contains 31 (=0x1f =b00011111)
VGA 'CRTC' register, index 21 (=0x15) contains 30 (=0x1e =b00011110)
VGA 'CRTC' register, index 22 (=0x16) contains 0 (=0x00 =b00000000)
VGA 'CRTC' register, index 23 (=0x17) contains 163 (=0xa3 =b10100011)
VGA 'CRTC' register, index 24 (=0x18) contains 255 (=0xff =b11111111)
I will send the whole screen results when I find and fix the problem. I am
running the fedora core development system with all but todays updates.
Thanks,
Jason
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-16 17:58 Jason Dravet
@ 2005-11-16 23:52 ` Samuel Thibault
2005-11-17 1:37 ` Jason Dravet
0 siblings, 1 reply; 22+ messages in thread
From: Samuel Thibault @ 2005-11-16 23:52 UTC (permalink / raw)
To: Jason Dravet; +Cc: 7eggert, adaplas, torvalds, akpm, davej, linux-kernel
Hi,
The following patch should correct the issue:
When doublescan mode is in use, scanlines must be doubled.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
--- drivers/video/console/vgacon.c.orig 2005-11-17 00:40:02.000000000 +0100
+++ drivers/video/console/vgacon.c 2005-11-17 00:42:27.000000000 +0100
@@ -502,10 +502,16 @@
{
unsigned long flags;
unsigned int scanlines = height * c->vc_font.height;
- u8 scanlines_lo, r7, vsync_end, mode;
+ u8 scanlines_lo, r7, vsync_end, mode, max_scan;
spin_lock_irqsave(&vga_lock, flags);
+ outb_p(VGA_CRTC_MAX_SCAN, vga_video_port_reg);
+ max_scan = inb_p(vga_video_port_val);
+
+ if (max_scan & 0x80)
+ scanlines <<= 1;
+
outb_p(VGA_CRTC_MODE, vga_video_port_reg);
mode = inb_p(vga_video_port_val);
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-16 23:52 ` Samuel Thibault
@ 2005-11-17 1:37 ` Jason Dravet
0 siblings, 0 replies; 22+ messages in thread
From: Jason Dravet @ 2005-11-17 1:37 UTC (permalink / raw)
To: samuel.thibault; +Cc: 7eggert, adaplas, torvalds, akpm, davej, linux-kernel
>From: Samuel Thibault <samuel.thibault@ens-lyon.org>
>To: Jason Dravet <dravet@hotmail.com>
>CC: 7eggert@gmx.de, adaplas@gmail.com, torvalds@osdl.org,
>akpm@osdl.org,davej@redhat.com, linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
>Date: Thu, 17 Nov 2005 00:52:16 +0100
>
>Hi,
>
>The following patch should correct the issue:
>
>When doublescan mode is in use, scanlines must be doubled.
>
>Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>
>--- drivers/video/console/vgacon.c.orig 2005-11-17 00:40:02.000000000 +0100
>+++ drivers/video/console/vgacon.c 2005-11-17 00:42:27.000000000 +0100
>@@ -502,10 +502,16 @@
> {
> unsigned long flags;
> unsigned int scanlines = height * c->vc_font.height;
>- u8 scanlines_lo, r7, vsync_end, mode;
>+ u8 scanlines_lo, r7, vsync_end, mode, max_scan;
>
> spin_lock_irqsave(&vga_lock, flags);
>
>+ outb_p(VGA_CRTC_MAX_SCAN, vga_video_port_reg);
>+ max_scan = inb_p(vga_video_port_val);
>+
>+ if (max_scan & 0x80)
>+ scanlines <<= 1;
>+
> outb_p(VGA_CRTC_MODE, vga_video_port_reg);
> mode = inb_p(vga_video_port_val);
>
The patch does fix my problem. Thank you Samuel. I really appreciate the
work you and Antonino have done on this issue. I look forward to seeing
this patch in the mainline.
Thanks again,
Jason Dravet
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <58DvZ-6en-1@gated-at.bofh.it>]
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
[not found] <58DvZ-6en-1@gated-at.bofh.it>
@ 2005-11-14 9:24 ` Bodo Eggert
2005-11-14 15:27 ` Jason Dravet
0 siblings, 1 reply; 22+ messages in thread
From: Bodo Eggert @ 2005-11-14 9:24 UTC (permalink / raw)
To: Jason Dravet, adaplas, samuel.thibault, torvalds, akpm, davej,
linux-kernel
Jason Dravet <dravet@hotmail.com> wrote:
> When I run stty rows 20 I get a screen of 80x20. I can see the top 10 rows
> and the bottom 10 rows are invisible.
I asume your VGA indicates that it'll divide it's scanline counter by 2.
Please add a printk("vgacon: mode=%2.2x\n", mode) before line 512 and report
the value. A real fix will depend on this value. In the meantime, removing
the lines 512 and 513 from the original file should be a temporary fix.
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-14 9:24 ` Bodo Eggert
@ 2005-11-14 15:27 ` Jason Dravet
2005-11-14 16:32 ` Bodo Eggert
2005-11-16 0:05 ` Samuel Thibault
0 siblings, 2 replies; 22+ messages in thread
From: Jason Dravet @ 2005-11-14 15:27 UTC (permalink / raw)
To: 7eggert, adaplas, samuel.thibault, torvalds, akpm, davej,
linux-kernel
>From: Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
>Reply-To: 7eggert@gmx.de
>To: Jason Dravet <dravet@hotmail.com>, adaplas@gmail.com,
>samuel.thibault@ens-lyon.org, torvalds@osdl.org, akpm@osdl.org,
>davej@redhat.com, linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
>Date: Mon, 14 Nov 2005 10:24:02 +0100
>
>Jason Dravet <dravet@hotmail.com> wrote:
>
> > When I run stty rows 20 I get a screen of 80x20. I can see the top 10
>rows
> > and the bottom 10 rows are invisible.
>
>I asume your VGA indicates that it'll divide it's scanline counter by 2.
>Please add a printk("vgacon: mode=%2.2x\n", mode) before line 512 and
>report
>the value. A real fix will depend on this value. In the meantime, removing
>the lines 512 and 513 from the original file should be a temporary fix.
>
>--
>Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
>verbreiteten Lügen zu sabotieren.
Here is the result from the printk you requested:
vgacon: mode=a3
I commented out lines 512 and 513 and the problem remains.
Thanks,
Jason
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-14 15:27 ` Jason Dravet
@ 2005-11-14 16:32 ` Bodo Eggert
2005-11-16 0:05 ` Samuel Thibault
1 sibling, 0 replies; 22+ messages in thread
From: Bodo Eggert @ 2005-11-14 16:32 UTC (permalink / raw)
To: Jason Dravet
Cc: 7eggert, adaplas, samuel.thibault, torvalds, akpm, davej,
linux-kernel
On Mon, 14 Nov 2005, Jason Dravet wrote:
> >From: Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
> >I asume your VGA indicates that it'll divide it's scanline counter by 2.
> >Please add a printk("vgacon: mode=%2.2x\n", mode) before line 512 and
> >report
> >the value. A real fix will depend on this value. In the meantime, removing
> >the lines 512 and 513 from the original file should be a temporary fix.
>
> Here is the result from the printk you requested:
> vgacon: mode=a3
>
> I commented out lines 512 and 513 and the problem remains.
It seems I was wrong. I will have to think about it later. In the
meantime, you might also want to use the no-scroll (IIRC) kernel
parameter. (Disclaimer: I just started rading this file.)
--
Funny quotes:
1. Save the whales. Collect the whole set.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-14 15:27 ` Jason Dravet
2005-11-14 16:32 ` Bodo Eggert
@ 2005-11-16 0:05 ` Samuel Thibault
2005-11-16 1:50 ` Jason Dravet
1 sibling, 1 reply; 22+ messages in thread
From: Samuel Thibault @ 2005-11-16 0:05 UTC (permalink / raw)
To: Jason Dravet; +Cc: 7eggert, adaplas, torvalds, akpm, davej, linux-kernel
Hi,
Jason Dravet, le Mon 14 Nov 2005 09:27:51 -0600, a écrit :
> >Jason Dravet <dravet@hotmail.com> wrote:
> >
> >> When I run stty rows 20 I get a screen of 80x20. I can see the top 10
> >rows
> >> and the bottom 10 rows are invisible.
> >
> >I asume your VGA indicates that it'll divide it's scanline counter by 2.
> >Please add a printk("vgacon: mode=%2.2x\n", mode) before line 512 and
> >report
> >the value. A real fix will depend on this value. In the meantime, removing
> >the lines 512 and 513 from the original file should be a temporary fix.
>
> Here is the result from the printk you requested:
> vgacon: mode=a3
>
> I commented out lines 512 and 513 and the problem remains.
Really strange...
At that same line, could you try adding this:
printk("vgacon: y=%d fonth=%d deffh=%d vidfh=%d scanl=%d\n", height, c->vc_font.height, vga_default_font_height, vga_video_font_height, vga_scan_lines);
outb_p(VGA_CRTC_OVERFLOW, vga_video_port_reg);
printk("vgacon: overflow %02x\n",inb_p(vga_video_port_val));
outb_p(VGA_CRTC_V_SYNC_END, vga_video_port_reg);
printk("vgacon: vsync_end %02x\n",inb_p(vga_video_port_val));
outb_p(VGA_CRTC_V_DISP_END, vga_video_port_reg);
printk("vgacon: vdisp_end %02x\n",inb_p(vga_video_port_val));
Regards,
Samuel
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-16 0:05 ` Samuel Thibault
@ 2005-11-16 1:50 ` Jason Dravet
2005-11-16 2:25 ` Samuel Thibault
0 siblings, 1 reply; 22+ messages in thread
From: Jason Dravet @ 2005-11-16 1:50 UTC (permalink / raw)
To: samuel.thibault; +Cc: 7eggert, adaplas, torvalds, akpm, davej, linux-kernel
>From: Samuel Thibault <samuel.thibault@ens-lyon.org>
>To: Jason Dravet <dravet@hotmail.com>
>CC: 7eggert@gmx.de, adaplas@gmail.com, torvalds@osdl.org,
>akpm@osdl.org,davej@redhat.com, linux-kernel@vger.kernel.org
>Subject: Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
>Date: Wed, 16 Nov 2005 01:05:49 +0100
>
>Hi,
>
>Jason Dravet, le Mon 14 Nov 2005 09:27:51 -0600, a écrit :
> > >Jason Dravet <dravet@hotmail.com> wrote:
> > >
> > >> When I run stty rows 20 I get a screen of 80x20. I can see the top
>10
> > >rows
> > >> and the bottom 10 rows are invisible.
> > >
> > >I asume your VGA indicates that it'll divide it's scanline counter by
>2.
> > >Please add a printk("vgacon: mode=%2.2x\n", mode) before line 512 and
> > >report
> > >the value. A real fix will depend on this value. In the meantime,
>removing
> > >the lines 512 and 513 from the original file should be a temporary fix.
> >
> > Here is the result from the printk you requested:
> > vgacon: mode=a3
> >
> > I commented out lines 512 and 513 and the problem remains.
>
>Really strange...
>
>At that same line, could you try adding this:
>
>printk("vgacon: y=%d fonth=%d deffh=%d vidfh=%d scanl=%d\n", height,
>c->vc_font.height, vga_default_font_height, vga_video_font_height,
>vga_scan_lines);
>outb_p(VGA_CRTC_OVERFLOW, vga_video_port_reg);
>printk("vgacon: overflow %02x\n",inb_p(vga_video_port_val));
>outb_p(VGA_CRTC_V_SYNC_END, vga_video_port_reg);
>printk("vgacon: vsync_end %02x\n",inb_p(vga_video_port_val));
>outb_p(VGA_CRTC_V_DISP_END, vga_video_port_reg);
>printk("vgacon: vdisp_end %02x\n",inb_p(vga_video_port_val));
>
>Regards,
>Samuel
Here are the results:
y=25 fonth=16 deffh=16 vidfh=16 scanl=400
overflow=ff
vsync_end=8f
vdisp_end=1f
Thanks,
Jason
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-16 1:50 ` Jason Dravet
@ 2005-11-16 2:25 ` Samuel Thibault
0 siblings, 0 replies; 22+ messages in thread
From: Samuel Thibault @ 2005-11-16 2:25 UTC (permalink / raw)
To: Jason Dravet; +Cc: 7eggert, adaplas, torvalds, akpm, davej, linux-kernel
Hi,
Jason Dravet, le Tue 15 Nov 2005 19:50:39 -0600, a écrit :
> Here are the results:
> y=25 fonth=16 deffh=16 vidfh=16 scanl=400
> overflow=ff
> vsync_end=8f
> vdisp_end=1f
Ah, this is odd indeed: your hardware uses 800 scanlines
(overflow:(512+256)+vdisp_end:0x1f), while the actual needed lines
should be y:25*fonth:16 ... Maybe it is actually using a 32 lines font.
Just to make sure about every VGA bits, could you install the
svgatextmode package, which holds a getVGAreg command, and run twice
for i in `seq 0 24` ; do getVGAreg CRTC $i ; done
The first time while having a correct full text screen rendering, and
the second time after vgacon_doresize() has blanked the bottom half of
the screen.
Regards,
Samuel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
@ 2005-11-14 3:46 Jason Dravet
0 siblings, 0 replies; 22+ messages in thread
From: Jason Dravet @ 2005-11-14 3:46 UTC (permalink / raw)
To: adaplas, samuel.thibault; +Cc: torvalds, akpm, davej, linux-kernel
>From: "Antonino A. Daplas" <adaplas@gmail.com>
>To: Samuel Thibault <samuel.thibault@ens-lyon.org>
>CC: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
>Dave Jones <davej@redhat.com>, Jason <dravet@hotmail.com>, Linux Kernel
>Development <linux-kernel@vger.kernel.org>
>Subject: Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
>Date: Mon, 14 Nov 2005 07:37:17 +0800
>
>Samuel Thibault wrote:
> > Antonino A. Daplas, le Sun 13 Nov 2005 22:33:18 +0800, a écrit :
> >> Samuel Thibault wrote:
> >>> Antonino A. Daplas, le Sun 13 Nov 2005 06:20:53 +0800, a écrit :
> >>>> "I updated to the development kernel and now during boot only the top
>of the
> >>>> text is visable. For example the monitor screen the is the lines and
>I can
> >>>> only see text in the asterik area.
> >>>> ---------------------
> >>>> | **************** |
> >>>> | * * |
> >>>> | * * |
> >>>> | **************** |
> >>>> | |
> >>>> | |
> >>>> | |
> >>>> ---------------------
> >>> Are you missing some left and right part too? What are the dimensions
>of
> >>> the text screen at bootup? What bootloader are you using? (It could be
>a
> >>> bug in the boot up text screen dimension discovery).
> >> It was just the height. All numbers (done with printk's) look okay
>from
> >> bootup. He gets 80 and 25 for ORIG_VIDEO_NUM_COLS and
>ORIG_VIDEO_NUM_LINES
> >> respectively.
> >
> > And you got less than 25 lines? How many exactly?
>
>If the original size was at 80x25, and vgacon_doresize() was called, the
>the resulting screen is only 80x12.5. The 13th line has its bottom half
>chopped off, and the rest of the lines (14-25) is invisible.
>
>If he sets it at < 25, he gets a window much smaller than 12.5, but he did
>not specify. So my guess is his chipset programs the screen height by 1/2
>of the value of the requested rows.
>
>Tony
When I run stty rows 20 I get a screen of 80x20. I can see the top 10 rows
and the bottom 10 rows are invisible.
Thanks,
Jason Dravet
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] vgacon: Workaround for resize bug in some chipsets
@ 2005-11-12 22:20 Antonino A. Daplas
2005-11-13 10:23 ` Martin Mares
2005-11-13 11:06 ` Samuel Thibault
0 siblings, 2 replies; 22+ messages in thread
From: Antonino A. Daplas @ 2005-11-12 22:20 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Dave Jones, Jason, Samuel Thibault, Linux Kernel Development
Reported from Redhat Bugzilla Bug 170450
"I updated to the development kernel and now during boot only the top of the
text is visable. For example the monitor screen the is the lines and I can
only see text in the asterik area.
---------------------
| **************** |
| * * |
| * * |
| **************** |
| |
| |
| |
---------------------
I have a Silicon Graphics 1600sw LCD panel with a Number Nine Revolution 4
video card."
This bug seems to be a glitch in the VGA core of this chipset. Resizing
the screen triggers the mentioned bug.
The workaround is to make vgacon avoid calling vgacon_doresize() if the
display parameters did not change. It also has a nice side effect of faster
console switches, but that will be barely noticeable.
Note that this bug may be triggered if the user changes the screen height
with stty, or using another font with different dimensions.
A definitive fix will need to be provided by someone who knows and has the
hardware.
This patch also converted hard-coded constants to a named constant
(VGACON_FONTWIDTH).
Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
vgacon.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 274f905..5ce8348 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -56,6 +56,8 @@
static DEFINE_SPINLOCK(vga_lock);
static int cursor_size_lastfrom;
static int cursor_size_lastto;
+static u32 vgacon_xres;
+static u32 vgacon_yres;
static struct vgastate state;
#define BLANK 0x0020
@@ -69,7 +71,7 @@ static struct vgastate state;
* appear.
*/
#undef TRIDENT_GLITCH
-
+#define VGA_FONTWIDTH 8 /* VGA does not support fontwidths != 8 */
/*
* Interface used by the world
*/
@@ -325,6 +327,10 @@ static const char __init *vgacon_startup
vga_scan_lines =
vga_video_font_height * vga_video_num_lines;
}
+
+ vgacon_xres = ORIG_VIDEO_COLS * VGA_FONTWIDTH;
+ vgacon_yres = vga_scan_lines;
+
return display_desc;
}
@@ -507,6 +513,8 @@ static int vgacon_doresize(struct vc_dat
spin_lock_irqsave(&vga_lock, flags);
+ vgacon_xres = width * VGA_FONTWIDTH;
+ vgacon_yres = height * c->vc_font.height;
outb_p(VGA_CRTC_MODE, vga_video_port_reg);
mode = inb_p(vga_video_port_val);
@@ -551,6 +559,10 @@ static int vgacon_doresize(struct vc_dat
static int vgacon_switch(struct vc_data *c)
{
+ int x = c->vc_cols * VGA_FONTWIDTH;
+ int y = c->vc_rows * c->vc_font.height;
+ int rows = ORIG_VIDEO_LINES * vga_default_font_height/
+ c->vc_font.height;
/*
* We need to save screen size here as it's the only way
* we can spot the screen has been resized and we need to
@@ -566,10 +578,11 @@ static int vgacon_switch(struct vc_data
scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf,
c->vc_screenbuf_size > vga_vram_size ?
vga_vram_size : c->vc_screenbuf_size);
- if (!(vga_video_num_columns % 2) &&
- vga_video_num_columns <= ORIG_VIDEO_COLS &&
- vga_video_num_lines <= (ORIG_VIDEO_LINES *
- vga_default_font_height) / c->vc_font.height)
+
+ if ((vgacon_xres != x || vgacon_yres != y) &&
+ (!(vga_video_num_columns % 2) &&
+ vga_video_num_columns <= ORIG_VIDEO_COLS &&
+ vga_video_num_lines <= rows))
vgacon_doresize(c, c->vc_cols, c->vc_rows);
}
@@ -992,7 +1005,8 @@ static int vgacon_font_set(struct vc_dat
if (vga_video_type < VIDEO_TYPE_EGAM)
return -EINVAL;
- if (font->width != 8 || (charcount != 256 && charcount != 512))
+ if (font->width != VGA_FONTWIDTH ||
+ (charcount != 256 && charcount != 512))
return -EINVAL;
rc = vgacon_do_font_op(&state, font->data, 1, charcount == 512);
@@ -1009,7 +1023,7 @@ static int vgacon_font_get(struct vc_dat
if (vga_video_type < VIDEO_TYPE_EGAM)
return -EINVAL;
- font->width = 8;
+ font->width = VGA_FONTWIDTH;
font->height = c->vc_font.height;
font->charcount = vga_512_chars ? 512 : 256;
if (!font->data)
^ permalink raw reply related [flat|nested] 22+ messages in thread* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-12 22:20 Antonino A. Daplas
@ 2005-11-13 10:23 ` Martin Mares
2005-11-13 11:06 ` Samuel Thibault
1 sibling, 0 replies; 22+ messages in thread
From: Martin Mares @ 2005-11-13 10:23 UTC (permalink / raw)
To: Antonino A. Daplas
Cc: Linus Torvalds, Andrew Morton, Dave Jones, Jason, Samuel Thibault,
Linux Kernel Development
Hello!
> Reported from Redhat Bugzilla Bug 170450
>
> "I updated to the development kernel and now during boot only the top of the
> text is visable. For example the monitor screen the is the lines and I can
> only see text in the asterik area.
> ---------------------
> | **************** |
> | * * |
> | * * |
> | **************** |
> | |
> | |
> | |
> ---------------------
>
> I have a Silicon Graphics 1600sw LCD panel with a Number Nine Revolution 4
> video card."
>
> This bug seems to be a glitch in the VGA core of this chipset. Resizing
> the screen triggers the mentioned bug.
>
> The workaround is to make vgacon avoid calling vgacon_doresize() if the
> display parameters did not change. It also has a nice side effect of faster
> console switches, but that will be barely noticeable.
This patch really deserves a comment in the code that such a broken hardware
exists.
Also, I don't see much reasons for introducing VGA_FONTWIDTH, it seems to only
complicate the code.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
For every complex problem, there's a solution that is simple, neat and wrong.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-12 22:20 Antonino A. Daplas
2005-11-13 10:23 ` Martin Mares
@ 2005-11-13 11:06 ` Samuel Thibault
2005-11-13 14:33 ` Antonino A. Daplas
1 sibling, 1 reply; 22+ messages in thread
From: Samuel Thibault @ 2005-11-13 11:06 UTC (permalink / raw)
To: Antonino A. Daplas
Cc: Linus Torvalds, Andrew Morton, Dave Jones, Jason,
Linux Kernel Development
Antonino A. Daplas, le Sun 13 Nov 2005 06:20:53 +0800, a écrit :
> "I updated to the development kernel and now during boot only the top of the
> text is visable. For example the monitor screen the is the lines and I can
> only see text in the asterik area.
> ---------------------
> | **************** |
> | * * |
> | * * |
> | **************** |
> | |
> | |
> | |
> ---------------------
Are you missing some left and right part too? What are the dimensions of
the text screen at bootup? What bootloader are you using? (It could be a
bug in the boot up text screen dimension discovery).
> I have a Silicon Graphics 1600sw LCD panel with a Number Nine Revolution 4
> video card."
Does vgacon.c properly discovers that it is a VGA board?
> This bug seems to be a glitch in the VGA core of this chipset. Resizing
> the screen triggers the mentioned bug.
Do vga-only games (like old DOS-mode games) work with it?
> The workaround is to make vgacon avoid calling vgacon_doresize() if the
> display parameters did not change.
I.e. never call it, actually.
> A definitive fix will need to be provided by someone who knows and has the
> hardware.
I'm not sure it is hardware-specific. Maybe you have a combination of
vga bios/bootloader/vga=ask/... that prevents vgacon.c from properly
discovering the dimensions of the text screen.
Well, else it looks like a "safe side" patch: people now hit by such bug
won't be hit any more unless using stty or such.
Regards,
Samuel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 11:06 ` Samuel Thibault
@ 2005-11-13 14:33 ` Antonino A. Daplas
2005-11-13 22:25 ` Samuel Thibault
0 siblings, 1 reply; 22+ messages in thread
From: Antonino A. Daplas @ 2005-11-13 14:33 UTC (permalink / raw)
To: Samuel Thibault
Cc: Linus Torvalds, Andrew Morton, Dave Jones, Jason,
Linux Kernel Development
Samuel Thibault wrote:
> Antonino A. Daplas, le Sun 13 Nov 2005 06:20:53 +0800, a écrit :
>> "I updated to the development kernel and now during boot only the top of the
>> text is visable. For example the monitor screen the is the lines and I can
>> only see text in the asterik area.
>> ---------------------
>> | **************** |
>> | * * |
>> | * * |
>> | **************** |
>> | |
>> | |
>> | |
>> ---------------------
>
> Are you missing some left and right part too? What are the dimensions of
> the text screen at bootup? What bootloader are you using? (It could be a
> bug in the boot up text screen dimension discovery).
It was just the height. All numbers (done with printk's) look okay from
bootup. He gets 80 and 25 for ORIG_VIDEO_NUM_COLS and ORIG_VIDEO_NUM_LINES
respectively.
>
>> I have a Silicon Graphics 1600sw LCD panel with a Number Nine Revolution 4
>> video card."
>
> Does vgacon.c properly discovers that it is a VGA board?
Yes.
>
>> This bug seems to be a glitch in the VGA core of this chipset. Resizing
>> the screen triggers the mentioned bug.
>
> Do vga-only games (like old DOS-mode games) work with it?
>
>> The workaround is to make vgacon avoid calling vgacon_doresize() if the
>> display parameters did not change.
>
> I.e. never call it, actually.
>
>> A definitive fix will need to be provided by someone who knows and has the
>> hardware.
>
> I'm not sure it is hardware-specific. Maybe you have a combination of
> vga bios/bootloader/vga=ask/... that prevents vgacon.c from properly
> discovering the dimensions of the text screen.
His console worked before linux-2.6.14-rc2.
Tony
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 14:33 ` Antonino A. Daplas
@ 2005-11-13 22:25 ` Samuel Thibault
2005-11-13 23:37 ` Antonino A. Daplas
0 siblings, 1 reply; 22+ messages in thread
From: Samuel Thibault @ 2005-11-13 22:25 UTC (permalink / raw)
To: Antonino A. Daplas
Cc: Linus Torvalds, Andrew Morton, Dave Jones, Jason,
Linux Kernel Development
Antonino A. Daplas, le Sun 13 Nov 2005 22:33:18 +0800, a écrit :
> Samuel Thibault wrote:
> > Antonino A. Daplas, le Sun 13 Nov 2005 06:20:53 +0800, a écrit :
> >> "I updated to the development kernel and now during boot only the top of the
> >> text is visable. For example the monitor screen the is the lines and I can
> >> only see text in the asterik area.
> >> ---------------------
> >> | **************** |
> >> | * * |
> >> | * * |
> >> | **************** |
> >> | |
> >> | |
> >> | |
> >> ---------------------
> >
> > Are you missing some left and right part too? What are the dimensions of
> > the text screen at bootup? What bootloader are you using? (It could be a
> > bug in the boot up text screen dimension discovery).
>
> It was just the height. All numbers (done with printk's) look okay from
> bootup. He gets 80 and 25 for ORIG_VIDEO_NUM_COLS and ORIG_VIDEO_NUM_LINES
> respectively.
And you got less than 25 lines? How many exactly?
Regards,
Samuel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] vgacon: Workaround for resize bug in some chipsets
2005-11-13 22:25 ` Samuel Thibault
@ 2005-11-13 23:37 ` Antonino A. Daplas
0 siblings, 0 replies; 22+ messages in thread
From: Antonino A. Daplas @ 2005-11-13 23:37 UTC (permalink / raw)
To: Samuel Thibault
Cc: Linus Torvalds, Andrew Morton, Dave Jones, Jason,
Linux Kernel Development
Samuel Thibault wrote:
> Antonino A. Daplas, le Sun 13 Nov 2005 22:33:18 +0800, a écrit :
>> Samuel Thibault wrote:
>>> Antonino A. Daplas, le Sun 13 Nov 2005 06:20:53 +0800, a écrit :
>>>> "I updated to the development kernel and now during boot only the top of the
>>>> text is visable. For example the monitor screen the is the lines and I can
>>>> only see text in the asterik area.
>>>> ---------------------
>>>> | **************** |
>>>> | * * |
>>>> | * * |
>>>> | **************** |
>>>> | |
>>>> | |
>>>> | |
>>>> ---------------------
>>> Are you missing some left and right part too? What are the dimensions of
>>> the text screen at bootup? What bootloader are you using? (It could be a
>>> bug in the boot up text screen dimension discovery).
>> It was just the height. All numbers (done with printk's) look okay from
>> bootup. He gets 80 and 25 for ORIG_VIDEO_NUM_COLS and ORIG_VIDEO_NUM_LINES
>> respectively.
>
> And you got less than 25 lines? How many exactly?
If the original size was at 80x25, and vgacon_doresize() was called, the
the resulting screen is only 80x12.5. The 13th line has its bottom half
chopped off, and the rest of the lines (14-25) is invisible.
If he sets it at < 25, he gets a window much smaller than 12.5, but he did
not specify. So my guess is his chipset programs the screen height by 1/2
of the value of the requested rows.
Tony
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2005-11-17 1:37 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <58c2Z-8jG-23@gated-at.bofh.it>
2005-11-13 19:41 ` [PATCH] vgacon: Workaround for resize bug in some chipsets Bodo Eggert
2005-11-13 22:11 ` Antonino A. Daplas
2005-11-13 22:26 ` Mika Penttilä
2005-11-13 23:35 ` Antonino A. Daplas
2005-11-14 3:32 ` H. Peter Anvin
2005-11-13 22:24 ` Samuel Thibault
2005-11-16 17:58 Jason Dravet
2005-11-16 23:52 ` Samuel Thibault
2005-11-17 1:37 ` Jason Dravet
[not found] <58DvZ-6en-1@gated-at.bofh.it>
2005-11-14 9:24 ` Bodo Eggert
2005-11-14 15:27 ` Jason Dravet
2005-11-14 16:32 ` Bodo Eggert
2005-11-16 0:05 ` Samuel Thibault
2005-11-16 1:50 ` Jason Dravet
2005-11-16 2:25 ` Samuel Thibault
-- strict thread matches above, loose matches on Subject: below --
2005-11-14 3:46 Jason Dravet
2005-11-12 22:20 Antonino A. Daplas
2005-11-13 10:23 ` Martin Mares
2005-11-13 11:06 ` Samuel Thibault
2005-11-13 14:33 ` Antonino A. Daplas
2005-11-13 22:25 ` Samuel Thibault
2005-11-13 23:37 ` Antonino A. Daplas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox