media: rockchip: rga: Introduce color fmt macros and refactor CSC mode logic
commit5f51ca677cd2952b4bd3d3a671e54b3180b8f5e2
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 30 Apr 2020 16:42:44 +0000 (30 18:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:05:30 +0000 (21 13:05 +0200)
treed7b3eca96f2b97b2da7f629e45c5ff57c39e5f3f
parent0f334b6684558658d1a92ba98695432223015c81
media: rockchip: rga: Introduce color fmt macros and refactor CSC mode logic

[ Upstream commit ded874ece29d3fe2abd3775810a06056067eb68c ]

This introduces two macros: RGA_COLOR_FMT_IS_YUV and RGA_COLOR_FMT_IS_RGB
which allow quick checking of the colorspace familily of a RGA color format.

These macros are then used to refactor the logic for CSC mode selection.
The two nested tests for input colorspace are simplified into a single one,
with a logical and, making the whole more readable.

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/rockchip/rga/rga-hw.c
drivers/media/platform/rockchip/rga/rga-hw.h