• Benoit Parrot's avatar
    [media] media: ti-vpe: vpe: Make sure frame size dont exceed scaler capacity · 35be6d86
    Benoit Parrot authored
    When scaler is to be used we need to make sure that the input and
    output frame size do not exceed the maximum frame sizes that the
    scaler h/w can handle otherwise streaming stall as the scaler
    cannot proceed.
    
    The scaler buffer is limited to 2047 pixels (i.e. 11 bits) when
    attempting anything larger (2048 for example) the scaler stalls.
    
    Realistically in an mem2mem device we can only check for this type
    of issue when start_streaming is called. We can't do it during the
    try_fmt/s_fmt because we do not have all of the info needed at that
    point. So instead when start_streaming is called we need to check
    that the input and output frames size do not exceed the scaler's
    capability. The only time larger frame size are allowed is when
    the input frame szie is the same as the output frame size.
    
    Now in the case where we need to fail, start_streaming must return
    all previously queued buffer back otherwise the vb2 framework
    will issue kernel WARN messages.
    In this case we also give an error message.
    Signed-off-by: default avatarBenoit Parrot <bparrot@ti.com>
    Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
    35be6d86
vpe.c 64.8 KB