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>
(cherry picked from commit
0c2b3b1d95cf35d1a08c5dab6579acbb1f20e2c1)
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:
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++;
}