mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Only set resolution in init(8) if not already done.
This commit is contained in:
parent
3fc09c3941
commit
de76ffce5f
1 changed files with 15 additions and 0 deletions
15
init/init.c
15
init/init.c
|
@ -430,6 +430,21 @@ static void set_videomode(void)
|
|||
return;
|
||||
}
|
||||
free(videomode);
|
||||
struct dispmsg_get_crtc_mode get_mode;
|
||||
memset(&get_mode, 0, sizeof(get_mode));
|
||||
get_mode.msgid = DISPMSG_GET_CRTC_MODE;
|
||||
get_mode.device = 0;
|
||||
get_mode.connector = 0;
|
||||
// Don't set the resolution if it's already correct.
|
||||
if ( dispmsg_issue(&get_mode, sizeof(get_mode)) == 0 )
|
||||
{
|
||||
if ( get_mode.mode.control & DISPMSG_CONTROL_VALID &&
|
||||
!(get_mode.mode.control & DISPMSG_CONTROL_FALLBACK) &&
|
||||
get_mode.mode.fb_format == bpp &&
|
||||
get_mode.mode.view_xres == xres &&
|
||||
get_mode.mode.view_yres == yres )
|
||||
return;
|
||||
}
|
||||
struct dispmsg_set_crtc_mode set_mode;
|
||||
memset(&set_mode, 0, sizeof(set_mode));
|
||||
set_mode.msgid = DISPMSG_SET_CRTC_MODE;
|
||||
|
|
Loading…
Reference in a new issue