media: verisilicon: Do not change context bit depth before validating the format
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Mon, 20 Feb 2023 10:48:47 +0000 (10:48 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 10 Apr 2023 13:18:13 +0000 (14:18 +0100)
commit3c32d94c9c52f9a49b4e9626e96bcc7528fe1b27
tree3c7927d335d9d7c89fd9f021007ed5b2f4e3b9e0
parent6aa3b9c5da6e15a8b60322b3fdd058856de30305
media: verisilicon: Do not change context bit depth before validating the format

It is needed to check if the proposed pixels format is valid before
updating context bit depth and other internal states.
Stop using ctx->bit_depth to check format depth match and return
result to the caller.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/verisilicon/hantro_postproc.c
drivers/media/platform/verisilicon/hantro_v4l2.c
drivers/media/platform/verisilicon/hantro_v4l2.h