Added the capability to select the operation mode of the VGA update timer.

The realtime mode is enabled by default (patch by Dawn Teschendorf).
This commit is contained in:
Volker Ruppert 2014-11-15 10:22:27 +00:00
parent 866f9480f8
commit 524ba46c3d
6 changed files with 46 additions and 13 deletions

View File

@ -409,10 +409,17 @@ vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
# The VGA update timer now uses the realtime engine and the default
# value is 5. This parameter can be changed at runtime.
#
# REALTIME
# If set to 1, the VGA timer is based on realtime, otherwise it is based
# on the ips setting. If the host is slow (low ips, update_freq) and the
# guest uses HLT appropriately, setting this to 0 and "clock: sync=none"
# may improve the responsiveness of the guest GUI when the guest is
# otherwise idle. The default value is 1.
#
# Examples:
# vga: extension=cirrus, update_freq=10
#=======================================================================
#vga: extension=vbe, update_freq=5
#vga: extension=vbe, update_freq=5, realtime=1
#=======================================================================
# VOODOO:

View File

@ -957,6 +957,12 @@ void bx_init_options()
screenmode->set_handler(bx_param_string_handler);
#endif
new bx_param_bool_c(display,
"vga_realtime",
"VGA timer realtime",
"If enabled, the VGA timer is based on realtime",
1);
bx_param_num_c *vga_update_freq = new bx_param_num_c(display,
"vga_update_frequency",
"VGA Update Frequency",
@ -2720,6 +2726,8 @@ static int parse_line_formatted(const char *context, int num_params, char *param
SIM->get_param_string(BXPN_VGA_EXTENSION)->set(&params[i][10]);
} else if (!strncmp(params[i], "update_freq=", 12)) {
SIM->get_param_num(BXPN_VGA_UPDATE_FREQUENCY)->set(atol(&params[i][12]));
} else if (!strncmp(params[i], "realtime=", 9)) {
SIM->get_param_bool(BXPN_VGA_REALTIME)->set(atol(&params[i][9]));
} else {
PARSE_ERR(("%s: vga directive malformed.", context));
}
@ -3377,9 +3385,10 @@ int bx_write_configuration(const char *rc, int overwrite)
}
}
fprintf(fp, "\n");
fprintf(fp, "vga: extension=%s, update_freq=%u\n",
fprintf(fp, "vga: extension=%s, update_freq=%u, realtime=%u\n",
SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(),
SIM->get_param_num(BXPN_VGA_UPDATE_FREQUENCY)->get());
SIM->get_param_num(BXPN_VGA_UPDATE_FREQUENCY)->get(),
SIM->get_param_bool(BXPN_VGA_REALTIME)->get());
#if BX_SUPPORT_SMP
fprintf(fp, "cpu: count=%u:%u:%u, ips=%u, quantum=%d, ",
SIM->get_param_num(BXPN_CPU_NPROCESSORS)->get(), SIM->get_param_num(BXPN_CPU_NCORES)->get(),

View File

@ -3717,7 +3717,7 @@ in the simulation, that can be retrieved by the boot loader
<para>
Examples:
<screen>
vga: extension=cirrus, update_freq=10
vga: extension=cirrus, update_freq=10, realtime=1
vga: extension=vbe
</screen>
This defines parameters related to the VGA display
@ -3732,8 +3732,15 @@ and 'cirrus' for Cirrus SVGA support (needs
</para>
<para>
The VGA update frequency specifies the number of display updates per second.
The update timer now uses the realtime engine and the default value is 5.
This parameter can be changed at runtime.
This parameter can be changed at runtime. The default value is 5.
</para>
<para>
The 'realtime' option specifies the operation mode of the VGA update timer.
If set to 1, the VGA timer is based on realtime, otherwise it is based on the
ips setting. If the host is slow (low ips, update_freq) and the guest uses HLT
appropriately, setting this to 0 and "clock: sync=none" may improve the
responsiveness of the guest GUI when the guest is otherwise idle. The default
value is 1.
</para>
</section>

View File

@ -1,5 +1,5 @@
.\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com"
.TH bochsrc 5 "19 Oct 2014" "bochsrc" "The Bochs Project"
.TH bochsrc 5 "15 Nov 2014" "bochsrc" "The Bochs Project"
.\"SKIP_SECTION"
.SH NAME
bochsrc \- Configuration file for Bochs.
@ -461,12 +461,20 @@ values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support.
update_freq:
This parameter specifies the number of display updates per second.
The VGA update timer now uses the realtime engine and the default
value is 5. This parameter can be changed at runtime.
Specifies the number of display updates per second.
This parameter can be changed at runtime. The default value is 5.
realtime:
If set to 1, the VGA timer is based on realtime, otherwise it is based on the
ips setting. If the host is slow (low ips, update_freq) and the guest uses HLT
appropriately, setting this to 0 and "clock: sync=none" may improve the
responsiveness of the guest GUI when the guest is otherwise idle. The default
value is 1.
Examples:
vga: extension=cirrus, update_freq=10
vga: extension=none, update_freq=10, realtime=0
vga: extension=cirrus, update_freq=30
vga: extension=vbe
.TP

View File

@ -259,12 +259,13 @@ void bx_vgacore_c::init_iohandlers(bx_read_handler_t f_read, bx_write_handler_t
void bx_vgacore_c::init_systemtimer(bx_timer_handler_t f_timer, param_event_handler f_param)
{
const bx_bool realtime = SIM->get_param_bool(BXPN_VGA_REALTIME)->get();
bx_param_num_c *vga_update_freq = SIM->get_param_num(BXPN_VGA_UPDATE_FREQUENCY);
BX_VGA_THIS update_interval = (Bit32u)(1000000 / vga_update_freq->get());
BX_INFO(("interval=%u", BX_VGA_THIS update_interval));
BX_INFO(("interval=%u, mode=%s", BX_VGA_THIS update_interval, realtime ? "realtime":"standard"));
if (BX_VGA_THIS timer_id == BX_NULL_TIMER_HANDLE) {
BX_VGA_THIS timer_id = bx_virt_timer.register_timer(this, f_timer,
BX_VGA_THIS update_interval, 1, 1, 1, "vga");
BX_VGA_THIS update_interval, 1, 1, realtime, "vga");
vga_update_freq->set_handler(f_param);
}
// VGA text mode cursor blink frequency 1.875 Hz

View File

@ -116,6 +116,7 @@
#define BXPN_SCREENMODE "display.screenmode"
#define BXPN_VGA_EXTENSION "display.vga_extension"
#define BXPN_VGA_UPDATE_FREQUENCY "display.vga_update_frequency"
#define BXPN_VGA_REALTIME "display.vga_realtime"
#define BXPN_VOODOO "display.voodoo"
#define BXPN_KEYBOARD "keyboard_mouse.keyboard"
#define BXPN_KBD_TYPE "keyboard_mouse.keyboard.type"