diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-09-18 21:20:19 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-09-23 22:15:18 -0400 |
commit | 2e1abbdd1dbc49e16eabd13e8b2458ee48e7b560 (patch) | |
tree | 692c13608afb2e0540354af61da11aad80914f11 /drivers/video | |
parent | 7f0e153e2c0b15aa7427ad4ac550640e1e2e9c33 (diff) |
viafb: set sync polarity for all output devices
This patch sets the sync polarity for all output devices, not only CRT.
This may give some people a working screen but only if lcd scaling and
centering are not used as it is currently too dificult to propagate a
different resolution (from what the application thinks) to the correct
output device. Hopefully this does not introduce regressions as the
polarity of non-CRT devices was completly ignored before.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/via/hw.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index d6bbb0a05c3e..00fecb579acc 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -2014,7 +2014,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, | |||
2014 | int index = 0; | 2014 | int index = 0; |
2015 | int h_addr, v_addr; | 2015 | int h_addr, v_addr; |
2016 | u32 pll_D_N; | 2016 | u32 pll_D_N; |
2017 | u8 polarity = 0; | ||
2018 | 2017 | ||
2019 | for (i = 0; i < video_mode->mode_array; i++) { | 2018 | for (i = 0; i < video_mode->mode_array; i++) { |
2020 | index = i; | 2019 | index = i; |
@@ -2041,14 +2040,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, | |||
2041 | 2040 | ||
2042 | h_addr = crt_reg.hor_addr; | 2041 | h_addr = crt_reg.hor_addr; |
2043 | v_addr = crt_reg.ver_addr; | 2042 | v_addr = crt_reg.ver_addr; |
2044 | |||
2045 | /* update polarity for CRT timing */ | ||
2046 | if (crt_table[index].h_sync_polarity == NEGATIVE) | ||
2047 | polarity |= VIA_HSYNC_NEGATIVE; | ||
2048 | if (crt_table[index].v_sync_polarity == NEGATIVE) | ||
2049 | polarity |= VIA_VSYNC_NEGATIVE; | ||
2050 | via_set_sync_polarity(VIA_CRT, polarity); | ||
2051 | |||
2052 | if (set_iga == IGA1) { | 2043 | if (set_iga == IGA1) { |
2053 | viafb_unlock_crt(); | 2044 | viafb_unlock_crt(); |
2054 | viafb_write_reg(CR09, VIACR, 0x00); /*initial CR09=0 */ | 2045 | viafb_write_reg(CR09, VIACR, 0x00); /*initial CR09=0 */ |
@@ -2352,6 +2343,17 @@ static void set_display_channel(void) | |||
2352 | } | 2343 | } |
2353 | } | 2344 | } |
2354 | 2345 | ||
2346 | static u8 get_sync(struct fb_info *info) | ||
2347 | { | ||
2348 | u8 polarity = 0; | ||
2349 | |||
2350 | if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT)) | ||
2351 | polarity |= VIA_HSYNC_NEGATIVE; | ||
2352 | if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT)) | ||
2353 | polarity |= VIA_VSYNC_NEGATIVE; | ||
2354 | return polarity; | ||
2355 | } | ||
2356 | |||
2355 | int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, | 2357 | int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, |
2356 | struct VideoModeTable *vmode_tbl1, int video_bpp1) | 2358 | struct VideoModeTable *vmode_tbl1, int video_bpp1) |
2357 | { | 2359 | { |
@@ -2566,6 +2568,15 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp, | |||
2566 | viafb_DeviceStatus = CRT_Device; | 2568 | viafb_DeviceStatus = CRT_Device; |
2567 | } | 2569 | } |
2568 | device_on(); | 2570 | device_on(); |
2571 | if (!viafb_dual_fb) | ||
2572 | via_set_sync_polarity(devices, get_sync(viafbinfo)); | ||
2573 | else { | ||
2574 | via_set_sync_polarity(viaparinfo->shared->iga1_devices, | ||
2575 | get_sync(viafbinfo)); | ||
2576 | via_set_sync_polarity(viaparinfo->shared->iga2_devices, | ||
2577 | get_sync(viafbinfo1)); | ||
2578 | } | ||
2579 | |||
2569 | via_set_state(devices, VIA_STATE_ON); | 2580 | via_set_state(devices, VIA_STATE_ON); |
2570 | device_screen_on(); | 2581 | device_screen_on(); |
2571 | return 1; | 2582 | return 1; |
@@ -2719,4 +2730,9 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh, | |||
2719 | crt_reg.ver_total - (crt_reg.ver_sync_start + crt_reg.ver_sync_end); | 2730 | crt_reg.ver_total - (crt_reg.ver_sync_start + crt_reg.ver_sync_end); |
2720 | var->lower_margin = crt_reg.ver_sync_start - crt_reg.ver_addr; | 2731 | var->lower_margin = crt_reg.ver_sync_start - crt_reg.ver_addr; |
2721 | var->vsync_len = crt_reg.ver_sync_end; | 2732 | var->vsync_len = crt_reg.ver_sync_end; |
2733 | var->sync = 0; | ||
2734 | if (crt_timing[index].h_sync_polarity == POSITIVE) | ||
2735 | var->sync |= FB_SYNC_HOR_HIGH_ACT; | ||
2736 | if (crt_timing[index].v_sync_polarity == POSITIVE) | ||
2737 | var->sync |= FB_SYNC_VERT_HIGH_ACT; | ||
2722 | } | 2738 | } |