@@ -389,8 +389,18 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
&rsz->rkisp1->capture_devs[rsz->id];
const struct v4l2_format_info *pixfmt_info = cap->pix.info;
- hdiv = pixfmt_info->hdiv;
- vdiv = pixfmt_info->vdiv;
+ /*
+ * The resizer always get the input as YUV422
+ * If the capture encoding is also YUV, then the resizer should
+ * change the 4:2:2 sampling to the sampling of the capture
+ * format (4:2:2 -> 4:2:0 for example).
+ * If the capture format is RGB then the memory input should
+ * be YUV422 so we don't change the default hdiv, vdiv
+ */
+ if (v4l2_is_format_yuv(pixfmt_info)) {
+ hdiv = pixfmt_info->hdiv;
+ vdiv = pixfmt_info->vdiv;
+ }
}
src_c.width = src_y.width / hdiv;
src_c.height = src_y.height / vdiv;
RGB formats in selfpath should receive input format as YUV422. The resizer input format is always YUV422 and therefore if the capture format is RGB, the resizer should not change the YUV rations. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> --- drivers/staging/media/rkisp1/rkisp1-resizer.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)