diff options
| -rw-r--r-- | drivers/gpu/drm/sti/sti_vtg.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c index 740d6e347a62..9564f2568e2c 100644 --- a/drivers/gpu/drm/sti/sti_vtg.c +++ b/drivers/gpu/drm/sti/sti_vtg.c | |||
| @@ -51,10 +51,19 @@ | |||
| 51 | #define VTG_TOP_V_HD_3 0x010C | 51 | #define VTG_TOP_V_HD_3 0x010C |
| 52 | #define VTG_BOT_V_HD_3 0x0110 | 52 | #define VTG_BOT_V_HD_3 0x0110 |
| 53 | 53 | ||
| 54 | #define VTG_H_HD_4 0x0120 | ||
| 55 | #define VTG_TOP_V_VD_4 0x0124 | ||
| 56 | #define VTG_BOT_V_VD_4 0x0128 | ||
| 57 | #define VTG_TOP_V_HD_4 0x012c | ||
| 58 | #define VTG_BOT_V_HD_4 0x0130 | ||
| 59 | |||
| 54 | #define VTG_IRQ_BOTTOM BIT(0) | 60 | #define VTG_IRQ_BOTTOM BIT(0) |
| 55 | #define VTG_IRQ_TOP BIT(1) | 61 | #define VTG_IRQ_TOP BIT(1) |
| 56 | #define VTG_IRQ_MASK (VTG_IRQ_TOP | VTG_IRQ_BOTTOM) | 62 | #define VTG_IRQ_MASK (VTG_IRQ_TOP | VTG_IRQ_BOTTOM) |
| 57 | 63 | ||
| 64 | /* Delay introduced by the HDMI in nb of pixel */ | ||
| 65 | #define HDMI_DELAY (6) | ||
| 66 | |||
| 58 | /* delay introduced by the Arbitrary Waveform Generator in nb of pixels */ | 67 | /* delay introduced by the Arbitrary Waveform Generator in nb of pixels */ |
| 59 | #define AWG_DELAY_HD (-9) | 68 | #define AWG_DELAY_HD (-9) |
| 60 | #define AWG_DELAY_ED (-8) | 69 | #define AWG_DELAY_ED (-8) |
| @@ -133,10 +142,10 @@ static void vtg_set_mode(struct sti_vtg *vtg, | |||
| 133 | writel(tmp, vtg->regs + VTG_VID_TFS); | 142 | writel(tmp, vtg->regs + VTG_VID_TFS); |
| 134 | writel(tmp, vtg->regs + VTG_VID_BFS); | 143 | writel(tmp, vtg->regs + VTG_VID_BFS); |
| 135 | 144 | ||
| 136 | /* prepare VTG set 1 and 2 for HDMI and VTG set 3 for HD DAC */ | 145 | /* prepare VTG set 1 for HDMI */ |
| 137 | tmp = (mode->hsync_end - mode->hsync_start) << 16; | 146 | tmp = (mode->hsync_end - mode->hsync_start + HDMI_DELAY) << 16; |
| 147 | tmp |= HDMI_DELAY; | ||
| 138 | writel(tmp, vtg->regs + VTG_H_HD_1); | 148 | writel(tmp, vtg->regs + VTG_H_HD_1); |
| 139 | writel(tmp, vtg->regs + VTG_H_HD_2); | ||
| 140 | 149 | ||
| 141 | tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; | 150 | tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; |
| 142 | tmp |= 1; | 151 | tmp |= 1; |
| @@ -146,6 +155,11 @@ static void vtg_set_mode(struct sti_vtg *vtg, | |||
| 146 | writel(0, vtg->regs + VTG_BOT_V_HD_1); | 155 | writel(0, vtg->regs + VTG_BOT_V_HD_1); |
| 147 | 156 | ||
| 148 | /* prepare VTG set 2 for for HD DCS */ | 157 | /* prepare VTG set 2 for for HD DCS */ |
| 158 | tmp = (mode->hsync_end - mode->hsync_start) << 16; | ||
| 159 | writel(tmp, vtg->regs + VTG_H_HD_2); | ||
| 160 | |||
| 161 | tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; | ||
| 162 | tmp |= 1; | ||
| 149 | writel(tmp, vtg->regs + VTG_TOP_V_VD_2); | 163 | writel(tmp, vtg->regs + VTG_TOP_V_VD_2); |
| 150 | writel(tmp, vtg->regs + VTG_BOT_V_VD_2); | 164 | writel(tmp, vtg->regs + VTG_BOT_V_VD_2); |
| 151 | writel(0, vtg->regs + VTG_TOP_V_HD_2); | 165 | writel(0, vtg->regs + VTG_TOP_V_HD_2); |
| @@ -166,6 +180,17 @@ static void vtg_set_mode(struct sti_vtg *vtg, | |||
| 166 | writel(tmp, vtg->regs + VTG_TOP_V_HD_3); | 180 | writel(tmp, vtg->regs + VTG_TOP_V_HD_3); |
| 167 | writel(tmp, vtg->regs + VTG_BOT_V_HD_3); | 181 | writel(tmp, vtg->regs + VTG_BOT_V_HD_3); |
| 168 | 182 | ||
| 183 | /* Prepare VTG set 4 for DVO */ | ||
| 184 | tmp = (mode->hsync_end - mode->hsync_start) << 16; | ||
| 185 | writel(tmp, vtg->regs + VTG_H_HD_4); | ||
| 186 | |||
| 187 | tmp = (mode->vsync_end - mode->vsync_start + 1) << 16; | ||
| 188 | tmp |= 1; | ||
| 189 | writel(tmp, vtg->regs + VTG_TOP_V_VD_4); | ||
| 190 | writel(tmp, vtg->regs + VTG_BOT_V_VD_4); | ||
| 191 | writel(0, vtg->regs + VTG_TOP_V_HD_4); | ||
| 192 | writel(0, vtg->regs + VTG_BOT_V_HD_4); | ||
| 193 | |||
| 169 | /* mode */ | 194 | /* mode */ |
| 170 | writel(type, vtg->regs + VTG_MODE); | 195 | writel(type, vtg->regs + VTG_MODE); |
| 171 | } | 196 | } |
