diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2011-10-11 21:47:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-12 09:51:47 -0600 |
commit | e9865d47d44600b86e00a274adc8bf28e10677da (patch) | |
tree | a21dd877b86100b69d4c962dd2d9a7f41b18c371 /drivers/staging/xgifb/XGI_main_26.c | |
parent | 39f10bf18c80c98d9fec376beabe80b9c59c7498 (diff) | |
download | op-kernel-dev-e9865d47d44600b86e00a274adc8bf28e10677da.zip op-kernel-dev-e9865d47d44600b86e00a274adc8bf28e10677da.tar.gz |
staging: xgifb: eliminate default_var
Eliminate default_var and initialize needed fields of fb_info->var
in probe().
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/xgifb/XGI_main_26.c')
-rw-r--r-- | drivers/staging/xgifb/XGI_main_26.c | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index 8c9c187..5eed802 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -2345,17 +2345,22 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, xgifb_info->video_bpp, xgifb_info->refresh_rate); - default_var.xres = - default_var.xres_virtual = - xgifb_info->video_width; - default_var.yres = - default_var.yres_virtual = - xgifb_info->video_height; - default_var.bits_per_pixel = xgifb_info->video_bpp; - - XGIfb_bpp_to_var(xgifb_info, &default_var); - - default_var.pixclock = (u32) (1000000000 / + fb_info->var.red.length = 8; + fb_info->var.green.length = 8; + fb_info->var.blue.length = 8; + fb_info->var.activate = FB_ACTIVATE_NOW; + fb_info->var.height = -1; + fb_info->var.width = -1; + fb_info->var.vmode = FB_VMODE_NONINTERLACED; + fb_info->var.xres = xgifb_info->video_width; + fb_info->var.xres_virtual = xgifb_info->video_width; + fb_info->var.yres = xgifb_info->video_height; + fb_info->var.yres_virtual = xgifb_info->video_height; + fb_info->var.bits_per_pixel = xgifb_info->video_bpp; + + XGIfb_bpp_to_var(xgifb_info, &fb_info->var); + + fb_info->var.pixclock = (u32) (1000000000 / XGIfb_mode_rate_to_dclock(&XGI_Pr, hw_info, XGIbios_mode[xgifb_info->mode_idx].mode_no, xgifb_info->rate_idx)); @@ -2363,26 +2368,29 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, if (XGIfb_mode_rate_to_ddata(&XGI_Pr, hw_info, XGIbios_mode[xgifb_info->mode_idx].mode_no, xgifb_info->rate_idx, - &default_var.left_margin, &default_var.right_margin, - &default_var.upper_margin, &default_var.lower_margin, - &default_var.hsync_len, &default_var.vsync_len, - &default_var.sync, &default_var.vmode)) { - - if ((default_var.vmode & FB_VMODE_MASK) == + &fb_info->var.left_margin, + &fb_info->var.right_margin, + &fb_info->var.upper_margin, + &fb_info->var.lower_margin, + &fb_info->var.hsync_len, + &fb_info->var.vsync_len, + &fb_info->var.sync, + &fb_info->var.vmode)) { + + if ((fb_info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) { - default_var.yres <<= 1; - default_var.yres_virtual <<= 1; - } else if ((default_var.vmode & FB_VMODE_MASK) == + fb_info->var.yres <<= 1; + fb_info->var.yres_virtual <<= 1; + } else if ((fb_info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) { - default_var.pixclock >>= 1; - default_var.yres >>= 1; - default_var.yres_virtual >>= 1; + fb_info->var.pixclock >>= 1; + fb_info->var.yres >>= 1; + fb_info->var.yres_virtual >>= 1; } } fb_info->flags = FBINFO_FLAG_DEFAULT; - fb_info->var = default_var; fb_info->fix = XGIfb_fix; fb_info->screen_base = xgifb_info->video_vbase; fb_info->fbops = &XGIfb_ops; |