Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3f662b3f6e422a15fefcbaf4bdd21f97e6bcf32d
Commit:     3f662b3f6e422a15fefcbaf4bdd21f97e6bcf32d
Parent:     81cfe79b9c577139a873483654640eb3f6e78c39
Author:     H. Peter Anvin <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 13 14:14:29 2007 -0700
Committer:  H. Peter Anvin <[EMAIL PROTECTED]>
CommitDate: Thu Sep 20 11:06:58 2007 -0700

    [x86 setup] Present the canonical video mode number to the kernel
    
    Canonicalize the video mode number as presented to the kernel.  The
    video mode number may be user-entered (e.g. ASK_VGA), an alias
    (e.g. NORMAL_VGA), or a size specification, and that confuses the
    suspend wakeup code.
    
    Signed-off-by: H. Peter Anvin <[EMAIL PROTECTED]>
---
 arch/i386/boot/video.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/i386/boot/video.c b/arch/i386/boot/video.c
index 693f20d..e4ba897 100644
--- a/arch/i386/boot/video.c
+++ b/arch/i386/boot/video.c
@@ -147,7 +147,7 @@ int mode_defined(u16 mode)
 }
 
 /* Set mode (without recalc) */
-static int raw_set_mode(u16 mode)
+static int raw_set_mode(u16 mode, u16 *real_mode)
 {
        int nmode, i;
        struct card_info *card;
@@ -165,8 +165,10 @@ static int raw_set_mode(u16 mode)
 
                        if ((mode == nmode && visible) ||
                            mode == mi->mode ||
-                           mode == (mi->y << 8)+mi->x)
+                           mode == (mi->y << 8)+mi->x) {
+                               *real_mode = mi->mode;
                                return card->set_mode(mi);
+                       }
 
                        if (visible)
                                nmode++;
@@ -178,7 +180,7 @@ static int raw_set_mode(u16 mode)
                if (mode >= card->xmode_first &&
                    mode < card->xmode_first+card->xmode_n) {
                        struct mode_info mix;
-                       mix.mode = mode;
+                       *real_mode = mix.mode = mode;
                        mix.x = mix.y = 0;
                        return card->set_mode(&mix);
                }
@@ -223,6 +225,7 @@ static void vga_recalc_vertical(void)
 static int set_mode(u16 mode)
 {
        int rv;
+       u16 real_mode;
 
        /* Very special mode numbers... */
        if (mode == VIDEO_CURRENT_MODE)
@@ -232,13 +235,16 @@ static int set_mode(u16 mode)
        else if (mode == EXTENDED_VGA)
                mode = VIDEO_8POINT;
 
-       rv = raw_set_mode(mode);
+       rv = raw_set_mode(mode, &real_mode);
        if (rv)
                return rv;
 
        if (mode & VIDEO_RECALC)
                vga_recalc_vertical();
 
+       /* Save the canonical mode number for the kernel, not
+          an alias, size specification or menu position */
+       boot_params.hdr.vid_mode = real_mode;
        return 0;
 }
 
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to