Commit 0b64a837 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab
Browse files

media: staging: rkisp1: rsz: change (hv)div only if capture format is YUV



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: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 21e4cdcb
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -394,9 +394,14 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
	 * but also to change the scale for YUV formats,
	 * (4:2:2 -> 4:2:0 for example). So the width/height of the CbCr
	 * streams should be set according to the pixel format in the capture.
	 * The resizer always gets the input as YUV422. If the capture format
	 * is RGB then the memory input should be YUV422 so we don't change the
	 * default hdiv, vdiv in that case.
	 */
	if (v4l2_is_format_yuv(cap->pix.info)) {
		hdiv = cap->pix.info->hdiv;
		vdiv = cap->pix.info->vdiv;
	}

	src_c.width = src_y.width / hdiv;
	src_c.height = src_y.height / vdiv;