mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
media: imx: utils: Inline init_mbus_colorimetry() in its caller
The init_mbus_colorimetry() function is small and used in a single place. The code becomes easier to follow if it gets inline in its caller. Do so. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
1df2148fdf
commit
c25ab5caf5
@ -210,19 +210,6 @@ static const struct imx_media_pixfmt ipu_rgb_formats[] = {
|
||||
|
||||
#define NUM_IPU_RGB_FORMATS ARRAY_SIZE(ipu_rgb_formats)
|
||||
|
||||
static void init_mbus_colorimetry(struct v4l2_mbus_framefmt *mbus,
|
||||
const struct imx_media_pixfmt *fmt)
|
||||
{
|
||||
mbus->colorspace = (fmt->cs == IPUV3_COLORSPACE_RGB) ?
|
||||
V4L2_COLORSPACE_SRGB : V4L2_COLORSPACE_SMPTE170M;
|
||||
mbus->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(mbus->colorspace);
|
||||
mbus->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(mbus->colorspace);
|
||||
mbus->quantization =
|
||||
V4L2_MAP_QUANTIZATION_DEFAULT(fmt->cs == IPUV3_COLORSPACE_RGB,
|
||||
mbus->colorspace,
|
||||
mbus->ycbcr_enc);
|
||||
}
|
||||
|
||||
static const struct imx_media_pixfmt *find_format(u32 fourcc,
|
||||
u32 code,
|
||||
enum codespace_sel cs_sel,
|
||||
@ -423,7 +410,16 @@ int imx_media_init_mbus_fmt(struct v4l2_mbus_framefmt *mbus,
|
||||
}
|
||||
|
||||
mbus->code = code;
|
||||
init_mbus_colorimetry(mbus, lcc);
|
||||
|
||||
mbus->colorspace = (lcc->cs == IPUV3_COLORSPACE_RGB) ?
|
||||
V4L2_COLORSPACE_SRGB : V4L2_COLORSPACE_SMPTE170M;
|
||||
mbus->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(mbus->colorspace);
|
||||
mbus->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(mbus->colorspace);
|
||||
mbus->quantization =
|
||||
V4L2_MAP_QUANTIZATION_DEFAULT(lcc->cs == IPUV3_COLORSPACE_RGB,
|
||||
mbus->colorspace,
|
||||
mbus->ycbcr_enc);
|
||||
|
||||
if (cc)
|
||||
*cc = lcc;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user