From: H. Peter Anvin Date: Tue, 8 Dec 2009 00:17:10 +0000 (-0800) Subject: vesacon: make it possible to request nonstandard resolutions X-Git-Tag: syslinux-3.84-pre6~3^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=469735a321138e519106e3d1dd16acd3be0cc024;p=profile%2Fivi%2Fsyslinux.git vesacon: make it possible to request nonstandard resolutions Make it possible to request nonstandard resolutions when enabling vesacon. Signed-off-by: H. Peter Anvin --- diff --git a/com32/include/syslinux/vesacon.h b/com32/include/syslinux/vesacon.h index dad9fb5..11d72f3 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 49448c6..e85aba8 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; }