aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_sdvo.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-08 07:39:59 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-08 07:39:59 -0400
commit5e13a0c5ec05d382b488a691dfb8af015b1dea1e (patch)
tree7a06dfa1f7661f8908193f2437b32452520221d3 /drivers/gpu/drm/i915/intel_sdvo.c
parentb615b57a124a4af7b68196bc2fb8acc236041fa2 (diff)
parent4f256e8aa3eda15c11c3cec3ec5336e1fc579cbd (diff)
Merge remote-tracking branch 'airlied/drm-core-next' into drm-intel-next-queued
Backmerge of drm-next to resolve a few ugly conflicts and to get a few fixes from 3.4-rc6 (which drm-next has already merged). Note that this merge also restricts the stencil cache lra evict policy workaround to snb (as it should) - I had to frob the code anyway because the CM0_MASK_SHIFT define died in the masked bit cleanups. We need the backmerge to get Paulo Zanoni's infoframe regression fix for gm45 - further bugfixes from him touch the same area and would needlessly conflict. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sdvo.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 9b3a5f999ad7..7d3f238e8265 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -745,6 +745,7 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
745 uint16_t width, height; 745 uint16_t width, height;
746 uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len; 746 uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len;
747 uint16_t h_sync_offset, v_sync_offset; 747 uint16_t h_sync_offset, v_sync_offset;
748 int mode_clock;
748 749
749 width = mode->hdisplay; 750 width = mode->hdisplay;
750 height = mode->vdisplay; 751 height = mode->vdisplay;
@@ -759,7 +760,11 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
759 h_sync_offset = mode->hsync_start - mode->hdisplay; 760 h_sync_offset = mode->hsync_start - mode->hdisplay;
760 v_sync_offset = mode->vsync_start - mode->vdisplay; 761 v_sync_offset = mode->vsync_start - mode->vdisplay;
761 762
762 dtd->part1.clock = mode->clock / 10; 763 mode_clock = mode->clock;
764 mode_clock /= intel_mode_get_pixel_multiplier(mode) ?: 1;
765 mode_clock /= 10;
766 dtd->part1.clock = mode_clock;
767
763 dtd->part1.h_active = width & 0xff; 768 dtd->part1.h_active = width & 0xff;
764 dtd->part1.h_blank = h_blank_len & 0xff; 769 dtd->part1.h_blank = h_blank_len & 0xff;
765 dtd->part1.h_high = (((width >> 8) & 0xf) << 4) | 770 dtd->part1.h_high = (((width >> 8) & 0xf) << 4) |
@@ -1010,7 +1015,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
1010 struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder); 1015 struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder);
1011 u32 sdvox; 1016 u32 sdvox;
1012 struct intel_sdvo_in_out_map in_out; 1017 struct intel_sdvo_in_out_map in_out;
1013 struct intel_sdvo_dtd input_dtd; 1018 struct intel_sdvo_dtd input_dtd, output_dtd;
1014 int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode); 1019 int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode);
1015 int rate; 1020 int rate;
1016 1021
@@ -1035,20 +1040,13 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
1035 intel_sdvo->attached_output)) 1040 intel_sdvo->attached_output))
1036 return; 1041 return;
1037 1042
1038 /* We have tried to get input timing in mode_fixup, and filled into 1043 /* lvds has a special fixed output timing. */
1039 * adjusted_mode. 1044 if (intel_sdvo->is_lvds)
1040 */ 1045 intel_sdvo_get_dtd_from_mode(&output_dtd,
1041 if (intel_sdvo->is_tv || intel_sdvo->is_lvds) { 1046 intel_sdvo->sdvo_lvds_fixed_mode);
1042 input_dtd = intel_sdvo->input_dtd; 1047 else
1043 } else { 1048 intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
1044 /* Set the output timing to the screen */ 1049 (void) intel_sdvo_set_output_timing(intel_sdvo, &output_dtd);
1045 if (!intel_sdvo_set_target_output(intel_sdvo,
1046 intel_sdvo->attached_output))
1047 return;
1048
1049 intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
1050 (void) intel_sdvo_set_output_timing(intel_sdvo, &input_dtd);
1051 }
1052 1050
1053 /* Set the input timing to the screen. Assume always input 0. */ 1051 /* Set the input timing to the screen. Assume always input 0. */
1054 if (!intel_sdvo_set_target_input(intel_sdvo)) 1052 if (!intel_sdvo_set_target_input(intel_sdvo))
@@ -1066,6 +1064,10 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
1066 !intel_sdvo_set_tv_format(intel_sdvo)) 1064 !intel_sdvo_set_tv_format(intel_sdvo))
1067 return; 1065 return;
1068 1066
1067 /* We have tried to get input timing in mode_fixup, and filled into
1068 * adjusted_mode.
1069 */
1070 intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
1069 (void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd); 1071 (void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd);
1070 1072
1071 switch (pixel_multiplier) { 1073 switch (pixel_multiplier) {