diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-02-12 15:08:41 -0500 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-02-12 17:12:45 -0500 |
commit | 4e5527c9d1f373cb7dda6eec3af1d7b9659cdf85 (patch) | |
tree | 2ee867025ca4fc64150feb9e78629e3b9e2888dc /drivers/video/via/lcd.c | |
parent | 532f9169db21fbffd07cc44075c7ea1859c07806 (diff) |
viafb: make SAMM to also work on LCD
This patch enables LCD to handle SAMM without dual fb.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via/lcd.c')
-rw-r--r-- | drivers/video/via/lcd.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c index 5f3b4e394e82..02cfdc8d7edd 100644 --- a/drivers/video/via/lcd.c +++ b/drivers/video/via/lcd.c | |||
@@ -55,8 +55,7 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, | |||
55 | int panel_vres); | 55 | int panel_vres); |
56 | static void via_pitch_alignment_patch_lcd( | 56 | static void via_pitch_alignment_patch_lcd( |
57 | struct lvds_setting_information *plvds_setting_info, | 57 | struct lvds_setting_information *plvds_setting_info, |
58 | struct lvds_chip_information | 58 | struct lvds_chip_information *plvds_chip_info, int hres); |
59 | *plvds_chip_info); | ||
60 | static void lcd_patch_skew_dvp0(struct lvds_setting_information | 59 | static void lcd_patch_skew_dvp0(struct lvds_setting_information |
61 | *plvds_setting_info, | 60 | *plvds_setting_info, |
62 | struct lvds_chip_information *plvds_chip_info); | 61 | struct lvds_chip_information *plvds_chip_info); |
@@ -456,14 +455,13 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, | |||
456 | 455 | ||
457 | static void via_pitch_alignment_patch_lcd( | 456 | static void via_pitch_alignment_patch_lcd( |
458 | struct lvds_setting_information *plvds_setting_info, | 457 | struct lvds_setting_information *plvds_setting_info, |
459 | struct lvds_chip_information | 458 | struct lvds_chip_information *plvds_chip_info, int hres) |
460 | *plvds_chip_info) | ||
461 | { | 459 | { |
462 | unsigned char cr13, cr35, cr65, cr66, cr67; | 460 | unsigned char cr13, cr35, cr65, cr66, cr67; |
463 | unsigned long dwScreenPitch = 0; | 461 | unsigned long dwScreenPitch = 0; |
464 | unsigned long dwPitch; | 462 | unsigned long dwPitch; |
465 | 463 | ||
466 | dwPitch = plvds_setting_info->h_active * (plvds_setting_info->bpp >> 3); | 464 | dwPitch = hres * (plvds_setting_info->bpp >> 3); |
467 | if (dwPitch & 0x1F) { | 465 | if (dwPitch & 0x1F) { |
468 | dwScreenPitch = ((dwPitch + 31) & ~31) >> 3; | 466 | dwScreenPitch = ((dwPitch + 31) & ~31) >> 3; |
469 | if (plvds_setting_info->iga_path == IGA2) { | 467 | if (plvds_setting_info->iga_path == IGA2) { |
@@ -548,13 +546,14 @@ static void lcd_patch_skew(struct lvds_setting_information | |||
548 | } | 546 | } |
549 | 547 | ||
550 | /* LCD Set Mode */ | 548 | /* LCD Set Mode */ |
551 | void viafb_lcd_set_mode(struct lvds_setting_information *plvds_setting_info, | 549 | void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres, |
550 | u16 cyres, struct lvds_setting_information *plvds_setting_info, | ||
552 | struct lvds_chip_information *plvds_chip_info) | 551 | struct lvds_chip_information *plvds_chip_info) |
553 | { | 552 | { |
554 | int set_iga = plvds_setting_info->iga_path; | 553 | int set_iga = plvds_setting_info->iga_path; |
555 | int mode_bpp = plvds_setting_info->bpp; | 554 | int mode_bpp = plvds_setting_info->bpp; |
556 | int set_hres = plvds_setting_info->h_active; | 555 | int set_hres = cxres ? cxres : var->xres; |
557 | int set_vres = plvds_setting_info->v_active; | 556 | int set_vres = cyres ? cyres : var->yres; |
558 | int panel_hres = plvds_setting_info->lcd_panel_hres; | 557 | int panel_hres = plvds_setting_info->lcd_panel_hres; |
559 | int panel_vres = plvds_setting_info->lcd_panel_vres; | 558 | int panel_vres = plvds_setting_info->lcd_panel_vres; |
560 | u32 clock; | 559 | u32 clock; |
@@ -613,7 +612,8 @@ void viafb_lcd_set_mode(struct lvds_setting_information *plvds_setting_info, | |||
613 | viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0); | 612 | viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0); |
614 | 613 | ||
615 | /* Patch for non 32bit alignment mode */ | 614 | /* Patch for non 32bit alignment mode */ |
616 | via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info); | 615 | via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info, |
616 | set_hres); | ||
617 | } | 617 | } |
618 | 618 | ||
619 | static void integrated_lvds_disable(struct lvds_setting_information | 619 | static void integrated_lvds_disable(struct lvds_setting_information |