• Tomi Valkeinen's avatar
    media: ti: cal: use CSI-2 frame number for seq number · ebdb28a5
    Tomi Valkeinen authored
    The userspace needs a way to match received metadata buffers to pixel
    data buffers. The obvious way to do this is to use the CSI-2 frame
    number, as both the metadata and the pixel data have the same frame
    number as they come from the same frame.
    
    However, we don't have means to convey the frame number to userspace. We
    do have the 'sequence' field, which with a few tricks can be used for
    this purpose.
    
    To achieve this, track the frame number for each virtual channel and
    increase the sequence for each virtual channel by frame-number -
    previous-frame-number, also taking into account the eventual wrap of the
    CSI-2 frame number. If the CSI-2 peripheral does not support frame
    numbers, CAL increases the frame number register by one each frame.
    
    This way we get a monotonically increasing sequence number which is
    common to all streams using the same virtual channel.
    Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
    ebdb28a5
cal-camerarx.c 25.4 KB