summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-12-07 16:17:10 -0800
committerH. Peter Anvin <hpa@zytor.com>2009-12-07 16:17:10 -0800
commit469735a321138e519106e3d1dd16acd3be0cc024 (patch)
tree472e7ce9844ae572179197e4ee92e6263e60500c
parentbca6d4d9a3012ecfc1fd49ab3f83884ba842c048 (diff)
downloadsyslinux-469735a321138e519106e3d1dd16acd3be0cc024.tar.gz
vesacon: make it possible to request nonstandard resolutions
Make it possible to request nonstandard resolutions when enabling vesacon. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/include/syslinux/vesacon.h1
-rw-r--r--com32/lib/sys/vesacon_write.c16
2 files changed, 16 insertions, 1 deletions
diff --git a/com32/include/syslinux/vesacon.h b/com32/include/syslinux/vesacon.h
index dad9fb57..11d72f3a 100644
--- a/com32/include/syslinux/vesacon.h
+++ b/com32/include/syslinux/vesacon.h
@@ -29,6 +29,7 @@
#define _SYSLINUX_VESACON_H
int vesacon_default_background(void);
+void vesacon_set_resolution(int, int);
int vesacon_load_background(const char *);
int vesacon_set_background(unsigned int);
diff --git a/com32/lib/sys/vesacon_write.c b/com32/lib/sys/vesacon_write.c
index 49448c6f..e85aba88 100644
--- a/com32/lib/sys/vesacon_write.c
+++ b/com32/lib/sys/vesacon_write.c
@@ -70,6 +70,20 @@ static struct term_info ti = {
reinitialization. */
static int vesacon_counter = 0;
+static struct {
+ int x, y;
+} vesacon_resolution = {
+ .x = DEFAULT_VESA_X_SIZE,
+ .y = DEFAULT_VESA_Y_SIZE,
+};
+
+/* Set desired resolution - requires a full close/open cycle */
+void vesacon_set_resolution(int x, int y)
+{
+ vesacon_resolution.x = x;
+ vesacon_resolution.y = y;
+}
+
/* Common setup */
int __vesacon_open(struct file_info *fp)
{
@@ -83,7 +97,7 @@ int __vesacon_open(struct file_info *fp)
ti.cols = 80;
} else {
/* Switch mode */
- if (__vesacon_init(DEFAULT_VESA_X_SIZE, DEFAULT_VESA_Y_SIZE)) {
+ if (__vesacon_init(vesacon_resolution.x, vesacon_resolution.y)) {
vesacon_counter = -1;
return EAGAIN;
}