• Niklas Söderlund's avatar
    media: rcar-vin: Add support for suspend and resume · bea2b6a4
    Niklas Söderlund authored
    Add support for suspend and resume by stopping and starting the video
    pipeline while still retaining all buffers given to the driver by
    user-space and internally allocated ones, this gives the application a
    seamless experience.
    
    Buffers are never returned to user-space unprocessed so user-space don't
    notice when suspending. When resuming the driver restarts the capture
    session using the internal scratch buffer, this happens before
    user-space is unfrozen, this leads to speedy response times once the
    application resumes its execution.
    
    As the entire pipeline is stopped on suspend all subdevices in use are
    also stopped, and if they enter a shutdown state when not streaming
    (such as the R-Car CSI-2 driver) they too will be suspended and resumed
    in sync with the VIN driver.
    
    To be able to do keep track of which VINs should be resumed a new
    internal state SUSPENDED is added to recode this.
    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>
    bea2b6a4
rcar-vin.h 7.93 KB