aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx18/cx18-av-core.c27
-rw-r--r--drivers/media/video/cx18/cx18-av-vbi.c2
-rw-r--r--drivers/media/video/cx18/cx18-streams.c9
3 files changed, 24 insertions, 14 deletions
diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c
index d98010e0da9c..33ec269a0f5e 100644
--- a/drivers/media/video/cx18/cx18-av-core.c
+++ b/drivers/media/video/cx18/cx18-av-core.c
@@ -299,13 +299,13 @@ void cx18_av_std_setup(struct cx18 *cx)
299 if (std & V4L2_STD_625_50) { 299 if (std & V4L2_STD_625_50) {
300 /* 300 /*
301 * The following relationships of half line counts should hold: 301 * The following relationships of half line counts should hold:
302 * 625 = vblank656 + vactive + postvactive 302 * 625 = vblank656 + vactive
303 * 10 = vblank656 - vblank = vsync pulses + equalization pulses 303 * 10 = vblank656 - vblank = vsync pulses + equalization pulses
304 * 304 *
305 * vblank656: half lines after line 625/mid-313 of blanked video 305 * vblank656: half lines after line 625/mid-313 of blanked video
306 * vblank: half lines, after line 5/317, of blanked video 306 * vblank: half lines, after line 5/317, of blanked video
307 * vactive: half lines of active video 307 * vactive: half lines of active video +
308 * postvactive: 5 half lines after the end of active video 308 * 5 half lines after the end of active video
309 * 309 *
310 * As far as I can tell: 310 * As far as I can tell:
311 * vblank656 starts counting from the falling edge of the first 311 * vblank656 starts counting from the falling edge of the first
@@ -316,10 +316,21 @@ void cx18_av_std_setup(struct cx18 *cx)
316 * For 625 line systems the driver will extract VBI information 316 * For 625 line systems the driver will extract VBI information
317 * from lines 6-23 and lines 318-335 (but the slicer can only 317 * from lines 6-23 and lines 318-335 (but the slicer can only
318 * handle 17 lines, not the 18 in the vblank region). 318 * handle 17 lines, not the 18 in the vblank region).
319 * In addition, we need vblank656 and vblank to be one whole
320 * line longer, to cover line 24 and 336, so the SAV/EAV RP
321 * codes get generated such that the encoder can actually
322 * extract line 23 & 335 (WSS). We'll lose 1 line in each field
323 * at the top of the screen.
324 *
325 * It appears the 5 half lines that happen after active
326 * video must be included in vactive (579 instead of 574),
327 * otherwise the colors get badly displayed in various regions
328 * of the screen. I guess the chroma comb filter gets confused
329 * without them (at least when a PVR-350 is the PAL source).
319 */ 330 */
320 vblank656 = 46; /* lines 1 - 23 & 313 - 335 */ 331 vblank656 = 48; /* lines 1 - 24 & 313 - 336 */
321 vblank = 36; /* lines 6 - 23 & 318 - 335 */ 332 vblank = 38; /* lines 6 - 24 & 318 - 336 */
322 vactive = 574; /* lines 24 - 310 & 336 - 622 */ 333 vactive = 579; /* lines 24 - 313 & 337 - 626 */
323 334
324 /* 335 /*
325 * For a 13.5 Mpps clock and 15,625 Hz line rate, a line is 336 * For a 13.5 Mpps clock and 15,625 Hz line rate, a line is
@@ -989,9 +1000,9 @@ static int cx18_av_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
989 * cx18_av_std_setup(), above standard values: 1000 * cx18_av_std_setup(), above standard values:
990 * 1001 *
991 * 480 + 1 for 60 Hz systems 1002 * 480 + 1 for 60 Hz systems
992 * 576 - 2 for 50 Hz systems 1003 * 576 + 3 for 50 Hz systems
993 */ 1004 */
994 Vlines = pix->height + (is_50Hz ? -2 : 1); 1005 Vlines = pix->height + (is_50Hz ? 3 : 1);
995 1006
996 /* 1007 /*
997 * Invalid height and width scaling requests are: 1008 * Invalid height and width scaling requests are:
diff --git a/drivers/media/video/cx18/cx18-av-vbi.c b/drivers/media/video/cx18/cx18-av-vbi.c
index 640121448eb9..a51732bcca4b 100644
--- a/drivers/media/video/cx18/cx18-av-vbi.c
+++ b/drivers/media/video/cx18/cx18-av-vbi.c
@@ -256,7 +256,7 @@ int cx18_av_vbi_s_fmt(struct cx18 *cx, struct v4l2_format *fmt)
256 256
257 cx18_av_write(cx, 0x43c, 0x16); 257 cx18_av_write(cx, 0x43c, 0x16);
258 /* Should match vblank set in cx18_av_std_setup() */ 258 /* Should match vblank set in cx18_av_std_setup() */
259 cx18_av_write(cx, 0x474, is_pal ? 36 : 26); 259 cx18_av_write(cx, 0x474, is_pal ? 38 : 26);
260 return 0; 260 return 0;
261} 261}
262 262
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index a0800393316e..54d248e16d85 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -374,12 +374,11 @@ static void cx18_vbi_setup(struct cx18_stream *s)
374 * For 625/50 systems, according to the VIP 2 & BT.656 std: 374 * For 625/50 systems, according to the VIP 2 & BT.656 std:
375 * The EAV RP code's Field bit toggles on line 1, a few lines 375 * The EAV RP code's Field bit toggles on line 1, a few lines
376 * after the Vertcal Blank bit has already toggled. 376 * after the Vertcal Blank bit has already toggled.
377 * Tell the encoder to capture 23-1+1=23 lines per field, 377 * (We've actually set the digitizer so that the Field bit
378 * since we want lines 6 through 23. 378 * toggles on line 2.) Tell the encoder to capture 23-2+1=22
379 * 379 * lines per field, since we want lines 6 through 23.
380 * FIXME - revisit for 625/50 systems
381 */ 380 */
382 lines = cx->is_60hz ? (21 - 4 + 1) * 2 : (23 - 1 + 1) * 2; 381 lines = cx->is_60hz ? (21 - 4 + 1) * 2 : (23 - 2 + 1) * 2;
383 } 382 }
384 383
385 data[0] = s->handle; 384 data[0] = s->handle;