diff options
Diffstat (limited to 'drivers/video/via/dvi.c')
-rw-r--r-- | drivers/video/via/dvi.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c index c7ff5c0e9c7e..9138e517267c 100644 --- a/drivers/video/via/dvi.c +++ b/drivers/video/via/dvi.c | |||
@@ -172,28 +172,20 @@ static int tmds_register_read_bytes(int index, u8 *buff, int buff_len) | |||
172 | } | 172 | } |
173 | 173 | ||
174 | /* DVI Set Mode */ | 174 | /* DVI Set Mode */ |
175 | void viafb_dvi_set_mode(struct VideoModeTable *mode, int mode_bpp, | 175 | void viafb_dvi_set_mode(const struct fb_var_screeninfo *var, int iga) |
176 | int set_iga) | ||
177 | { | 176 | { |
178 | struct VideoModeTable *rb_mode; | 177 | struct fb_var_screeninfo dvi_var = *var; |
179 | struct crt_mode_table *pDviTiming; | 178 | struct crt_mode_table *rb_mode; |
180 | unsigned long desirePixelClock, maxPixelClock; | 179 | int maxPixelClock; |
181 | pDviTiming = mode->crtc; | 180 | |
182 | desirePixelClock = pDviTiming->refresh_rate | 181 | maxPixelClock = viaparinfo->shared->tmds_setting_info.max_pixel_clock; |
183 | * pDviTiming->crtc.hor_total * pDviTiming->crtc.ver_total | 182 | if (maxPixelClock && PICOS2KHZ(var->pixclock) / 1000 > maxPixelClock) { |
184 | / 1000000; | 183 | rb_mode = viafb_get_best_rb_mode(var->xres, var->yres, 60); |
185 | maxPixelClock = (unsigned long)viaparinfo-> | ||
186 | tmds_setting_info->max_pixel_clock; | ||
187 | |||
188 | DEBUG_MSG(KERN_INFO "\nDVI_set_mode!!\n"); | ||
189 | |||
190 | if ((maxPixelClock != 0) && (desirePixelClock > maxPixelClock)) { | ||
191 | rb_mode = viafb_get_rb_mode(mode->crtc[0].crtc.hor_addr, | ||
192 | mode->crtc[0].crtc.ver_addr); | ||
193 | if (rb_mode) | 184 | if (rb_mode) |
194 | mode = rb_mode; | 185 | viafb_fill_var_timing_info(&dvi_var, rb_mode); |
195 | } | 186 | } |
196 | viafb_fill_crtc_timing(mode, mode_bpp / 8, set_iga); | 187 | |
188 | viafb_fill_crtc_timing(&dvi_var, iga); | ||
197 | } | 189 | } |
198 | 190 | ||
199 | /* Sense DVI Connector */ | 191 | /* Sense DVI Connector */ |