]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
viafb: eliminate viafb_get_pixclock
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sat, 6 Aug 2011 23:35:25 +0000 (23:35 +0000)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sun, 7 Aug 2011 01:41:24 +0000 (01:41 +0000)
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>
drivers/video/via/hw.c
drivers/video/via/hw.h
drivers/video/via/share.h

index 5e69c203163ceceb839efbe0aa6e05b8555566cf..d7b9a9f32dee3f93250cf82fe46597606227a6aa 100644 (file)
@@ -2033,18 +2033,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
        return 1;
 }
 
-int viafb_get_pixclock(int hres, int vres, int vmode_refresh)
-{
-       struct crt_mode_table *best;
-
-       best = viafb_get_best_mode(hres, vres, vmode_refresh);
-       if (!best)
-               return RES_640X480_60HZ_PIXCLOCK;
-
-       return 1000000000 / (best->crtc.hor_total * best->crtc.ver_total)
-               * 1000 / best->refresh_rate;
-}
-
 int viafb_get_refresh(int hres, int vres, u32 long_refresh)
 {
        struct crt_mode_table *best;
@@ -2160,8 +2148,8 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
        struct display_timing crt_reg;
 
        crt_reg = mode->crtc;
-       var->pixclock = viafb_get_pixclock(var->xres, var->yres,
-               mode->refresh_rate);
+       var->pixclock = 1000000000 / (crt_reg.hor_total * crt_reg.ver_total)
+               * 1000 / mode->refresh_rate;
        var->left_margin =
            crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end);
        var->right_margin = crt_reg.hor_sync_start - crt_reg.hor_addr;
index 3b7e1496657b55c44d379a43c9b91d06daa3c91a..5516b025926b42ae52b5584a809c5a362e9e01b5 100644 (file)
@@ -665,7 +665,6 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
        struct crt_mode_table *mode);
 void __devinit viafb_init_chip_info(int chip_type);
 void __devinit viafb_init_dac(int set_iga);
-int viafb_get_pixclock(int hres, int vres, int vmode_refresh);
 int viafb_get_refresh(int hres, int vres, u32 float_refresh);
 void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
 
index 2906b2d23434b64ddad204295df0dfd5bea9d883..69d882cbe7095f0acde27c9e61e12ea3236948d8 100644 (file)
 #define V_SYNC_SATRT_SHADOW_INDEX   18
 #define V_SYNC_END_SHADOW_INDEX     19
 
-/* Definition Video Mode Pixel Clock (picoseconds)
-*/
-#define RES_640X480_60HZ_PIXCLOCK    39722
-
 /* LCD display method
 */
 #define     LCD_EXPANDSION              0x00