All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Thierbach <dthierbach-Mmb7MZpHnFY@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: Syncing to vblank for interlaced video modes
Date: Sun, 14 Jun 2009 20:34:42 +0200	[thread overview]
Message-ID: <20090614183442.GA13749@feanor> (raw)

Younes Manton <younes.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Jamie Smith<hutts-CkBdp7X+a1oIQCUVoCVjmQ@public.gmane.org> wrote:

>> I am one of those crazy nutters who connects my nvidia card
>> directly to a television via a vga2scart cable using interlaced
>> video modes.

>> For the purpose of displaying true interlaced video (e.g. DVD) to
>> an interlaced television, without using deinterlacing, the full
>> video frames need to be written to the linear video buffer during
>> the retrace after the second frame is drawn, so that both fields
>> are ready to be output in correct order to the display.

Alternatively, it would probably be enough to write the frames
in the right order, i.e. write the even frame when the card displays
the even frame, etc.

>> If I understand, the nouveau drivers currently use the standard vga
>> crtc registers to detect video retrace, and this results in the same
>> behaviour.  According to specifications I have seen from AMD, at
>> least one Radeon series has registers which tell which field(first
>> or second) is currently being drawn, and which field will be next.

The register 0x600808 (PCRTC_RASTER) contains this information in bit 20
(0=even, 1=odd), at least for older cards. I have no idea if this register
is valid on your concrete hardware (and I don't even now which hardware
that is).

> If I understand you correctly you want the same image to be displayed
> for two frames, i.e. when the tv is showing the first and second
> fields.

> There's no parameter for that in Xv to know which field a particular
> XvPutImage corresponds to as far as I know. 

And that's the main problem, actually. There's the X SYNC extension

http://lesstif.sourceforge.net/doc/super-ux/g1ae04e/chap9.html

which provides synchronization counters that can be used to make this
information available (this has been discussed on the xorg mailing
list some years ago, BTW).

So you'd have to patch Noveau to provide a SYNC counter (maybe on
request), where the lowest bit of the sync counter should reflect if
it's an even or odd field, and then you've to patch your favorite
movie player to make use of this information and, say, delay for
one frame when it starts playing but the current field is odd, so that
even fields fall on even fields. You'd probably also need to take
any delays caused buffering into account.

Doable, but not easy.

- Dirk

             reply	other threads:[~2009-06-14 18:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 18:34 Dirk Thierbach [this message]
2009-06-14 18:58 ` Syncing to vblank for interlaced video modes Alistair Buxton
     [not found]   ` <3d374d00906141158h28a7d688re1133b656dcdb6c5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-06-14 22:56     ` Alistair Buxton
     [not found]       ` <3d374d00906141556y44d5d493j330cc1ebf79e5968-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-06-15  7:03         ` Dirk Thierbach
     [not found]           ` <3d374d00906150044h7ea2a845y189e070026ee9fc8@mail.gmail.com>
     [not found]             ` <3d374d00906150044h7ea2a845y189e070026ee9fc8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-06-15 10:43               ` Dirk Thierbach
2009-06-15 13:01                 ` Alistair Buxton
     [not found]                   ` <3d374d00906150601t5ddd1592i47b1323e0956967b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-06-15 14:14                     ` Jamie Smith
     [not found]                       ` <20090616001405.b4242c25.hutts-CkBdp7X+a1oIQCUVoCVjmQ@public.gmane.org>
2009-06-15 15:13                         ` Maarten Maathuis
2009-06-18  9:44                         ` Dirk Thierbach
2010-02-09 17:50                         ` Alistair Buxton
     [not found]                           ` <3d374d01002090950k45d60933k9aac481b87b62d4f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-09 18:21                             ` Younes Manton
     [not found]                               ` <586c2acd1002091021s4cfcc1b3h55d27459ee6d43a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-10  1:16                                 ` Alistair Buxton
  -- strict thread matches above, loose matches on Subject: below --
2009-06-14 12:32 Jamie Smith
     [not found] ` <20090614223218.a3b6ce8e.hutts-CkBdp7X+a1oIQCUVoCVjmQ@public.gmane.org>
2009-06-14 14:39   ` Younes Manton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090614183442.GA13749@feanor \
    --to=dthierbach-mmb7mzphnfy@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.