media: ti-vpe: vpe: Make sure frame size dont exceed scaler capacity
PATCH 31/35 media: ti-vpe: vpe: Make sure frame size dont exceed scaler capacity
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.
--- drivers/media/platform/ti-vpe/sc.h | 6 ++++ drivers/media/platform/ti-vpe/vpe.c | 71 ++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 17 deletions(-)
drivers/media/platform/ti-vpe/sc.h +6 -0
@@ -173,6 +173,12 @@/* number of taps expected by the scaler in it's coefficient memory */ #define SC_NUM_TAPS_MEM_ALIGN 8 +/* Maximum frame width the scaler can handle (in pixels) */ +#define SC_MAX_PIXEL_WIDTH 2047 + +/* Maximum frame height the scaler can handle (in lines) */ +#define SC_MAX_PIXEL_HEIGHT 2047 +/* * coefficient memory size in bytes: * num phases x num sets(luma and chroma) x num taps(aligned) x coeff size
drivers/media/platform/ti-vpe/vpe.c +54 -17
117 lines not on this page · raw message
Signature · 1 line
2.9.0