Commit:     7ad37df02c529525c4ad19035359af89d2d2a5bd
Parent:     5593eaa854d0b23c3b270933a93b9b82946df729
Author:     H. Peter Anvin <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 17 16:16:10 2007 -0700
Committer:  H. Peter Anvin <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 11:36:17 2007 -0700

    [x86 setup] VGA: Clear the Protect bit before setting the vertical height
    If the user has asked for the vertical height registers to be recomputed
    by setting bit 15 in the video mode number, we do so without clearing the
    Protect bit in the Vertical Retrace Register before setting the Overflow
    register.  As a result, if the VGA BIOS had set the Protect bit, the
    write to the Overflow register will be dropped, and bits [9:8] of the
    vertical height will be left unchanged.
    This is a bug imported from the assembly version of this code.  It was
    pointed out by Etienne Lorrain.
    Cc: Etienne Lorrain <[EMAIL PROTECTED]>
    Signed-off-by: H. Peter Anvin <[EMAIL PROTECTED]>
 arch/i386/boot/video.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/i386/boot/video.c b/arch/i386/boot/video.c
index 027a2c9..958130e 100644
--- a/arch/i386/boot/video.c
+++ b/arch/i386/boot/video.c
@@ -195,7 +195,7 @@ static void vga_recalc_vertical(void)
        unsigned int font_size, rows;
        u16 crtc;
-       u8 ov;
+       u8 pt, ov;
        font_size = rdfs8(0x485); /* BIOS: font size (pixels) */
@@ -206,7 +206,12 @@ static void vga_recalc_vertical(void)
        crtc = vga_crtc();
+       pt = in_idx(crtc, 0x11);
+       pt &= ~0x80;            /* Unlock CR0-7 */
+       out_idx(pt, crtc, 0x11);
        out_idx((u8)rows, crtc, 0x12); /* Lower height register */
        ov = in_idx(crtc, 0x07); /* Overflow register */
        ov &= 0xbd;
        ov |= (rows >> (8-1)) & 0x02;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to