aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/bochsvga.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-01-24 00:07:44 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-01 20:38:49 -0500
commit3876b531222c53124b0eb154fb331c0c662f5e09 (patch)
tree23f39e04767b1da3b8983ab1432821ee95bdc42c /vgasrc/bochsvga.c
parent9961f9958cbc169c531dbdb7c3a8f71d4f79d0c1 (diff)
downloadseabios-3876b531222c53124b0eb154fb331c0c662f5e09.tar.gz
vgabios: Add support for vbe get/set line length function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/bochsvga.c')
-rw-r--r--vgasrc/bochsvga.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c
index 74da887b..2a4b0d5b 100644
--- a/vgasrc/bochsvga.c
+++ b/vgasrc/bochsvga.c
@@ -217,6 +217,21 @@ bochsvga_set_window(struct vgamode_s *vmode_g, int window, int val)
return 0;
}
+int
+bochsvga_get_linelength(struct vgamode_s *vmode_g)
+{
+ return dispi_read(VBE_DISPI_INDEX_VIRT_WIDTH) * vga_bpp(vmode_g) / 8;
+}
+
+int
+bochsvga_set_linelength(struct vgamode_s *vmode_g, int val)
+{
+ stdvga_set_linelength(vmode_g, val);
+ int pixels = (val * 8) / vga_bpp(vmode_g);
+ dispi_write(VBE_DISPI_INDEX_VIRT_WIDTH, pixels);
+ return 0;
+}
+
static void
bochsvga_clear_scr(void)
{