Commit 7e13a8a4 authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Mauro Carvalho Chehab

[media] media: rcar-vin: make V4L2_FIELD_INTERLACED standard dependent

The field V4L2_FIELD_INTERLACED is standard dependent and should not
unconditionally be equivalent to V4L2_FIELD_INTERLACED_TB.

This patch adds a check to see if the video standard can be obtained and
if it's a 60 Hz format. If the condition is met V4L2_FIELD_INTERLACED
is treated as V4L2_FIELD_INTERLACED_BT if not as
V4L2_FIELD_INTERLACED_TB.
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent e0ad7a9b
...@@ -131,6 +131,7 @@ static u32 rvin_read(struct rvin_dev *vin, u32 offset) ...@@ -131,6 +131,7 @@ static u32 rvin_read(struct rvin_dev *vin, u32 offset)
static int rvin_setup(struct rvin_dev *vin) static int rvin_setup(struct rvin_dev *vin)
{ {
u32 vnmc, dmr, dmr2, interrupts; u32 vnmc, dmr, dmr2, interrupts;
v4l2_std_id std;
bool progressive = false, output_is_yuv = false, input_is_yuv = false; bool progressive = false, output_is_yuv = false, input_is_yuv = false;
switch (vin->format.field) { switch (vin->format.field) {
...@@ -141,6 +142,14 @@ static int rvin_setup(struct rvin_dev *vin) ...@@ -141,6 +142,14 @@ static int rvin_setup(struct rvin_dev *vin)
vnmc = VNMC_IM_EVEN; vnmc = VNMC_IM_EVEN;
break; break;
case V4L2_FIELD_INTERLACED: case V4L2_FIELD_INTERLACED:
/* Default to TB */
vnmc = VNMC_IM_FULL;
/* Use BT if video standard can be read and is 60 Hz format */
if (!v4l2_subdev_call(vin_to_source(vin), video, g_std, &std)) {
if (std & V4L2_STD_525_60)
vnmc = VNMC_IM_FULL | VNMC_FOC;
}
break;
case V4L2_FIELD_INTERLACED_TB: case V4L2_FIELD_INTERLACED_TB:
vnmc = VNMC_IM_FULL; vnmc = VNMC_IM_FULL;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment