summaryrefslogtreecommitdiff
path: root/drivers/staging/media/imx/imx-ic-prp.c
diff options
context:
space:
mode:
authorSteve Longerbeam <slongerbeam@gmail.com>2017-06-07 15:34:11 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-20 08:03:57 -0300
commit21e54111d2558fa774aec998bba25c6fa5b61791 (patch)
tree7082c60d7641692b1393479b587ab338b050da60 /drivers/staging/media/imx/imx-ic-prp.c
parentc24858c3070d7bff7f8d02c05595d4978e7198b6 (diff)
[media] media: imx: set and propagate default field, colorimetry
This patch adds a call to imx_media_fill_default_mbus_fields() in the *_try_fmt() functions at the sink pads, to set empty field order and colorimetry parameters. If the field order is set to ANY, choose the currently set field order at the sink pad. If the colorspace is set to DEFAULT, choose the current colorspace at the sink pad. If any of xfer_func, ycbcr_enc or quantization are set to DEFAULT, either choose the current sink pad setting, or the default setting for the new colorspace, if non-DEFAULT colorspace was given. If a format is destined to be routed through the Image Converter, fixed quantization and Y`CbCr encoding must be set. Colorimetry is also propagated from sink to source pads anywhere this has not already been done. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/media/imx/imx-ic-prp.c')
-rw-r--r--drivers/staging/media/imx/imx-ic-prp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/media/imx/imx-ic-prp.c b/drivers/staging/media/imx/imx-ic-prp.c
index 54c879d7e054..783a5158a5f6 100644
--- a/drivers/staging/media/imx/imx-ic-prp.c
+++ b/drivers/staging/media/imx/imx-ic-prp.c
@@ -166,8 +166,8 @@ static int prp_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_format *sdformat)
{
struct prp_priv *priv = sd_to_priv(sd);
+ struct v4l2_mbus_framefmt *fmt, *infmt;
const struct imx_media_pixfmt *cc;
- struct v4l2_mbus_framefmt *fmt;
int ret = 0;
u32 code;
@@ -181,6 +181,8 @@ static int prp_set_fmt(struct v4l2_subdev *sd,
goto out;
}
+ infmt = __prp_get_fmt(priv, cfg, PRP_SINK_PAD, sdformat->which);
+
switch (sdformat->pad) {
case PRP_SINK_PAD:
v4l_bound_align_image(&sdformat->format.width, MIN_W, MAX_W,
@@ -194,12 +196,14 @@ static int prp_set_fmt(struct v4l2_subdev *sd,
cc = imx_media_find_ipu_format(code, CS_SEL_ANY);
sdformat->format.code = cc->codes[0];
}
+
+ imx_media_fill_default_mbus_fields(&sdformat->format, infmt,
+ true);
break;
case PRP_SRC_PAD_PRPENC:
case PRP_SRC_PAD_PRPVF:
/* Output pads mirror input pad */
- fmt = __prp_get_fmt(priv, cfg, PRP_SINK_PAD, sdformat->which);
- sdformat->format = *fmt;
+ sdformat->format = *infmt;
break;
}