Commit 734b4157 authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by Eric Anholt

drm/i915: Add support for interlaced display.

This doesn't change the clock limits (minimums), i.e. it won't make it
output 720x576 PAL nor 720x480 NTSC, but it will work with modes like
1080i etc. (including GLX and textured Xvideo, not sure about the
overlay).

Tested on i915 + analog VGA, it would be worth checking if newer chips
(and which ones) still support interlaced mode.
Signed-off-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent f953c935
...@@ -569,7 +569,7 @@ void intel_crt_init(struct drm_device *dev) ...@@ -569,7 +569,7 @@ void intel_crt_init(struct drm_device *dev)
(1 << INTEL_ANALOG_CLONE_BIT) | (1 << INTEL_ANALOG_CLONE_BIT) |
(1 << INTEL_SDVO_LVDS_CLONE_BIT); (1 << INTEL_SDVO_LVDS_CLONE_BIT);
intel_encoder->crtc_mask = (1 << 0) | (1 << 1); intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
connector->interlace_allowed = 0; connector->interlace_allowed = 1;
connector->doublescan_allowed = 0; connector->doublescan_allowed = 0;
drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs); drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs);
......
...@@ -2354,6 +2354,8 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, ...@@ -2354,6 +2354,8 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
if (mode->clock * 3 > 27000 * 4) if (mode->clock * 3 > 27000 * 4)
return MODE_CLOCK_HIGH; return MODE_CLOCK_HIGH;
} }
drm_mode_set_crtcinfo(adjusted_mode, 0);
return true; return true;
} }
...@@ -3781,6 +3783,18 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, ...@@ -3781,6 +3783,18 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
} }
} }
if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) {
pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION;
/* the chip adds 2 halflines automatically */
adjusted_mode->crtc_vdisplay -= 1;
adjusted_mode->crtc_vtotal -= 1;
adjusted_mode->crtc_vblank_start -= 1;
adjusted_mode->crtc_vblank_end -= 1;
adjusted_mode->crtc_vsync_end -= 1;
adjusted_mode->crtc_vsync_start -= 1;
} else
pipeconf &= ~PIPECONF_INTERLACE_W_FIELD_INDICATION; /* progressive */
I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) | I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) |
((adjusted_mode->crtc_htotal - 1) << 16)); ((adjusted_mode->crtc_htotal - 1) << 16));
I915_WRITE(hblank_reg, (adjusted_mode->crtc_hblank_start - 1) | I915_WRITE(hblank_reg, (adjusted_mode->crtc_hblank_start - 1) |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment