Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65063
b: refs/heads/master
c: 3f662b3
h: refs/heads/master
i:
  65061: 710d9ce
  65059: 39747eb
  65055: ffafd8d
v: v3
  • Loading branch information
H. Peter Anvin committed Sep 20, 2007
1 parent f0e3e38 commit cce66bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81cfe79b9c577139a873483654640eb3f6e78c39
refs/heads/master: 3f662b3f6e422a15fefcbaf4bdd21f97e6bcf32d
14 changes: 10 additions & 4 deletions trunk/arch/i386/boot/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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++;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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)
Expand All @@ -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;
}

Expand Down

0 comments on commit cce66bb

Please sign in to comment.