diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-05-30 16:19:02 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-06-22 07:44:07 +0200 |
commit | 0c2b3b1d95cf35d1a08c5dab6579acbb1f20e2c1 (patch) | |
tree | 45ad5c0a899279a7f9ddd655db3e9939b6ebe048 | |
parent | 902bacb5f00b72efaf55865c665a4bb4c0f46459 (diff) | |
download | seabios-0c2b3b1d95cf35d1a08c5dab6579acbb1f20e2c1.tar.gz |
cbvga_list_modes: don't list current mode twice
In case we've already added the framebuffer video mode
to the list do not add number 0x140.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | vgasrc/cbvga.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c index fb686200..3f16bee1 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -104,6 +104,8 @@ struct vgamode_s *cbvga_find_mode(int mode) void cbvga_list_modes(u16 seg, u16 *dest, u16 *last) { + int seen = 0; + if (GET_GLOBAL(CBmode) != 0x3) { /* Advertise additional SVGA modes for Microsoft NTLDR graphical mode. * Microsoft NTLDR: @@ -119,9 +121,11 @@ cbvga_list_modes(u16 seg, u16 *dest, u16 *last) continue; SET_FARVAR(seg, *dest, mode); dest++; + if (GET_GLOBAL(CBmode) == mode) + seen = 1; } } - if (dest < last) { + if (dest < last && !seen) { SET_FARVAR(seg, *dest, GET_GLOBAL(CBmode)); dest++; } |