aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-08-06 19:35:25 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-08-06 21:41:24 -0400
commit42edcb162d67e8a88c7b873941c19eab689db272 (patch)
tree3332e99f497c97228a67faf7a2a2eda95f1e1904
parent94715ba97508dd42919a7525e362efb00dde1271 (diff)
viafb: eliminate viafb_get_pixclock
As there is only one user we can just insert the formula where needed. Avoids one lookup in the modetable and viafb_fill_var_timing_info does no longer depend on the modetable. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r--drivers/video/via/hw.c16
-rw-r--r--drivers/video/via/hw.h1
-rw-r--r--drivers/video/via/share.h4
3 files changed, 2 insertions, 19 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 5e69c203163c..d7b9a9f32dee 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -2033,18 +2033,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2033 return 1; 2033 return 1;
2034} 2034}
2035 2035
2036int viafb_get_pixclock(int hres, int vres, int vmode_refresh)
2037{
2038 struct crt_mode_table *best;
2039
2040 best = viafb_get_best_mode(hres, vres, vmode_refresh);
2041 if (!best)
2042 return RES_640X480_60HZ_PIXCLOCK;
2043
2044 return 1000000000 / (best->crtc.hor_total * best->crtc.ver_total)
2045 * 1000 / best->refresh_rate;
2046}
2047
2048int viafb_get_refresh(int hres, int vres, u32 long_refresh) 2036int viafb_get_refresh(int hres, int vres, u32 long_refresh)
2049{ 2037{
2050 struct crt_mode_table *best; 2038 struct crt_mode_table *best;
@@ -2160,8 +2148,8 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
2160 struct display_timing crt_reg; 2148 struct display_timing crt_reg;
2161 2149
2162 crt_reg = mode->crtc; 2150 crt_reg = mode->crtc;
2163 var->pixclock = viafb_get_pixclock(var->xres, var->yres, 2151 var->pixclock = 1000000000 / (crt_reg.hor_total * crt_reg.ver_total)
2164 mode->refresh_rate); 2152 * 1000 / mode->refresh_rate;
2165 var->left_margin = 2153 var->left_margin =
2166 crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end); 2154 crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end);
2167 var->right_margin = crt_reg.hor_sync_start - crt_reg.hor_addr; 2155 var->right_margin = crt_reg.hor_sync_start - crt_reg.hor_addr;
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 3b7e1496657b..5516b025926b 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -665,7 +665,6 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
665 struct crt_mode_table *mode); 665 struct crt_mode_table *mode);
666void __devinit viafb_init_chip_info(int chip_type); 666void __devinit viafb_init_chip_info(int chip_type);
667void __devinit viafb_init_dac(int set_iga); 667void __devinit viafb_init_dac(int set_iga);
668int viafb_get_pixclock(int hres, int vres, int vmode_refresh);
669int viafb_get_refresh(int hres, int vres, u32 float_refresh); 668int viafb_get_refresh(int hres, int vres, u32 float_refresh);
670void viafb_update_device_setting(int hres, int vres, int bpp, int flag); 669void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
671 670
diff --git a/drivers/video/via/share.h b/drivers/video/via/share.h
index 2906b2d23434..69d882cbe709 100644
--- a/drivers/video/via/share.h
+++ b/drivers/video/via/share.h
@@ -636,10 +636,6 @@
636#define V_SYNC_SATRT_SHADOW_INDEX 18 636#define V_SYNC_SATRT_SHADOW_INDEX 18
637#define V_SYNC_END_SHADOW_INDEX 19 637#define V_SYNC_END_SHADOW_INDEX 19
638 638
639/* Definition Video Mode Pixel Clock (picoseconds)
640*/
641#define RES_640X480_60HZ_PIXCLOCK 39722
642
643/* LCD display method 639/* LCD display method
644*/ 640*/
645#define LCD_EXPANDSION 0x00 641#define LCD_EXPANDSION 0x00