All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Syncing to vblank for interlaced video modes
@ 2009-06-14 18:34 Dirk Thierbach
  2009-06-14 18:58 ` Alistair Buxton
  0 siblings, 1 reply; 14+ messages in thread
From: Dirk Thierbach @ 2009-06-14 18:34 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Syncing to vblank for interlaced video modes
@ 2009-06-14 12:32 Jamie Smith
       [not found] ` <20090614223218.a3b6ce8e.hutts-CkBdp7X+a1oIQCUVoCVjmQ@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Jamie Smith @ 2009-06-14 12:32 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hello,

I'll start by applauding your efforts to make an open source driver for nv hardware.  I imagine it is a very difficult task trying to reverse engineer hardware and produce something useful and featureful.

I wish to make a change to the nouveau source.  You might say I am considering becoming a nouveau developer.  I am one of those crazy nutters who connects my nvidia card directly to a television via a vga2scart cable using interlaced video modes.  As you are probably aware, interlaced video signals generate two alternating half frames or 'fields', which the interlaced display cleverly weaves together to form a full picture.

DVD playing software typically works by generating a progressive video stream by combining two consecutive (first and second) fields to produce a full progressive frame.  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.

The current proprietary drivers from nVidia synchronise buffer updates to the retrace after each single half frame is drawn, which for the most part is not satisfactory.  The symptoms of this are explained very well in this post -> http://www.nvnews.net/vbulletin/showthread.php?t=95836

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.  I'm going to assume the nVidia cards have something similar, and I'm hoping someone may either a) know this information already so I can make a pretty simple change or b) suggest a way that I might find out this information.

Sincerely,

Jamie.

-- 
Jamie Smith <hutts-CkBdp7X+a1oIQCUVoCVjmQ@public.gmane.org>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-02-10  1:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-14 18:34 Syncing to vblank for interlaced video modes Dirk Thierbach
2009-06-14 18:58 ` 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

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.