aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bttv-driver.c
diff options
context:
space:
mode:
authorMichael H. Schimek <mschimek@gmx.at>2006-01-09 12:25:27 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:27 -0500
commit67f1570a0659abba5efbf55cc986187af61bdd52 (patch)
treea7c0fe1bbfecfcd418c6549e9eee82b79106f0ba /drivers/media/video/bttv-driver.c
parent7e57819169d4f9a1d7af55fb645ece3fb981e2e3 (diff)
V4L/DVB (3178): bttv VBI fixes
- V4L2_(G|S|TRY)_FMT returned incorrect VBI start lines for PAL-M, NTSC-JP, and PAL-60. They also returned an inaccurate VBI offset. - V4L2_(G|S)_FMT and V4L2_TRY_FMT disagreed about the start of VBI capturing in PAL and SECAM second field. Note the start line fixes may break applications using VIDIOCSVBIFMT because this ioctl fails when the driver does not support exactly the requested parameters. - V4L2_TRY_FMT did not clear the reserved field in struct v4l2_vbi_format. - V4L2_(S|TRY)_FMT did not expect very large or small VBI start or count values, returning wrong (but safe) counts due to an overflow. - VIDIOCGVBIFMT confused V4L and V4L2 VBI flags. However this had no effect because the flags have the same value and bttv never sets them. - In v4l_compat_translate_ioctl() the VIDIOC(G|S)VBIFMT code did not expect V4L2 drivers supporting VBI formats besides V4L2_PIX_FMT_GREY. Signed-off-by: Michael H. Schimek <mschimek@gmx.at> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/bttv-driver.c')
-rw-r--r--drivers/media/video/bttv-driver.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 8bee7d5796dd..4e25c92ac8c4 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -210,6 +210,9 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
210 .vdelay = 0x20, 210 .vdelay = 0x20,
211 .vbipack = 255, 211 .vbipack = 255,
212 .sram = 0, 212 .sram = 0,
213 /* ITU-R frame line number of the first VBI line
214 we can capture, of the first and second field. */
215 .vbistart = { 7,320 },
213 },{ 216 },{
214 .v4l2_id = V4L2_STD_NTSC_M, 217 .v4l2_id = V4L2_STD_NTSC_M,
215 .name = "NTSC", 218 .name = "NTSC",
@@ -226,6 +229,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
226 .vdelay = 0x1a, 229 .vdelay = 0x1a,
227 .vbipack = 144, 230 .vbipack = 144,
228 .sram = 1, 231 .sram = 1,
232 .vbistart = { 10, 273 },
229 },{ 233 },{
230 .v4l2_id = V4L2_STD_SECAM, 234 .v4l2_id = V4L2_STD_SECAM,
231 .name = "SECAM", 235 .name = "SECAM",
@@ -242,6 +246,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
242 .vdelay = 0x20, 246 .vdelay = 0x20,
243 .vbipack = 255, 247 .vbipack = 255,
244 .sram = 0, /* like PAL, correct? */ 248 .sram = 0, /* like PAL, correct? */
249 .vbistart = { 7, 320 },
245 },{ 250 },{
246 .v4l2_id = V4L2_STD_PAL_Nc, 251 .v4l2_id = V4L2_STD_PAL_Nc,
247 .name = "PAL-Nc", 252 .name = "PAL-Nc",
@@ -258,6 +263,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
258 .vdelay = 0x1a, 263 .vdelay = 0x1a,
259 .vbipack = 144, 264 .vbipack = 144,
260 .sram = -1, 265 .sram = -1,
266 .vbistart = { 7, 320 },
261 },{ 267 },{
262 .v4l2_id = V4L2_STD_PAL_M, 268 .v4l2_id = V4L2_STD_PAL_M,
263 .name = "PAL-M", 269 .name = "PAL-M",
@@ -274,6 +280,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
274 .vdelay = 0x1a, 280 .vdelay = 0x1a,
275 .vbipack = 144, 281 .vbipack = 144,
276 .sram = -1, 282 .sram = -1,
283 .vbistart = { 10, 273 },
277 },{ 284 },{
278 .v4l2_id = V4L2_STD_PAL_N, 285 .v4l2_id = V4L2_STD_PAL_N,
279 .name = "PAL-N", 286 .name = "PAL-N",
@@ -290,6 +297,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
290 .vdelay = 0x20, 297 .vdelay = 0x20,
291 .vbipack = 144, 298 .vbipack = 144,
292 .sram = -1, 299 .sram = -1,
300 .vbistart = { 7, 320},
293 },{ 301 },{
294 .v4l2_id = V4L2_STD_NTSC_M_JP, 302 .v4l2_id = V4L2_STD_NTSC_M_JP,
295 .name = "NTSC-JP", 303 .name = "NTSC-JP",
@@ -306,6 +314,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
306 .vdelay = 0x16, 314 .vdelay = 0x16,
307 .vbipack = 144, 315 .vbipack = 144,
308 .sram = -1, 316 .sram = -1,
317 .vbistart = {10, 273},
309 },{ 318 },{
310 /* that one hopefully works with the strange timing 319 /* that one hopefully works with the strange timing
311 * which video recorders produce when playing a NTSC 320 * which video recorders produce when playing a NTSC
@@ -326,6 +335,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
326 .vbipack = 255, 335 .vbipack = 255,
327 .vtotal = 524, 336 .vtotal = 524,
328 .sram = -1, 337 .sram = -1,
338 .vbistart = { 10, 273 },
329 } 339 }
330}; 340};
331static const unsigned int BTTV_TVNORMS = ARRAY_SIZE(bttv_tvnorms); 341static const unsigned int BTTV_TVNORMS = ARRAY_SIZE(bttv_tvnorms);
@@ -2570,10 +2580,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2570 fmt->count[0] = fmt2.fmt.vbi.count[0]; 2580 fmt->count[0] = fmt2.fmt.vbi.count[0];
2571 fmt->start[1] = fmt2.fmt.vbi.start[1]; 2581 fmt->start[1] = fmt2.fmt.vbi.start[1];
2572 fmt->count[1] = fmt2.fmt.vbi.count[1]; 2582 fmt->count[1] = fmt2.fmt.vbi.count[1];
2573 if (fmt2.fmt.vbi.flags & VBI_UNSYNC) 2583 if (fmt2.fmt.vbi.flags & V4L2_VBI_UNSYNC)
2574 fmt->flags |= V4L2_VBI_UNSYNC; 2584 fmt->flags |= VBI_UNSYNC;
2575 if (fmt2.fmt.vbi.flags & VBI_INTERLACED) 2585 if (fmt2.fmt.vbi.flags & V4L2_VBI_INTERLACED)
2576 fmt->flags |= V4L2_VBI_INTERLACED; 2586 fmt->flags |= VBI_INTERLACED;
2577 return 0; 2587 return 0;
2578 } 2588 }
2579 case VIDIOCSVBIFMT: 2589 case VIDIOCSVBIFMT: