diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2007-09-27 19:44:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 23:02:59 -0400 |
commit | 11f7078c10944437b6cf335cea50ed7da675a8b1 (patch) | |
tree | 91d9dbda3a1497173440936d749a86c20b1fca7b | |
parent | cb71201f20e43581857043a1f856fb61ce44bdf8 (diff) |
V4L/DVB (6272): V4L: properly fix support for capturing interlaced video in saa7134
By "capturing interlaced video" I mean that card ensures that top field
is really top and vice versa (I think it takes the filed ID from signal)
Properly turn on/off that support depending on signal state
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/saa7134/saa7134-core.c | 8 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 16 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 2 |
3 files changed, 16 insertions, 10 deletions
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 7f5df32ed0e8..fae0bfe7939f 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -594,8 +594,10 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id) | |||
594 | print_irqstatus(dev,loop,report,status); | 594 | print_irqstatus(dev,loop,report,status); |
595 | 595 | ||
596 | 596 | ||
597 | if (report & SAA7134_IRQ_REPORT_RDCAP /* _INTL */) | 597 | if ((report & SAA7134_IRQ_REPORT_RDCAP) || |
598 | saa7134_irq_video_intl(dev); | 598 | (report & SAA7134_IRQ_REPORT_INTL)) |
599 | saa7134_irq_video_signalchange(dev); | ||
600 | |||
599 | 601 | ||
600 | if ((report & SAA7134_IRQ_REPORT_DONE_RA0) && | 602 | if ((report & SAA7134_IRQ_REPORT_DONE_RA0) && |
601 | (status & 0x60) == 0) | 603 | (status & 0x60) == 0) |
@@ -1081,7 +1083,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
1081 | mutex_unlock(&devlist_lock); | 1083 | mutex_unlock(&devlist_lock); |
1082 | 1084 | ||
1083 | /* check for signal */ | 1085 | /* check for signal */ |
1084 | saa7134_irq_video_intl(dev); | 1086 | saa7134_irq_video_signalchange(dev); |
1085 | 1087 | ||
1086 | if (saa7134_dmasound_init && !dev->dmasound.priv_data) { | 1088 | if (saa7134_dmasound_init && !dev->dmasound.priv_data) { |
1087 | saa7134_dmasound_init(dev); | 1089 | saa7134_dmasound_init(dev); |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 24d579723b55..7c97ac15e665 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | static unsigned int video_debug = 0; | 41 | static unsigned int video_debug = 0; |
42 | static unsigned int gbuffers = 8; | 42 | static unsigned int gbuffers = 8; |
43 | static unsigned int noninterlaced = 1; | 43 | static unsigned int noninterlaced = 0; |
44 | static unsigned int gbufsize = 720*576*4; | 44 | static unsigned int gbufsize = 720*576*4; |
45 | static unsigned int gbufsize_max = 720*576*4; | 45 | static unsigned int gbufsize_max = 720*576*4; |
46 | static char secam[] = "--"; | 46 | static char secam[] = "--"; |
@@ -2454,7 +2454,7 @@ int saa7134_video_init2(struct saa7134_dev *dev) | |||
2454 | return 0; | 2454 | return 0; |
2455 | } | 2455 | } |
2456 | 2456 | ||
2457 | void saa7134_irq_video_intl(struct saa7134_dev *dev) | 2457 | void saa7134_irq_video_signalchange(struct saa7134_dev *dev) |
2458 | { | 2458 | { |
2459 | static const char *st[] = { | 2459 | static const char *st[] = { |
2460 | "(no signal)", "NTSC", "PAL", "SECAM" }; | 2460 | "(no signal)", "NTSC", "PAL", "SECAM" }; |
@@ -2466,24 +2466,28 @@ void saa7134_irq_video_intl(struct saa7134_dev *dev) | |||
2466 | (st1 & 0x40) ? "not locked" : "locked", | 2466 | (st1 & 0x40) ? "not locked" : "locked", |
2467 | (st2 & 0x40) ? "no" : "yes", | 2467 | (st2 & 0x40) ? "no" : "yes", |
2468 | st[st1 & 0x03]); | 2468 | st[st1 & 0x03]); |
2469 | dev->nosignal = (st1 & 0x40) || (st2 & 0x40); | 2469 | dev->nosignal = (st1 & 0x40) || (st2 & 0x40) || !(st2 & 0x1); |
2470 | 2470 | ||
2471 | if (dev->nosignal) { | 2471 | if (dev->nosignal) { |
2472 | /* no video signal -> mute audio */ | 2472 | /* no video signal -> mute audio */ |
2473 | if (dev->ctl_automute) | 2473 | if (dev->ctl_automute) |
2474 | dev->automute = 1; | 2474 | dev->automute = 1; |
2475 | saa7134_tvaudio_setmute(dev); | 2475 | saa7134_tvaudio_setmute(dev); |
2476 | saa_setb(SAA7134_SYNC_CTRL, 0x20); | ||
2477 | } else { | 2476 | } else { |
2478 | /* wake up tvaudio audio carrier scan thread */ | 2477 | /* wake up tvaudio audio carrier scan thread */ |
2479 | saa7134_tvaudio_do_scan(dev); | 2478 | saa7134_tvaudio_do_scan(dev); |
2480 | if (!noninterlaced) | ||
2481 | saa_clearb(SAA7134_SYNC_CTRL, 0x20); | ||
2482 | } | 2479 | } |
2480 | |||
2481 | if ((st2 & 0x80) && !noninterlaced && !dev->nosignal) | ||
2482 | saa_clearb(SAA7134_SYNC_CTRL, 0x20); | ||
2483 | else | ||
2484 | saa_setb(SAA7134_SYNC_CTRL, 0x20); | ||
2485 | |||
2483 | if (dev->mops && dev->mops->signal_change) | 2486 | if (dev->mops && dev->mops->signal_change) |
2484 | dev->mops->signal_change(dev); | 2487 | dev->mops->signal_change(dev); |
2485 | } | 2488 | } |
2486 | 2489 | ||
2490 | |||
2487 | void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status) | 2491 | void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status) |
2488 | { | 2492 | { |
2489 | enum v4l2_field field; | 2493 | enum v4l2_field field; |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 5b1f22606558..745b750cd3fe 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -639,7 +639,7 @@ int saa7134_common_ioctl(struct saa7134_dev *dev, | |||
639 | 639 | ||
640 | int saa7134_video_init1(struct saa7134_dev *dev); | 640 | int saa7134_video_init1(struct saa7134_dev *dev); |
641 | int saa7134_video_init2(struct saa7134_dev *dev); | 641 | int saa7134_video_init2(struct saa7134_dev *dev); |
642 | void saa7134_irq_video_intl(struct saa7134_dev *dev); | 642 | void saa7134_irq_video_signalchange(struct saa7134_dev *dev); |
643 | void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status); | 643 | void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status); |
644 | 644 | ||
645 | 645 | ||