aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/viafbdev.c
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-08-07 09:34:35 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-08-07 09:34:35 -0400
commit5dd72f12df00cbabc16de770b79b17ced63138be (patch)
treef25805da9a8e350d71dc2fcdf2e5b9b9256e11fe /drivers/video/via/viafbdev.c
parentbfe7d5f9396d5f2607454fd9ff89397fa3ba9a32 (diff)
viafb: get rid of the remaining modetable structure assumptions
This patch removes the remaining places where assumptions about the structure of the modetable were made. Aside from some places where assumptions are made that certain modes are in the modetable the only code dealing with the modetable and not just a single mode is in viamode. This will allow chaniging the modetable and use other sources for videomodes like the subsystem or EDID. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via/viafbdev.c')
-rw-r--r--drivers/video/via/viafbdev.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 0c0ef9568cf3..38567849a9d6 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -38,8 +38,6 @@ static char *viafb_mode1;
38static int viafb_bpp = 32; 38static int viafb_bpp = 32;
39static int viafb_bpp1 = 32; 39static int viafb_bpp1 = 32;
40 40
41static unsigned int viafb_second_xres = 640;
42static unsigned int viafb_second_yres = 480;
43static unsigned int viafb_second_offset; 41static unsigned int viafb_second_offset;
44static int viafb_second_size; 42static int viafb_second_size;
45 43
@@ -267,7 +265,6 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
267static int viafb_set_par(struct fb_info *info) 265static int viafb_set_par(struct fb_info *info)
268{ 266{
269 struct viafb_par *viapar = info->par; 267 struct viafb_par *viapar = info->par;
270 struct VideoModeTable *vmode_entry, *vmode_entry1 = NULL;
271 int refresh; 268 int refresh;
272 DEBUG_MSG(KERN_INFO "viafb_set_par!\n"); 269 DEBUG_MSG(KERN_INFO "viafb_set_par!\n");
273 270
@@ -276,10 +273,7 @@ static int viafb_set_par(struct fb_info *info)
276 viafb_update_device_setting(viafbinfo->var.xres, viafbinfo->var.yres, 273 viafb_update_device_setting(viafbinfo->var.xres, viafbinfo->var.yres,
277 viafbinfo->var.bits_per_pixel, 0); 274 viafbinfo->var.bits_per_pixel, 0);
278 275
279 vmode_entry = viafb_get_mode(viafbinfo->var.xres, viafbinfo->var.yres);
280 if (viafb_dual_fb) { 276 if (viafb_dual_fb) {
281 vmode_entry1 = viafb_get_mode(viafbinfo1->var.xres,
282 viafbinfo1->var.yres);
283 viafb_update_device_setting(viafbinfo1->var.xres, 277 viafb_update_device_setting(viafbinfo1->var.xres,
284 viafbinfo1->var.yres, viafbinfo1->var.bits_per_pixel, 278 viafbinfo1->var.yres, viafbinfo1->var.bits_per_pixel,
285 1); 279 1);
@@ -287,8 +281,6 @@ static int viafb_set_par(struct fb_info *info)
287 DEBUG_MSG(KERN_INFO 281 DEBUG_MSG(KERN_INFO
288 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n", 282 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n",
289 viafb_second_xres, viafb_second_yres, viafb_bpp1); 283 viafb_second_xres, viafb_second_yres, viafb_bpp1);
290 vmode_entry1 = viafb_get_mode(viafb_second_xres,
291 viafb_second_yres);
292 284
293 viafb_update_device_setting(viafb_second_xres, 285 viafb_update_device_setting(viafb_second_xres,
294 viafb_second_yres, viafb_bpp1, 1); 286 viafb_second_yres, viafb_bpp1, 1);
@@ -296,7 +288,8 @@ static int viafb_set_par(struct fb_info *info)
296 288
297 refresh = viafb_get_refresh(info->var.xres, info->var.yres, 289 refresh = viafb_get_refresh(info->var.xres, info->var.yres,
298 get_var_refresh(&info->var)); 290 get_var_refresh(&info->var));
299 if (vmode_entry) { 291 if (viafb_get_best_mode(viafbinfo->var.xres, viafbinfo->var.yres,
292 refresh)) {
300 if (viafb_dual_fb && viapar->iga_path == IGA2) { 293 if (viafb_dual_fb && viapar->iga_path == IGA2) {
301 viafb_bpp1 = info->var.bits_per_pixel; 294 viafb_bpp1 = info->var.bits_per_pixel;
302 viafb_refresh1 = refresh; 295 viafb_refresh1 = refresh;
@@ -309,8 +302,7 @@ static int viafb_set_par(struct fb_info *info)
309 info->flags &= ~FBINFO_HWACCEL_DISABLED; 302 info->flags &= ~FBINFO_HWACCEL_DISABLED;
310 else 303 else
311 info->flags |= FBINFO_HWACCEL_DISABLED; 304 info->flags |= FBINFO_HWACCEL_DISABLED;
312 viafb_setmode(vmode_entry, info->var.bits_per_pixel, 305 viafb_setmode(info->var.bits_per_pixel, viafb_bpp1);
313 vmode_entry1, viafb_bpp1);
314 viafb_pan_display(&info->var, info); 306 viafb_pan_display(&info->var, info);
315 } 307 }
316 308