On Mon, 2018-06-04 at 07:35 +0200, Krzysztof Hałasa wrote:
> Philipp Zabel <p.za...@pengutronix.de> writes:
> 
> > This is ok in this patch, but we can't use this check in the following
> > TRY_FMT patch as there is no way to interweave
> > SEQ_TB -> INTERLACED_BT (because in SEQ_TB the B field is newer than T,
> > but in INTERLACED_BT it has to be older) or SEQ_BT -> INTERLACED_TB (the
> > other way around).
> 
> Actually we can do SEQ_TB -> INTERLACED_BT and SEQ_BT -> INTERLACED_TB
> rather easily. We only need to skip a single field at start :-)
> That's what CCIR_CODE_* registers do.
> 
> To be honest, SEQ_TB and SEQ_BT are precisely the same thing
> (i.e., SEQUENTIAL). It's up to the user to say which field is the first.
> There is the progressive sensor exception, though, and the TB/BT could
> be a hint for downstream elements (i.e., setting the default field
> order).
> 
> But I think we should be able to request INTERLACED_TB or INTERLACED_BT
> (with any analog signal on input) and the CCIR_CODE registers should be
> set accordingly. This should all magically work fine.

The CSI subdevice itself can't interweave at all, this is done in the
IDMAC.
In my opinion the CSI subdev should allow the following src -> sink
field transformations for BT.656:

none -> none
seq-tb -> seq-tb
seq-tb -> seq-bt
seq-bt -> seq-bt
seq-bt -> seq-tb
alternate -> seq-tb
alternate -> seq-bt
interlaced -> interlaced
interlaced-tb -> interlaced-tb
interlaced-bt -> interlaced-bt

The capture video device should then additionally allow selecting
the field order that can be produced by IDMAC interweaving:
INTERLACED_TB if the pad is seq-tb and INTERLACED_BT if the pad is seq-
bt, as that is what the IDMAC can convert.

seq-tb -> seq-tb and seq-bt -> seq-bt should always capture field 0
first, as we currently do for PAL.
seq->tb -> seq-bt and seq-bt -> seq-tb should always capture field 1
first, as we currently do for NTSC.
alternate -> seq-tb and alternate -> seq-bt should match seq-tb -> * for
PAL and seq-bt -> * for NTSC.
The interlaced* -> interlaced* would be handled as progressive.

regards
Philipp

Reply via email to