summaryrefslogtreecommitdiffstats
path: root/src/arch/i386
diff options
context:
space:
mode:
authorMichael Brown2015-10-14 23:01:29 +0200
committerMichael Brown2015-10-14 23:16:45 +0200
commit79afe60b0931f56ea2ee596aaae61f5ff0194de6 (patch)
tree9494a7ff02bd217818ba87a7d6fbcbbc71869dcc /src/arch/i386
parent[fbcon] Allow character height to be selected at runtime (diff)
downloadipxe-79afe60b0931f56ea2ee596aaae61f5ff0194de6.tar.gz
ipxe-79afe60b0931f56ea2ee596aaae61f5ff0194de6.tar.xz
ipxe-79afe60b0931f56ea2ee596aaae61f5ff0194de6.zip
[fbcon] Move margin calculations to fbcon.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386')
-rw-r--r--src/arch/i386/interface/pcbios/vesafb.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/arch/i386/interface/pcbios/vesafb.c b/src/arch/i386/interface/pcbios/vesafb.c
index 4742f956..6d2c1bca 100644
--- a/src/arch/i386/interface/pcbios/vesafb.c
+++ b/src/arch/i386/interface/pcbios/vesafb.c
@@ -83,8 +83,6 @@ struct vesafb {
physaddr_t start;
/** Pixel geometry */
struct fbcon_geometry pixel;
- /** Margin */
- struct fbcon_margin margin;
/** Colour mapping */
struct fbcon_colour_map map;
/** Font definition */
@@ -419,12 +417,6 @@ static void vesafb_restore ( void ) {
static int vesafb_init ( struct console_configuration *config ) {
uint32_t discard_b;
uint16_t *mode_numbers;
- unsigned int xgap;
- unsigned int ygap;
- unsigned int left;
- unsigned int right;
- unsigned int top;
- unsigned int bottom;
int mode_number;
int rc;
@@ -450,31 +442,13 @@ static int vesafb_init ( struct console_configuration *config ) {
if ( ( rc = vesafb_set_mode ( mode_number ) ) != 0 )
goto err_set_mode;
- /* Calculate margin. If the actual screen size is larger than
- * the requested screen size, then update the margins so that
- * the margin remains relative to the requested screen size.
- * (As an exception, if a zero margin was specified then treat
- * this as meaning "expand to edge of actual screen".)
- */
- xgap = ( vesafb.pixel.width - config->width );
- ygap = ( vesafb.pixel.height - config->height );
- left = ( xgap / 2 );
- right = ( xgap - left );
- top = ( ygap / 2 );
- bottom = ( ygap - top );
- vesafb.margin.left = ( config->left + ( config->left ? left : 0 ) );
- vesafb.margin.right = ( config->right + ( config->right ? right : 0 ) );
- vesafb.margin.top = ( config->top + ( config->top ? top : 0 ) );
- vesafb.margin.bottom =
- ( config->bottom + ( config->bottom ? bottom : 0 ) );
-
/* Get font data */
vesafb_font();
/* Initialise frame buffer console */
if ( ( rc = fbcon_init ( &vesafb.fbcon, phys_to_user ( vesafb.start ),
- &vesafb.pixel, &vesafb.margin, &vesafb.map,
- &vesafb.font, config->pixbuf ) ) != 0 )
+ &vesafb.pixel, &vesafb.map, &vesafb.font,
+ config ) ) != 0 )
goto err_fbcon_init;
free ( mode_numbers );