diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-02-26 05:51:51 -0500 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-03-08 13:41:38 -0500 |
commit | 838ac785d521e091bd8b5f6a2b545166f5f32b77 (patch) | |
tree | 7f8c2f5482cfe17f90a10988d0e819ba64314d92 | |
parent | 9864ca20c50c2fcaba63767a336e16c88b46d7ad (diff) |
viafb: avoid refresh and mode lookup in set_par
As check_var already ensures that the mode is valid there is no need
to do those expensive lookups here again. The only thing that might
change is that the deprecated interface could report slightly
different refresh rates due to rounding errors.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r-- | drivers/video/via/viafbdev.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 7529340f4ea2..0c8837565bc7 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -287,26 +287,22 @@ static int viafb_set_par(struct fb_info *info) | |||
287 | viafb_second_yres, viafb_bpp1, 1); | 287 | viafb_second_yres, viafb_bpp1, 1); |
288 | } | 288 | } |
289 | 289 | ||
290 | refresh = viafb_get_refresh(info->var.xres, info->var.yres, | 290 | refresh = get_var_refresh(&info->var); |
291 | get_var_refresh(&info->var)); | 291 | if (viafb_dual_fb && viapar->iga_path == IGA2) { |
292 | if (viafb_get_best_mode(viafbinfo->var.xres, viafbinfo->var.yres, | 292 | viafb_bpp1 = info->var.bits_per_pixel; |
293 | refresh)) { | 293 | viafb_refresh1 = refresh; |
294 | if (viafb_dual_fb && viapar->iga_path == IGA2) { | 294 | } else { |
295 | viafb_bpp1 = info->var.bits_per_pixel; | 295 | viafb_bpp = info->var.bits_per_pixel; |
296 | viafb_refresh1 = refresh; | 296 | viafb_refresh = refresh; |
297 | } else { | ||
298 | viafb_bpp = info->var.bits_per_pixel; | ||
299 | viafb_refresh = refresh; | ||
300 | } | ||
301 | |||
302 | if (info->var.accel_flags & FB_ACCELF_TEXT) | ||
303 | info->flags &= ~FBINFO_HWACCEL_DISABLED; | ||
304 | else | ||
305 | info->flags |= FBINFO_HWACCEL_DISABLED; | ||
306 | viafb_setmode(); | ||
307 | viafb_pan_display(&info->var, info); | ||
308 | } | 297 | } |
309 | 298 | ||
299 | if (info->var.accel_flags & FB_ACCELF_TEXT) | ||
300 | info->flags &= ~FBINFO_HWACCEL_DISABLED; | ||
301 | else | ||
302 | info->flags |= FBINFO_HWACCEL_DISABLED; | ||
303 | viafb_setmode(); | ||
304 | viafb_pan_display(&info->var, info); | ||
305 | |||
310 | return 0; | 306 | return 0; |
311 | } | 307 | } |
312 | 308 | ||