<div class="gmail_quote">On Sat, Jan 28, 2012 at 11:49, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

We have a pretty decent confusion about vertical timings of interlaced<br>
modes. Peter Ross has written a patch that makes interlace modes work<br>
on a lot more platforms/output combinations by doubling the vertical<br>
timings.<br>
<br>
The issue with that patch is that core drm _does_ support specifying<br>
whether we want these vertical timings in fields or frames, we just<br>
haven't managed to consistently use this facility. The relavant<br>
function is drm_mode_set_crtcinfo, which fills in the crtc timing<br>
information.<br>
<br>
The first thing to note is that the drm core keeps interlaced modes in<br>
frames, but displays modelines in fields. So when the crtc modeset<br>
helper copies over the mode into adjusted_mode it will already contain<br>
vertical timings in half-frames. The result is that the fixup code in<br>
intel_crtc_mode_fixup doesn't actually do anything (in most cases at<br>
least).<br>
<br>
Now gen3+ natively supports interlaced modes and wants the vertical<br>
timings in frames. Which is what sdvo already fixes up, at least under<br>
some conditions.<br>
<br>
There are a few other place that demand vertical timings in fields<br>
but never actually deal with interlaced modes, so use frame timings<br>
for consistency, too. These are:<br>
- lvds panel,<br>
- dvo encoders - dvo is the only way gen2 could support interlaced<br>
  mode, but currently we don't support any encoders that do.<br>
- tv out - despite that the tv dac sends out an interlaced signal it<br>
  expects a progressive mode pipe configuration.<br>
All these encoders enforce progressive modes by resetting<br>
interlace_allowed.<br>
<br>
Hence we always want crtc vertical timings in frames. Enforce this in<br>
our crtc mode_fixup function and rip out any redudant timing<br>
computations from the encoders' mode_fixup function.<br>
<br>
v2-4: Adjust the vertical timings a bit.<br>
<br>
v5: Split out the 'subtract-one for interlaced' fixes.<br>
<br>
v6: Clarify issues around tv-out and gen2.<br>
<br>
Signed-Off-by: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>><br></blockquote><div><br>Reviewed-by: Eugeni Dodonov <<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>> <br>

<br></div></div>-- <br>Eugeni Dodonov<a href="http://eugeni.dodonov.net/" target="_blank"><br></a><br>