viafb: eliminate modetable dependancy of LCD modesetting

This patch removes the need for knowing the modetable structure
within the LCD modesetting function. The magic 60Hz refresh rate was
already there as always the first entry for a resolution was choosen
based on the ascending refresh rate ordering in the modetable.
For all but one this is at least 60Hz, if only higher frequencies
available we choose those like the code before did. The exception is
OLPC but that resolution has only one frequency so we get the same
behaviour there as well.
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 4fbf4bfe
...@@ -1937,9 +1937,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, ...@@ -1937,9 +1937,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
if (viafb_SAMM_ON && if (viafb_SAMM_ON &&
(viaparinfo->lvds_setting_info->iga_path == IGA2)) { (viaparinfo->lvds_setting_info->iga_path == IGA2)) {
viaparinfo->lvds_setting_info->bpp = video_bpp1; viaparinfo->lvds_setting_info->bpp = video_bpp1;
viafb_lcd_set_mode(crt_timing1, viaparinfo-> viafb_lcd_set_mode(viaparinfo->lvds_setting_info,
lvds_setting_info, &viaparinfo->chip_info->lvds_chip_info);
&viaparinfo->chip_info->lvds_chip_info);
} else { } else {
/* IGA1 doesn't have LCD scaling, so set it center. */ /* IGA1 doesn't have LCD scaling, so set it center. */
if (viaparinfo->lvds_setting_info->iga_path == IGA1) { if (viaparinfo->lvds_setting_info->iga_path == IGA1) {
...@@ -1947,18 +1946,16 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, ...@@ -1947,18 +1946,16 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
LCD_CENTERING; LCD_CENTERING;
} }
viaparinfo->lvds_setting_info->bpp = video_bpp; viaparinfo->lvds_setting_info->bpp = video_bpp;
viafb_lcd_set_mode(crt_timing, viaparinfo-> viafb_lcd_set_mode(viaparinfo->lvds_setting_info,
lvds_setting_info, &viaparinfo->chip_info->lvds_chip_info);
&viaparinfo->chip_info->lvds_chip_info);
} }
} }
if (viafb_LCD2_ON) { if (viafb_LCD2_ON) {
if (viafb_SAMM_ON && if (viafb_SAMM_ON &&
(viaparinfo->lvds_setting_info2->iga_path == IGA2)) { (viaparinfo->lvds_setting_info2->iga_path == IGA2)) {
viaparinfo->lvds_setting_info2->bpp = video_bpp1; viaparinfo->lvds_setting_info2->bpp = video_bpp1;
viafb_lcd_set_mode(crt_timing1, viaparinfo-> viafb_lcd_set_mode(viaparinfo->lvds_setting_info2,
lvds_setting_info2, &viaparinfo->chip_info->lvds_chip_info2);
&viaparinfo->chip_info->lvds_chip_info2);
} else { } else {
/* IGA1 doesn't have LCD scaling, so set it center. */ /* IGA1 doesn't have LCD scaling, so set it center. */
if (viaparinfo->lvds_setting_info2->iga_path == IGA1) { if (viaparinfo->lvds_setting_info2->iga_path == IGA1) {
...@@ -1966,9 +1963,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, ...@@ -1966,9 +1963,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
LCD_CENTERING; LCD_CENTERING;
} }
viaparinfo->lvds_setting_info2->bpp = video_bpp; viaparinfo->lvds_setting_info2->bpp = video_bpp;
viafb_lcd_set_mode(crt_timing, viaparinfo-> viafb_lcd_set_mode(viaparinfo->lvds_setting_info2,
lvds_setting_info2, &viaparinfo->chip_info->lvds_chip_info2);
&viaparinfo->chip_info->lvds_chip_info2);
} }
} }
......
...@@ -548,9 +548,8 @@ static void lcd_patch_skew(struct lvds_setting_information ...@@ -548,9 +548,8 @@ static void lcd_patch_skew(struct lvds_setting_information
} }
/* LCD Set Mode */ /* LCD Set Mode */
void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, void viafb_lcd_set_mode(struct lvds_setting_information *plvds_setting_info,
struct lvds_setting_information *plvds_setting_info, struct lvds_chip_information *plvds_chip_info)
struct lvds_chip_information *plvds_chip_info)
{ {
int set_iga = plvds_setting_info->iga_path; int set_iga = plvds_setting_info->iga_path;
int mode_bpp = plvds_setting_info->bpp; int mode_bpp = plvds_setting_info->bpp;
...@@ -560,15 +559,14 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, ...@@ -560,15 +559,14 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
int panel_vres = plvds_setting_info->lcd_panel_vres; int panel_vres = plvds_setting_info->lcd_panel_vres;
u32 clock; u32 clock;
struct display_timing mode_crt_reg, panel_crt_reg, timing; struct display_timing mode_crt_reg, panel_crt_reg, timing;
struct crt_mode_table *panel_crt_table = NULL; struct crt_mode_table *mode_crt_table, *panel_crt_table;
struct VideoModeTable *vmode_tbl = viafb_get_mode(panel_hres,
panel_vres);
DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n"); DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n");
/* Get mode table */ /* Get mode table */
mode_crt_table = viafb_get_best_mode(set_hres, set_vres, 60);
mode_crt_reg = mode_crt_table->crtc; mode_crt_reg = mode_crt_table->crtc;
/* Get panel table Pointer */ /* Get panel table Pointer */
panel_crt_table = vmode_tbl->crtc; panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);
panel_crt_reg = panel_crt_table->crtc; panel_crt_reg = panel_crt_table->crtc;
DEBUG_MSG(KERN_INFO "bellow viafb_lcd_set_mode!!\n"); DEBUG_MSG(KERN_INFO "bellow viafb_lcd_set_mode!!\n");
if (VT1636_LVDS == plvds_chip_info->lvds_chip_name) if (VT1636_LVDS == plvds_chip_info->lvds_chip_name)
......
...@@ -76,9 +76,8 @@ void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information ...@@ -76,9 +76,8 @@ void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
*plvds_chip_info, *plvds_chip_info,
struct lvds_setting_information struct lvds_setting_information
*plvds_setting_info); *plvds_setting_info);
void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, void viafb_lcd_set_mode(struct lvds_setting_information *plvds_setting_info,
struct lvds_setting_information *plvds_setting_info, struct lvds_chip_information *plvds_chip_info);
struct lvds_chip_information *plvds_chip_info);
bool __devinit viafb_lvds_trasmitter_identify(void); bool __devinit viafb_lvds_trasmitter_identify(void);
void viafb_init_lvds_output_interface(struct lvds_chip_information void viafb_init_lvds_output_interface(struct lvds_chip_information
*plvds_chip_info, *plvds_chip_info,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment