Commit e9865d47 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: eliminate default_var

Eliminate default_var and initialize needed fields of fb_info->var
in probe().
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 39f10bf1
...@@ -125,35 +125,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table); ...@@ -125,35 +125,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);
/* ------------------- Global Variables ----------------------------- */ /* ------------------- Global Variables ----------------------------- */
static struct fb_var_screeninfo default_var = {
.xres = 0,
.yres = 0,
.xres_virtual = 0,
.yres_virtual = 0,
.xoffset = 0,
.yoffset = 0,
.bits_per_pixel = 0,
.grayscale = 0,
.red = {0, 8, 0},
.green = {0, 8, 0},
.blue = {0, 8, 0},
.transp = {0, 0, 0},
.nonstd = 0,
.activate = FB_ACTIVATE_NOW,
.height = -1,
.width = -1,
.accel_flags = 0,
.pixclock = 0,
.left_margin = 0,
.right_margin = 0,
.upper_margin = 0,
.lower_margin = 0,
.hsync_len = 0,
.vsync_len = 0,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
};
static struct fb_fix_screeninfo XGIfb_fix = { static struct fb_fix_screeninfo XGIfb_fix = {
.id = "XGI", .id = "XGI",
.type = FB_TYPE_PACKED_PIXELS, .type = FB_TYPE_PACKED_PIXELS,
......
...@@ -2345,17 +2345,22 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -2345,17 +2345,22 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
xgifb_info->video_bpp, xgifb_info->video_bpp,
xgifb_info->refresh_rate); xgifb_info->refresh_rate);
default_var.xres = fb_info->var.red.length = 8;
default_var.xres_virtual = fb_info->var.green.length = 8;
xgifb_info->video_width; fb_info->var.blue.length = 8;
default_var.yres = fb_info->var.activate = FB_ACTIVATE_NOW;
default_var.yres_virtual = fb_info->var.height = -1;
xgifb_info->video_height; fb_info->var.width = -1;
default_var.bits_per_pixel = xgifb_info->video_bpp; fb_info->var.vmode = FB_VMODE_NONINTERLACED;
fb_info->var.xres = xgifb_info->video_width;
XGIfb_bpp_to_var(xgifb_info, &default_var); fb_info->var.xres_virtual = xgifb_info->video_width;
fb_info->var.yres = xgifb_info->video_height;
default_var.pixclock = (u32) (1000000000 / 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, XGIfb_mode_rate_to_dclock(&XGI_Pr, hw_info,
XGIbios_mode[xgifb_info->mode_idx].mode_no, XGIbios_mode[xgifb_info->mode_idx].mode_no,
xgifb_info->rate_idx)); xgifb_info->rate_idx));
...@@ -2363,26 +2368,29 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -2363,26 +2368,29 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
if (XGIfb_mode_rate_to_ddata(&XGI_Pr, hw_info, if (XGIfb_mode_rate_to_ddata(&XGI_Pr, hw_info,
XGIbios_mode[xgifb_info->mode_idx].mode_no, XGIbios_mode[xgifb_info->mode_idx].mode_no,
xgifb_info->rate_idx, xgifb_info->rate_idx,
&default_var.left_margin, &default_var.right_margin, &fb_info->var.left_margin,
&default_var.upper_margin, &default_var.lower_margin, &fb_info->var.right_margin,
&default_var.hsync_len, &default_var.vsync_len, &fb_info->var.upper_margin,
&default_var.sync, &default_var.vmode)) { &fb_info->var.lower_margin,
&fb_info->var.hsync_len,
if ((default_var.vmode & FB_VMODE_MASK) == &fb_info->var.vsync_len,
&fb_info->var.sync,
&fb_info->var.vmode)) {
if ((fb_info->var.vmode & FB_VMODE_MASK) ==
FB_VMODE_INTERLACED) { FB_VMODE_INTERLACED) {
default_var.yres <<= 1; fb_info->var.yres <<= 1;
default_var.yres_virtual <<= 1; fb_info->var.yres_virtual <<= 1;
} else if ((default_var.vmode & FB_VMODE_MASK) == } else if ((fb_info->var.vmode & FB_VMODE_MASK) ==
FB_VMODE_DOUBLE) { FB_VMODE_DOUBLE) {
default_var.pixclock >>= 1; fb_info->var.pixclock >>= 1;
default_var.yres >>= 1; fb_info->var.yres >>= 1;
default_var.yres_virtual >>= 1; fb_info->var.yres_virtual >>= 1;
} }
} }
fb_info->flags = FBINFO_FLAG_DEFAULT; fb_info->flags = FBINFO_FLAG_DEFAULT;
fb_info->var = default_var;
fb_info->fix = XGIfb_fix; fb_info->fix = XGIfb_fix;
fb_info->screen_base = xgifb_info->video_vbase; fb_info->screen_base = xgifb_info->video_vbase;
fb_info->fbops = &XGIfb_ops; fb_info->fbops = &XGIfb_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment