• Niklas Söderlund's avatar
    media: rcar-vin: Use scratch buffer when not in running state · 90ed5785
    Niklas Söderlund authored
    In its early stages the VIN driver did not use an internal scratch
    buffer. This leads to a unnecessary complex start and stop behavior,
    specially for TB/BT. The driver now always allocates a scratch buffer to
    deal with buffer under-runs, use the scratch buffer to also simplify
    starting and stopping.
    
    When capture is starting use the scratch buffer instead of a user-space
    buffers while syncing the driver with the hardware state. This allows
    the driver to know that no user-space buffer is given to the hardware
    before the running state is reached.
    
    When capture is stopping use the scratch buffer instead of leaving the
    user-space buffers in place and add a check that all user-space buffers
    are processed by the hardware before transitioning from the stopping to
    stopped state. This allows the driver to know all user-space buffers
    given to the hardware are fully processed.
    
    This change in itself does not improve the driver much but it paves the
    way for future simplifications and enhancements. One direct improvement
    of this change is that TB/BT buffers returned to user-space while stopping
    will always contain both fields, that was not guaranteed before.
    Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
    Reviewed-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    90ed5785
rcar-dma.c 41.2 KB