media: cedrus: Propagate OUTPUT resolution to CAPTURE
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 18 Sep 2020 00:27:51 +0000 (02:27 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 27 Sep 2020 09:20:05 +0000 (11:20 +0200)
commit8c608272ec3e6926ae2e258e74e84777d932ddd6
tree95c0977970fb435003b84806c1ce83ee0133fecf
parent2f8c737ed2c1fa13ed606f2c32f7ce95688fa1d9
media: cedrus: Propagate OUTPUT resolution to CAPTURE

As per spec, the CAPTURE resolution should be automatically set based on
the OUTPUT resolution. This patch properly propagate width/height to the
capture when the OUTPUT format is set and override the user provided
width/height with configured OUTPUT resolution when the CAPTURE fmt is
updated.

This also prevents userspace from selecting a CAPTURE resolution that is
too small, avoiding kernel oops.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Tested-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus_video.c