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

media: Revert "media: rcar-vin: enable field toggle after a set number of lines for Gen3"

The offending commit was an attempt to fix the issue of writing outside
the capture buffer for VIN Gen3. Unfortunately it only fixed the symptom
of the problem to such a degree I could no longer reproduce it. Revert
the offending commit before a proper fix can be added in a follow-up
patch.

This reverts commit 015060cb.
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 715b703d
...@@ -124,9 +124,7 @@ ...@@ -124,9 +124,7 @@
#define VNDMR2_VPS (1 << 30) #define VNDMR2_VPS (1 << 30)
#define VNDMR2_HPS (1 << 29) #define VNDMR2_HPS (1 << 29)
#define VNDMR2_FTEV (1 << 17) #define VNDMR2_FTEV (1 << 17)
#define VNDMR2_FTEH (1 << 16)
#define VNDMR2_VLV(n) ((n & 0xf) << 12) #define VNDMR2_VLV(n) ((n & 0xf) << 12)
#define VNDMR2_HLV(n) ((n) & 0xfff)
/* Video n CSI2 Interface Mode Register (Gen3) */ /* Video n CSI2 Interface Mode Register (Gen3) */
#define VNCSI_IFMD_DES1 (1 << 26) #define VNCSI_IFMD_DES1 (1 << 26)
...@@ -614,9 +612,8 @@ void rvin_crop_scale_comp(struct rvin_dev *vin) ...@@ -614,9 +612,8 @@ void rvin_crop_scale_comp(struct rvin_dev *vin)
static int rvin_setup(struct rvin_dev *vin) static int rvin_setup(struct rvin_dev *vin)
{ {
u32 vnmc, dmr, dmr2, interrupts, lines; u32 vnmc, dmr, dmr2, interrupts;
bool progressive = false, output_is_yuv = false, input_is_yuv = false; bool progressive = false, output_is_yuv = false, input_is_yuv = false;
bool halfsize = false;
switch (vin->format.field) { switch (vin->format.field) {
case V4L2_FIELD_TOP: case V4L2_FIELD_TOP:
...@@ -631,15 +628,12 @@ static int rvin_setup(struct rvin_dev *vin) ...@@ -631,15 +628,12 @@ static int rvin_setup(struct rvin_dev *vin)
/* Use BT if video standard can be read and is 60 Hz format */ /* Use BT if video standard can be read and is 60 Hz format */
if (!vin->info->use_mc && vin->std & V4L2_STD_525_60) if (!vin->info->use_mc && vin->std & V4L2_STD_525_60)
vnmc = VNMC_IM_FULL | VNMC_FOC; vnmc = VNMC_IM_FULL | VNMC_FOC;
halfsize = true;
break; break;
case V4L2_FIELD_INTERLACED_TB: case V4L2_FIELD_INTERLACED_TB:
vnmc = VNMC_IM_FULL; vnmc = VNMC_IM_FULL;
halfsize = true;
break; break;
case V4L2_FIELD_INTERLACED_BT: case V4L2_FIELD_INTERLACED_BT:
vnmc = VNMC_IM_FULL | VNMC_FOC; vnmc = VNMC_IM_FULL | VNMC_FOC;
halfsize = true;
break; break;
case V4L2_FIELD_NONE: case V4L2_FIELD_NONE:
vnmc = VNMC_IM_ODD_EVEN; vnmc = VNMC_IM_ODD_EVEN;
...@@ -682,15 +676,11 @@ static int rvin_setup(struct rvin_dev *vin) ...@@ -682,15 +676,11 @@ static int rvin_setup(struct rvin_dev *vin)
break; break;
} }
if (vin->info->model == RCAR_GEN3) { /* Enable VSYNC Field Toogle mode after one VSYNC input */
/* Enable HSYNC Field Toggle mode after height HSYNC inputs. */ if (vin->info->model == RCAR_GEN3)
lines = vin->format.height / (halfsize ? 2 : 1); dmr2 = VNDMR2_FTEV;
dmr2 = VNDMR2_FTEH | VNDMR2_HLV(lines); else
vin_dbg(vin, "Field Toogle after %u lines\n", lines);
} else {
/* Enable VSYNC Field Toogle mode after one VSYNC input. */
dmr2 = VNDMR2_FTEV | VNDMR2_VLV(1); dmr2 = VNDMR2_FTEV | VNDMR2_VLV(1);
}
/* Hsync Signal Polarity Select */ /* Hsync Signal Polarity Select */
if (!(vin->mbus_cfg.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)) if (!(vin->mbus_cfg.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW))
......
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