Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218761
b: refs/heads/master
c: 2e1abbd
h: refs/heads/master
i:
  218759: 7cf4fe8
v: v3
  • Loading branch information
Florian Tobias Schandinat authored and Florian Tobias Schandinat committed Sep 24, 2010
1 parent d6bb9f6 commit a3cc86a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f0e153e2c0b15aa7427ad4ac550640e1e2e9c33
refs/heads/master: 2e1abbdd1dbc49e16eabd13e8b2458ee48e7b560
34 changes: 25 additions & 9 deletions trunk/drivers/video/via/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
int index = 0;
int h_addr, v_addr;
u32 pll_D_N;
u8 polarity = 0;

for (i = 0; i < video_mode->mode_array; i++) {
index = i;
Expand All @@ -2041,14 +2040,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,

h_addr = crt_reg.hor_addr;
v_addr = crt_reg.ver_addr;

/* update polarity for CRT timing */
if (crt_table[index].h_sync_polarity == NEGATIVE)
polarity |= VIA_HSYNC_NEGATIVE;
if (crt_table[index].v_sync_polarity == NEGATIVE)
polarity |= VIA_VSYNC_NEGATIVE;
via_set_sync_polarity(VIA_CRT, polarity);

if (set_iga == IGA1) {
viafb_unlock_crt();
viafb_write_reg(CR09, VIACR, 0x00); /*initial CR09=0 */
Expand Down Expand Up @@ -2352,6 +2343,17 @@ static void set_display_channel(void)
}
}

static u8 get_sync(struct fb_info *info)
{
u8 polarity = 0;

if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT))
polarity |= VIA_HSYNC_NEGATIVE;
if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
polarity |= VIA_VSYNC_NEGATIVE;
return polarity;
}

int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
struct VideoModeTable *vmode_tbl1, int video_bpp1)
{
Expand Down Expand Up @@ -2566,6 +2568,15 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
viafb_DeviceStatus = CRT_Device;
}
device_on();
if (!viafb_dual_fb)
via_set_sync_polarity(devices, get_sync(viafbinfo));
else {
via_set_sync_polarity(viaparinfo->shared->iga1_devices,
get_sync(viafbinfo));
via_set_sync_polarity(viaparinfo->shared->iga2_devices,
get_sync(viafbinfo1));
}

via_set_state(devices, VIA_STATE_ON);
device_screen_on();
return 1;
Expand Down Expand Up @@ -2719,4 +2730,9 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
crt_reg.ver_total - (crt_reg.ver_sync_start + crt_reg.ver_sync_end);
var->lower_margin = crt_reg.ver_sync_start - crt_reg.ver_addr;
var->vsync_len = crt_reg.ver_sync_end;
var->sync = 0;
if (crt_timing[index].h_sync_polarity == POSITIVE)
var->sync |= FB_SYNC_HOR_HIGH_ACT;
if (crt_timing[index].v_sync_polarity == POSITIVE)
var->sync |= FB_SYNC_VERT_HIGH_ACT;
}

0 comments on commit a3cc86a

Please sign in to comment.