media: rockchip: rga: Only set output CSC mode for RGB input
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 30 Apr 2020 16:42:45 +0000 (18:42 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 4 Jul 2020 10:44:59 +0000 (12:44 +0200)
commit0f879bab72f47e8ba2421a984e7acfa763d3e84e
tree103d9999949b2157fba2261c460b7734b1e44862
parentded874ece29d3fe2abd3775810a06056067eb68c
media: rockchip: rga: Only set output CSC mode for RGB input

Setting the output CSC mode is required for a YUV output, but must not
be set when the input is also YUV. Doing this (as tested with a YUV420P
to YUV420P conversion) results in wrong colors.

Adapt the logic to only set the output CSC mode when the output is YUV and
the input is RGB. Also add a comment to clarify the rationale.

Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/rockchip/rga/rga-hw.c