diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-24 14:21:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-24 14:21:08 -0400 |
commit | c328d54cd4ad120d76284e46dcca6c6cf996154a (patch) | |
tree | 104c023be66faa5fce6e0a56c0a6d13c62fd21e5 /drivers/media/video/ivtv | |
parent | 346ad4b7fe392571f19314f153db9151dbc1d82b (diff) | |
parent | b0166ab3a6ae6d7af8d9a21a7836154963c69a11 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (452 commits)
V4L/DVB (7731): tuner-xc2028: fix signal strength calculus
V4L/DVB (7730): tuner-xc2028: Fix SCODE load for MTS firmwares
V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtv
V4L/DVB (7728): tea5761: bugzilla #10462: tea5761 autodetection code were broken
V4L/DVB (7726): cx23885: Enable cx23417 support on the HVR1800
V4L/DVB (7725): cx23885: Add generic cx23417 hardware encoder support
V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L interface
V4L/DVB (7722): pvrusb2: Implement FM radio support for Gotview USB2.0 DVD 2
V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point
V4L/DVB (7720): pvrusb2: Fix bad error code on cx23416 firmware load failure
V4L/DVB (7719): pvrusb2: Implement input selection enforcement
V4L/DVB (7718): pvrusb2-dvb: update Kbuild selections
V4L/DVB (7717): pvrusb2-dvb: add DVB-T support for Hauppauge pvrusb2 model 73xxx
V4L/DVB (7716): pvrusb2: clean up global functions
V4L/DVB (7715): pvrusb2: Clean out all use of __FUNCTION__
V4L/DVB (7714): pvrusb2: Fix hang on module removal
V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdown
V4L/DVB (7712): pvrusb2: Close connect/disconnect race
V4L/DVB (7711): pvrusb2: Fix race on module unload
V4L/DVB (7710): pvrusb2: Implement critical digital streaming quirk for onair devices
...
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r-- | drivers/media/video/ivtv/Kconfig | 1 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-cards.c | 7 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-cards.h | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.c | 46 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.h | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 6 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-i2c.c | 12 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 42 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-irq.c | 25 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-mailbox.c | 11 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-queue.c | 4 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 3 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-yuv.c | 38 |
13 files changed, 126 insertions, 73 deletions
diff --git a/drivers/media/video/ivtv/Kconfig b/drivers/media/video/ivtv/Kconfig index 270906fc3146..b6171702c4d0 100644 --- a/drivers/media/video/ivtv/Kconfig +++ b/drivers/media/video/ivtv/Kconfig | |||
@@ -10,6 +10,7 @@ config VIDEO_IVTV | |||
10 | select VIDEO_CX25840 | 10 | select VIDEO_CX25840 |
11 | select VIDEO_MSP3400 | 11 | select VIDEO_MSP3400 |
12 | select VIDEO_SAA711X | 12 | select VIDEO_SAA711X |
13 | select VIDEO_SAA717X | ||
13 | select VIDEO_SAA7127 | 14 | select VIDEO_SAA7127 |
14 | select VIDEO_TVAUDIO | 15 | select VIDEO_TVAUDIO |
15 | select VIDEO_CS53L32A | 16 | select VIDEO_CS53L32A |
diff --git a/drivers/media/video/ivtv/ivtv-cards.c b/drivers/media/video/ivtv/ivtv-cards.c index f23c6b8d6911..e908649ea37c 100644 --- a/drivers/media/video/ivtv/ivtv-cards.c +++ b/drivers/media/video/ivtv/ivtv-cards.c | |||
@@ -416,11 +416,10 @@ static const struct ivtv_card ivtv_card_avc2410 = { | |||
416 | on the country/region setting of the user to decide which tuner | 416 | on the country/region setting of the user to decide which tuner |
417 | is available. */ | 417 | is available. */ |
418 | .tuners = { | 418 | .tuners = { |
419 | /* This tuner has been verified for the AVC2410 */ | ||
420 | { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 }, | 419 | { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 }, |
421 | /* This is a good guess, but I'm not totally sure this is | 420 | { .std = V4L2_STD_ALL - V4L2_STD_NTSC_M_JP, |
422 | the correct tuner for NTSC. */ | 421 | .tuner = TUNER_PHILIPS_FM1236_MK3 }, |
423 | { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FM1236_MK3 }, | 422 | { .std = V4L2_STD_NTSC_M_JP, .tuner = TUNER_PHILIPS_FQ1286 }, |
424 | }, | 423 | }, |
425 | .pci_list = ivtv_pci_avc2410, | 424 | .pci_list = ivtv_pci_avc2410, |
426 | .i2c = &ivtv_i2c_std, | 425 | .i2c = &ivtv_i2c_std, |
diff --git a/drivers/media/video/ivtv/ivtv-cards.h b/drivers/media/video/ivtv/ivtv-cards.h index 191aafdd9968..9186fa2ee5fc 100644 --- a/drivers/media/video/ivtv/ivtv-cards.h +++ b/drivers/media/video/ivtv/ivtv-cards.h | |||
@@ -119,7 +119,7 @@ | |||
119 | 119 | ||
120 | #define IVTV_CARD_MAX_VIDEO_INPUTS 6 | 120 | #define IVTV_CARD_MAX_VIDEO_INPUTS 6 |
121 | #define IVTV_CARD_MAX_AUDIO_INPUTS 3 | 121 | #define IVTV_CARD_MAX_AUDIO_INPUTS 3 |
122 | #define IVTV_CARD_MAX_TUNERS 2 | 122 | #define IVTV_CARD_MAX_TUNERS 3 |
123 | 123 | ||
124 | /* SAA71XX HW inputs */ | 124 | /* SAA71XX HW inputs */ |
125 | #define IVTV_SAA71XX_COMPOSITE0 0 | 125 | #define IVTV_SAA71XX_COMPOSITE0 0 |
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 948ca35e7ee8..065df53f80fd 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -101,7 +101,7 @@ static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, | |||
101 | static unsigned int cardtype_c = 1; | 101 | static unsigned int cardtype_c = 1; |
102 | static unsigned int tuner_c = 1; | 102 | static unsigned int tuner_c = 1; |
103 | static unsigned int radio_c = 1; | 103 | static unsigned int radio_c = 1; |
104 | static char pal[] = "--"; | 104 | static char pal[] = "---"; |
105 | static char secam[] = "--"; | 105 | static char secam[] = "--"; |
106 | static char ntsc[] = "-"; | 106 | static char ntsc[] = "-"; |
107 | 107 | ||
@@ -126,12 +126,13 @@ static int dec_mpg_buffers = IVTV_DEFAULT_DEC_MPG_BUFFERS; | |||
126 | static int dec_yuv_buffers = IVTV_DEFAULT_DEC_YUV_BUFFERS; | 126 | static int dec_yuv_buffers = IVTV_DEFAULT_DEC_YUV_BUFFERS; |
127 | static int dec_vbi_buffers = IVTV_DEFAULT_DEC_VBI_BUFFERS; | 127 | static int dec_vbi_buffers = IVTV_DEFAULT_DEC_VBI_BUFFERS; |
128 | 128 | ||
129 | static int ivtv_yuv_mode = 0; | 129 | static int ivtv_yuv_mode; |
130 | static int ivtv_yuv_threshold=-1; | 130 | static int ivtv_yuv_threshold = -1; |
131 | static int ivtv_pci_latency = 1; | 131 | static int ivtv_pci_latency = 1; |
132 | 132 | ||
133 | int ivtv_debug = 0; | 133 | int ivtv_debug; |
134 | 134 | ||
135 | static int tunertype = -1; | ||
135 | static int newi2c = -1; | 136 | static int newi2c = -1; |
136 | 137 | ||
137 | module_param_array(tuner, int, &tuner_c, 0644); | 138 | module_param_array(tuner, int, &tuner_c, 0644); |
@@ -154,6 +155,7 @@ module_param(dec_mpg_buffers, int, 0644); | |||
154 | module_param(dec_yuv_buffers, int, 0644); | 155 | module_param(dec_yuv_buffers, int, 0644); |
155 | module_param(dec_vbi_buffers, int, 0644); | 156 | module_param(dec_vbi_buffers, int, 0644); |
156 | 157 | ||
158 | module_param(tunertype, int, 0644); | ||
157 | module_param(newi2c, int, 0644); | 159 | module_param(newi2c, int, 0644); |
158 | 160 | ||
159 | MODULE_PARM_DESC(tuner, "Tuner type selection,\n" | 161 | MODULE_PARM_DESC(tuner, "Tuner type selection,\n" |
@@ -190,9 +192,14 @@ MODULE_PARM_DESC(cardtype, | |||
190 | "\t\t\t24 = AverMedia EZMaker PCI Deluxe\n" | 192 | "\t\t\t24 = AverMedia EZMaker PCI Deluxe\n" |
191 | "\t\t\t 0 = Autodetect (default)\n" | 193 | "\t\t\t 0 = Autodetect (default)\n" |
192 | "\t\t\t-1 = Ignore this card\n\t\t"); | 194 | "\t\t\t-1 = Ignore this card\n\t\t"); |
193 | MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); | 195 | MODULE_PARM_DESC(pal, "Set PAL standard: BGH, DK, I, M, N, Nc, 60"); |
194 | MODULE_PARM_DESC(secam, "Set SECAM standard: B, G, H, D, K, L, LC"); | 196 | MODULE_PARM_DESC(secam, "Set SECAM standard: BGH, DK, L, LC"); |
195 | MODULE_PARM_DESC(ntsc, "Set NTSC standard: M, J, K"); | 197 | MODULE_PARM_DESC(ntsc, "Set NTSC standard: M, J (Japan), K (South Korea)"); |
198 | MODULE_PARM_DESC(tunertype, | ||
199 | "Specify tuner type:\n" | ||
200 | "\t\t\t 0 = tuner for PAL-B/G/H/D/K/I, SECAM-B/G/H/D/K/L/Lc\n" | ||
201 | "\t\t\t 1 = tuner for NTSC-M/J/K, PAL-M/N/Nc\n" | ||
202 | "\t\t\t-1 = Autodetect (default)\n"); | ||
196 | MODULE_PARM_DESC(debug, | 203 | MODULE_PARM_DESC(debug, |
197 | "Debug level (bitmask). Default: 0\n" | 204 | "Debug level (bitmask). Default: 0\n" |
198 | "\t\t\t 1/0x0001: warning\n" | 205 | "\t\t\t 1/0x0001: warning\n" |
@@ -490,30 +497,35 @@ static v4l2_std_id ivtv_parse_std(struct ivtv *itv) | |||
490 | { | 497 | { |
491 | switch (pal[0]) { | 498 | switch (pal[0]) { |
492 | case '6': | 499 | case '6': |
500 | tunertype = 0; | ||
493 | return V4L2_STD_PAL_60; | 501 | return V4L2_STD_PAL_60; |
494 | case 'b': | 502 | case 'b': |
495 | case 'B': | 503 | case 'B': |
496 | case 'g': | 504 | case 'g': |
497 | case 'G': | 505 | case 'G': |
498 | return V4L2_STD_PAL_BG; | ||
499 | case 'h': | 506 | case 'h': |
500 | case 'H': | 507 | case 'H': |
501 | return V4L2_STD_PAL_H; | 508 | tunertype = 0; |
509 | return V4L2_STD_PAL_BG | V4L2_STD_PAL_H; | ||
502 | case 'n': | 510 | case 'n': |
503 | case 'N': | 511 | case 'N': |
512 | tunertype = 1; | ||
504 | if (pal[1] == 'c' || pal[1] == 'C') | 513 | if (pal[1] == 'c' || pal[1] == 'C') |
505 | return V4L2_STD_PAL_Nc; | 514 | return V4L2_STD_PAL_Nc; |
506 | return V4L2_STD_PAL_N; | 515 | return V4L2_STD_PAL_N; |
507 | case 'i': | 516 | case 'i': |
508 | case 'I': | 517 | case 'I': |
518 | tunertype = 0; | ||
509 | return V4L2_STD_PAL_I; | 519 | return V4L2_STD_PAL_I; |
510 | case 'd': | 520 | case 'd': |
511 | case 'D': | 521 | case 'D': |
512 | case 'k': | 522 | case 'k': |
513 | case 'K': | 523 | case 'K': |
524 | tunertype = 0; | ||
514 | return V4L2_STD_PAL_DK; | 525 | return V4L2_STD_PAL_DK; |
515 | case 'M': | 526 | case 'M': |
516 | case 'm': | 527 | case 'm': |
528 | tunertype = 1; | ||
517 | return V4L2_STD_PAL_M; | 529 | return V4L2_STD_PAL_M; |
518 | case '-': | 530 | case '-': |
519 | break; | 531 | break; |
@@ -529,14 +541,17 @@ static v4l2_std_id ivtv_parse_std(struct ivtv *itv) | |||
529 | case 'G': | 541 | case 'G': |
530 | case 'h': | 542 | case 'h': |
531 | case 'H': | 543 | case 'H': |
544 | tunertype = 0; | ||
532 | return V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H; | 545 | return V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H; |
533 | case 'd': | 546 | case 'd': |
534 | case 'D': | 547 | case 'D': |
535 | case 'k': | 548 | case 'k': |
536 | case 'K': | 549 | case 'K': |
550 | tunertype = 0; | ||
537 | return V4L2_STD_SECAM_DK; | 551 | return V4L2_STD_SECAM_DK; |
538 | case 'l': | 552 | case 'l': |
539 | case 'L': | 553 | case 'L': |
554 | tunertype = 0; | ||
540 | if (secam[1] == 'C' || secam[1] == 'c') | 555 | if (secam[1] == 'C' || secam[1] == 'c') |
541 | return V4L2_STD_SECAM_LC; | 556 | return V4L2_STD_SECAM_LC; |
542 | return V4L2_STD_SECAM_L; | 557 | return V4L2_STD_SECAM_L; |
@@ -550,12 +565,15 @@ static v4l2_std_id ivtv_parse_std(struct ivtv *itv) | |||
550 | switch (ntsc[0]) { | 565 | switch (ntsc[0]) { |
551 | case 'm': | 566 | case 'm': |
552 | case 'M': | 567 | case 'M': |
568 | tunertype = 1; | ||
553 | return V4L2_STD_NTSC_M; | 569 | return V4L2_STD_NTSC_M; |
554 | case 'j': | 570 | case 'j': |
555 | case 'J': | 571 | case 'J': |
572 | tunertype = 1; | ||
556 | return V4L2_STD_NTSC_M_JP; | 573 | return V4L2_STD_NTSC_M_JP; |
557 | case 'k': | 574 | case 'k': |
558 | case 'K': | 575 | case 'K': |
576 | tunertype = 1; | ||
559 | return V4L2_STD_NTSC_M_KR; | 577 | return V4L2_STD_NTSC_M_KR; |
560 | case '-': | 578 | case '-': |
561 | break; | 579 | break; |
@@ -584,8 +602,13 @@ static void ivtv_process_options(struct ivtv *itv) | |||
584 | itv->options.tuner = tuner[itv->num]; | 602 | itv->options.tuner = tuner[itv->num]; |
585 | itv->options.radio = radio[itv->num]; | 603 | itv->options.radio = radio[itv->num]; |
586 | itv->options.newi2c = newi2c; | 604 | itv->options.newi2c = newi2c; |
587 | 605 | if (tunertype < -1 || tunertype > 1) { | |
606 | IVTV_WARN("Invalid tunertype argument, will autodetect instead\n"); | ||
607 | tunertype = -1; | ||
608 | } | ||
588 | itv->std = ivtv_parse_std(itv); | 609 | itv->std = ivtv_parse_std(itv); |
610 | if (itv->std == 0 && tunertype >= 0) | ||
611 | itv->std = tunertype ? V4L2_STD_MN : (V4L2_STD_ALL & ~V4L2_STD_MN); | ||
589 | itv->has_cx23415 = (itv->dev->device == PCI_DEVICE_ID_IVTV15); | 612 | itv->has_cx23415 = (itv->dev->device == PCI_DEVICE_ID_IVTV15); |
590 | chipname = itv->has_cx23415 ? "cx23415" : "cx23416"; | 613 | chipname = itv->has_cx23415 ? "cx23415" : "cx23416"; |
591 | if (itv->options.cardtype == -1) { | 614 | if (itv->options.cardtype == -1) { |
@@ -711,6 +734,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv) | |||
711 | itv->yuv_info.lace_mode = ivtv_yuv_mode; | 734 | itv->yuv_info.lace_mode = ivtv_yuv_mode; |
712 | itv->yuv_info.lace_threshold = ivtv_yuv_threshold; | 735 | itv->yuv_info.lace_threshold = ivtv_yuv_threshold; |
713 | itv->yuv_info.max_frames_buffered = 3; | 736 | itv->yuv_info.max_frames_buffered = 3; |
737 | itv->yuv_info.track_osd = 1; | ||
714 | return 0; | 738 | return 0; |
715 | } | 739 | } |
716 | 740 | ||
@@ -859,7 +883,9 @@ static void ivtv_load_and_init_modules(struct ivtv *itv) | |||
859 | #ifndef CONFIG_VIDEO_SAA7127 | 883 | #ifndef CONFIG_VIDEO_SAA7127 |
860 | hw = ivtv_request_module(itv, hw, "saa7127", IVTV_HW_SAA7127); | 884 | hw = ivtv_request_module(itv, hw, "saa7127", IVTV_HW_SAA7127); |
861 | #endif | 885 | #endif |
886 | #ifndef CONFIG_VIDEO_SAA717X | ||
862 | hw = ivtv_request_module(itv, hw, "saa717x", IVTV_HW_SAA717X); | 887 | hw = ivtv_request_module(itv, hw, "saa717x", IVTV_HW_SAA717X); |
888 | #endif | ||
863 | #ifndef CONFIG_VIDEO_UPD64031A | 889 | #ifndef CONFIG_VIDEO_UPD64031A |
864 | hw = ivtv_request_module(itv, hw, "upd64031a", IVTV_HW_UPD64031A); | 890 | hw = ivtv_request_module(itv, hw, "upd64031a", IVTV_HW_UPD64031A); |
865 | #endif | 891 | #endif |
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h index 536140f0c19e..ba06e813c58c 100644 --- a/drivers/media/video/ivtv/ivtv-driver.h +++ b/drivers/media/video/ivtv/ivtv-driver.h | |||
@@ -456,6 +456,8 @@ struct yuv_playback_info | |||
456 | int v_filter_2; | 456 | int v_filter_2; |
457 | int h_filter; | 457 | int h_filter; |
458 | 458 | ||
459 | u8 track_osd; /* Should yuv output track the OSD size & position */ | ||
460 | |||
459 | u32 osd_x_offset; | 461 | u32 osd_x_offset; |
460 | u32 osd_y_offset; | 462 | u32 osd_y_offset; |
461 | 463 | ||
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 6fb96f19a866..a7640c49f1d8 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -219,7 +219,9 @@ static struct ivtv_buffer *ivtv_get_buffer(struct ivtv_stream *s, int non_block, | |||
219 | /* Process pending program info updates and pending VBI data */ | 219 | /* Process pending program info updates and pending VBI data */ |
220 | ivtv_update_pgm_info(itv); | 220 | ivtv_update_pgm_info(itv); |
221 | 221 | ||
222 | if (jiffies - itv->dualwatch_jiffies > msecs_to_jiffies(1000)) { | 222 | if (time_after(jiffies, |
223 | itv->dualwatch_jiffies + | ||
224 | msecs_to_jiffies(1000))) { | ||
223 | itv->dualwatch_jiffies = jiffies; | 225 | itv->dualwatch_jiffies = jiffies; |
224 | ivtv_dualwatch(itv); | 226 | ivtv_dualwatch(itv); |
225 | } | 227 | } |
@@ -753,7 +755,7 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait) | |||
753 | IVTV_DEBUG_HI_FILE("Encoder poll\n"); | 755 | IVTV_DEBUG_HI_FILE("Encoder poll\n"); |
754 | poll_wait(filp, &s->waitq, wait); | 756 | poll_wait(filp, &s->waitq, wait); |
755 | 757 | ||
756 | if (eof || s->q_full.length) | 758 | if (eof || s->q_full.length || s->q_io.length) |
757 | return POLLIN | POLLRDNORM; | 759 | return POLLIN | POLLRDNORM; |
758 | return 0; | 760 | return 0; |
759 | } | 761 | } |
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c index fa5ab1eb1800..9824eafee021 100644 --- a/drivers/media/video/ivtv/ivtv-i2c.c +++ b/drivers/media/video/ivtv/ivtv-i2c.c | |||
@@ -177,10 +177,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | if (id != I2C_DRIVERID_TUNER) { | 179 | if (id != I2C_DRIVERID_TUNER) { |
180 | c = i2c_new_device(&itv->i2c_adap, &info); | 180 | if (id == I2C_DRIVERID_UPD64031A || |
181 | if (c->driver == NULL) | 181 | id == I2C_DRIVERID_UPD64083) { |
182 | unsigned short addrs[2] = { info.addr, I2C_CLIENT_END }; | ||
183 | |||
184 | c = i2c_new_probed_device(&itv->i2c_adap, &info, addrs); | ||
185 | } else | ||
186 | c = i2c_new_device(&itv->i2c_adap, &info); | ||
187 | if (c && c->driver == NULL) | ||
182 | i2c_unregister_device(c); | 188 | i2c_unregister_device(c); |
183 | else | 189 | else if (c) |
184 | itv->i2c_clients[i] = c; | 190 | itv->i2c_clients[i] = c; |
185 | return itv->i2c_clients[i] ? 0 : -ENODEV; | 191 | return itv->i2c_clients[i] ? 0 : -ENODEV; |
186 | } | 192 | } |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index edef2a579617..15cac1812122 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -712,6 +712,7 @@ static int ivtv_debug_ioctls(struct file *filp, unsigned int cmd, void *arg) | |||
712 | int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg) | 712 | int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg) |
713 | { | 713 | { |
714 | struct ivtv_open_id *id = NULL; | 714 | struct ivtv_open_id *id = NULL; |
715 | struct yuv_playback_info *yi = &itv->yuv_info; | ||
715 | u32 data[CX2341X_MBOX_MAX_DATA]; | 716 | u32 data[CX2341X_MBOX_MAX_DATA]; |
716 | int streamtype = 0; | 717 | int streamtype = 0; |
717 | 718 | ||
@@ -741,7 +742,8 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
741 | 742 | ||
742 | memset(vcap, 0, sizeof(*vcap)); | 743 | memset(vcap, 0, sizeof(*vcap)); |
743 | strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */ | 744 | strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */ |
744 | strcpy(vcap->card, itv->card_name); /* card type */ | 745 | strncpy(vcap->card, itv->card_name, |
746 | sizeof(vcap->card)-1); /* card type */ | ||
745 | strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */ | 747 | strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */ |
746 | vcap->version = IVTV_DRIVER_VERSION; /* version */ | 748 | vcap->version = IVTV_DRIVER_VERSION; /* version */ |
747 | vcap->capabilities = itv->v4l2_cap; /* capabilities */ | 749 | vcap->capabilities = itv->v4l2_cap; /* capabilities */ |
@@ -827,8 +829,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
827 | case VIDIOC_CROPCAP: { | 829 | case VIDIOC_CROPCAP: { |
828 | struct v4l2_cropcap *cropcap = arg; | 830 | struct v4l2_cropcap *cropcap = arg; |
829 | 831 | ||
830 | if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && | 832 | if (cropcap->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) |
831 | cropcap->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) | ||
832 | return -EINVAL; | 833 | return -EINVAL; |
833 | cropcap->bounds.top = cropcap->bounds.left = 0; | 834 | cropcap->bounds.top = cropcap->bounds.left = 0; |
834 | cropcap->bounds.width = 720; | 835 | cropcap->bounds.width = 720; |
@@ -837,8 +838,14 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
837 | cropcap->pixelaspect.numerator = itv->is_50hz ? 59 : 10; | 838 | cropcap->pixelaspect.numerator = itv->is_50hz ? 59 : 10; |
838 | cropcap->pixelaspect.denominator = itv->is_50hz ? 54 : 11; | 839 | cropcap->pixelaspect.denominator = itv->is_50hz ? 54 : 11; |
839 | } else if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { | 840 | } else if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { |
840 | cropcap->bounds.width = itv->yuv_info.osd_full_w; | 841 | if (yi->track_osd) { |
841 | cropcap->bounds.height = itv->yuv_info.osd_full_h; | 842 | cropcap->bounds.width = yi->osd_full_w; |
843 | cropcap->bounds.height = yi->osd_full_h; | ||
844 | } else { | ||
845 | cropcap->bounds.width = 720; | ||
846 | cropcap->bounds.height = | ||
847 | itv->is_out_50hz ? 576 : 480; | ||
848 | } | ||
842 | cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10; | 849 | cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10; |
843 | cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11; | 850 | cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11; |
844 | } else { | 851 | } else { |
@@ -856,7 +863,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
856 | if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && | 863 | if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && |
857 | (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { | 864 | (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { |
858 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { | 865 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { |
859 | itv->yuv_info.main_rect = crop->c; | 866 | yi->main_rect = crop->c; |
860 | return 0; | 867 | return 0; |
861 | } else { | 868 | } else { |
862 | if (!ivtv_vapi(itv, CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, 4, | 869 | if (!ivtv_vapi(itv, CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, 4, |
@@ -867,9 +874,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
867 | } | 874 | } |
868 | return -EINVAL; | 875 | return -EINVAL; |
869 | } | 876 | } |
870 | if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 877 | return -EINVAL; |
871 | return -EINVAL; | ||
872 | return itv->video_dec_func(itv, VIDIOC_S_CROP, arg); | ||
873 | } | 878 | } |
874 | 879 | ||
875 | case VIDIOC_G_CROP: { | 880 | case VIDIOC_G_CROP: { |
@@ -878,14 +883,12 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
878 | if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && | 883 | if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && |
879 | (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { | 884 | (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { |
880 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) | 885 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) |
881 | crop->c = itv->yuv_info.main_rect; | 886 | crop->c = yi->main_rect; |
882 | else | 887 | else |
883 | crop->c = itv->main_rect; | 888 | crop->c = itv->main_rect; |
884 | return 0; | 889 | return 0; |
885 | } | 890 | } |
886 | if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 891 | return -EINVAL; |
887 | return -EINVAL; | ||
888 | return itv->video_dec_func(itv, VIDIOC_G_CROP, arg); | ||
889 | } | 892 | } |
890 | 893 | ||
891 | case VIDIOC_ENUM_FMT: { | 894 | case VIDIOC_ENUM_FMT: { |
@@ -1070,11 +1073,10 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1070 | itv->main_rect.height = itv->params.height; | 1073 | itv->main_rect.height = itv->params.height; |
1071 | ivtv_vapi(itv, CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, 4, | 1074 | ivtv_vapi(itv, CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, 4, |
1072 | 720, itv->main_rect.height, 0, 0); | 1075 | 720, itv->main_rect.height, 0, 0); |
1073 | itv->yuv_info.main_rect = itv->main_rect; | 1076 | yi->main_rect = itv->main_rect; |
1074 | if (!itv->osd_info) { | 1077 | if (!itv->osd_info) { |
1075 | itv->yuv_info.osd_full_w = 720; | 1078 | yi->osd_full_w = 720; |
1076 | itv->yuv_info.osd_full_h = | 1079 | yi->osd_full_h = itv->is_out_50hz ? 576 : 480; |
1077 | itv->is_out_50hz ? 576 : 480; | ||
1078 | } | 1080 | } |
1079 | } | 1081 | } |
1080 | break; | 1082 | break; |
@@ -1272,6 +1274,8 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1272 | else | 1274 | else |
1273 | fb->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA; | 1275 | fb->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA; |
1274 | } | 1276 | } |
1277 | if (yi->track_osd) | ||
1278 | fb->flags |= V4L2_FBUF_FLAG_OVERLAY; | ||
1275 | break; | 1279 | break; |
1276 | } | 1280 | } |
1277 | 1281 | ||
@@ -1285,6 +1289,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1285 | (fb->flags & (V4L2_FBUF_FLAG_LOCAL_ALPHA|V4L2_FBUF_FLAG_LOCAL_INV_ALPHA)) != 0; | 1289 | (fb->flags & (V4L2_FBUF_FLAG_LOCAL_ALPHA|V4L2_FBUF_FLAG_LOCAL_INV_ALPHA)) != 0; |
1286 | itv->osd_chroma_key_state = (fb->flags & V4L2_FBUF_FLAG_CHROMAKEY) != 0; | 1290 | itv->osd_chroma_key_state = (fb->flags & V4L2_FBUF_FLAG_CHROMAKEY) != 0; |
1287 | ivtv_set_osd_alpha(itv); | 1291 | ivtv_set_osd_alpha(itv); |
1292 | yi->track_osd = (fb->flags & V4L2_FBUF_FLAG_OVERLAY) != 0; | ||
1288 | break; | 1293 | break; |
1289 | } | 1294 | } |
1290 | 1295 | ||
@@ -1628,6 +1633,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp, | |||
1628 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { | 1633 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { |
1629 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); | 1634 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); |
1630 | v4l_printk_ioctl(cmd); | 1635 | v4l_printk_ioctl(cmd); |
1636 | printk("\n"); | ||
1631 | } | 1637 | } |
1632 | return ivtv_debug_ioctls(filp, cmd, arg); | 1638 | return ivtv_debug_ioctls(filp, cmd, arg); |
1633 | 1639 | ||
@@ -1671,6 +1677,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp, | |||
1671 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { | 1677 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { |
1672 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); | 1678 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); |
1673 | v4l_printk_ioctl(cmd); | 1679 | v4l_printk_ioctl(cmd); |
1680 | printk("\n"); | ||
1674 | } | 1681 | } |
1675 | return ivtv_v4l2_ioctls(itv, filp, cmd, arg); | 1682 | return ivtv_v4l2_ioctls(itv, filp, cmd, arg); |
1676 | 1683 | ||
@@ -1684,6 +1691,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp, | |||
1684 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { | 1691 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) { |
1685 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); | 1692 | printk(KERN_INFO "ivtv%d ioctl: ", itv->num); |
1686 | v4l_printk_ioctl(cmd); | 1693 | v4l_printk_ioctl(cmd); |
1694 | printk("\n"); | ||
1687 | } | 1695 | } |
1688 | return ivtv_control_ioctls(itv, cmd, arg); | 1696 | return ivtv_control_ioctls(itv, cmd, arg); |
1689 | 1697 | ||
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c index 65604dde9726..a329c4689dbf 100644 --- a/drivers/media/video/ivtv/ivtv-irq.c +++ b/drivers/media/video/ivtv/ivtv-irq.c | |||
@@ -384,6 +384,8 @@ static void ivtv_dma_enc_start_xfer(struct ivtv_stream *s) | |||
384 | ivtv_stream_sync_for_device(s); | 384 | ivtv_stream_sync_for_device(s); |
385 | write_reg(s->sg_handle, IVTV_REG_ENCDMAADDR); | 385 | write_reg(s->sg_handle, IVTV_REG_ENCDMAADDR); |
386 | write_reg_sync(read_reg(IVTV_REG_DMAXFER) | 0x02, IVTV_REG_DMAXFER); | 386 | write_reg_sync(read_reg(IVTV_REG_DMAXFER) | 0x02, IVTV_REG_DMAXFER); |
387 | itv->dma_timer.expires = jiffies + msecs_to_jiffies(100); | ||
388 | add_timer(&itv->dma_timer); | ||
387 | } | 389 | } |
388 | 390 | ||
389 | static void ivtv_dma_dec_start_xfer(struct ivtv_stream *s) | 391 | static void ivtv_dma_dec_start_xfer(struct ivtv_stream *s) |
@@ -398,6 +400,8 @@ static void ivtv_dma_dec_start_xfer(struct ivtv_stream *s) | |||
398 | ivtv_stream_sync_for_device(s); | 400 | ivtv_stream_sync_for_device(s); |
399 | write_reg(s->sg_handle, IVTV_REG_DECDMAADDR); | 401 | write_reg(s->sg_handle, IVTV_REG_DECDMAADDR); |
400 | write_reg_sync(read_reg(IVTV_REG_DMAXFER) | 0x01, IVTV_REG_DMAXFER); | 402 | write_reg_sync(read_reg(IVTV_REG_DMAXFER) | 0x01, IVTV_REG_DMAXFER); |
403 | itv->dma_timer.expires = jiffies + msecs_to_jiffies(100); | ||
404 | add_timer(&itv->dma_timer); | ||
401 | } | 405 | } |
402 | 406 | ||
403 | /* start the encoder DMA */ | 407 | /* start the encoder DMA */ |
@@ -459,8 +463,6 @@ static void ivtv_dma_enc_start(struct ivtv_stream *s) | |||
459 | ivtv_dma_enc_start_xfer(s); | 463 | ivtv_dma_enc_start_xfer(s); |
460 | set_bit(IVTV_F_I_DMA, &itv->i_flags); | 464 | set_bit(IVTV_F_I_DMA, &itv->i_flags); |
461 | itv->cur_dma_stream = s->type; | 465 | itv->cur_dma_stream = s->type; |
462 | itv->dma_timer.expires = jiffies + msecs_to_jiffies(100); | ||
463 | add_timer(&itv->dma_timer); | ||
464 | } | 466 | } |
465 | } | 467 | } |
466 | 468 | ||
@@ -481,8 +483,6 @@ static void ivtv_dma_dec_start(struct ivtv_stream *s) | |||
481 | ivtv_dma_dec_start_xfer(s); | 483 | ivtv_dma_dec_start_xfer(s); |
482 | set_bit(IVTV_F_I_DMA, &itv->i_flags); | 484 | set_bit(IVTV_F_I_DMA, &itv->i_flags); |
483 | itv->cur_dma_stream = s->type; | 485 | itv->cur_dma_stream = s->type; |
484 | itv->dma_timer.expires = jiffies + msecs_to_jiffies(100); | ||
485 | add_timer(&itv->dma_timer); | ||
486 | } | 486 | } |
487 | 487 | ||
488 | static void ivtv_irq_dma_read(struct ivtv *itv) | 488 | static void ivtv_irq_dma_read(struct ivtv *itv) |
@@ -492,10 +492,11 @@ static void ivtv_irq_dma_read(struct ivtv *itv) | |||
492 | int hw_stream_type = 0; | 492 | int hw_stream_type = 0; |
493 | 493 | ||
494 | IVTV_DEBUG_HI_IRQ("DEC DMA READ\n"); | 494 | IVTV_DEBUG_HI_IRQ("DEC DMA READ\n"); |
495 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) && itv->cur_dma_stream < 0) { | 495 | |
496 | del_timer(&itv->dma_timer); | 496 | del_timer(&itv->dma_timer); |
497 | |||
498 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) && itv->cur_dma_stream < 0) | ||
497 | return; | 499 | return; |
498 | } | ||
499 | 500 | ||
500 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { | 501 | if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags)) { |
501 | s = &itv->streams[itv->cur_dma_stream]; | 502 | s = &itv->streams[itv->cur_dma_stream]; |
@@ -543,7 +544,6 @@ static void ivtv_irq_dma_read(struct ivtv *itv) | |||
543 | } | 544 | } |
544 | wake_up(&s->waitq); | 545 | wake_up(&s->waitq); |
545 | } | 546 | } |
546 | del_timer(&itv->dma_timer); | ||
547 | clear_bit(IVTV_F_I_UDMA, &itv->i_flags); | 547 | clear_bit(IVTV_F_I_UDMA, &itv->i_flags); |
548 | clear_bit(IVTV_F_I_DMA, &itv->i_flags); | 548 | clear_bit(IVTV_F_I_DMA, &itv->i_flags); |
549 | itv->cur_dma_stream = -1; | 549 | itv->cur_dma_stream = -1; |
@@ -557,10 +557,12 @@ static void ivtv_irq_enc_dma_complete(struct ivtv *itv) | |||
557 | 557 | ||
558 | ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, data); | 558 | ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, data); |
559 | IVTV_DEBUG_HI_IRQ("ENC DMA COMPLETE %x %d (%d)\n", data[0], data[1], itv->cur_dma_stream); | 559 | IVTV_DEBUG_HI_IRQ("ENC DMA COMPLETE %x %d (%d)\n", data[0], data[1], itv->cur_dma_stream); |
560 | if (itv->cur_dma_stream < 0) { | 560 | |
561 | del_timer(&itv->dma_timer); | 561 | del_timer(&itv->dma_timer); |
562 | |||
563 | if (itv->cur_dma_stream < 0) | ||
562 | return; | 564 | return; |
563 | } | 565 | |
564 | s = &itv->streams[itv->cur_dma_stream]; | 566 | s = &itv->streams[itv->cur_dma_stream]; |
565 | ivtv_stream_sync_for_cpu(s); | 567 | ivtv_stream_sync_for_cpu(s); |
566 | 568 | ||
@@ -585,7 +587,6 @@ static void ivtv_irq_enc_dma_complete(struct ivtv *itv) | |||
585 | ivtv_dma_enc_start_xfer(s); | 587 | ivtv_dma_enc_start_xfer(s); |
586 | return; | 588 | return; |
587 | } | 589 | } |
588 | del_timer(&itv->dma_timer); | ||
589 | clear_bit(IVTV_F_I_DMA, &itv->i_flags); | 590 | clear_bit(IVTV_F_I_DMA, &itv->i_flags); |
590 | itv->cur_dma_stream = -1; | 591 | itv->cur_dma_stream = -1; |
591 | dma_post(s); | 592 | dma_post(s); |
diff --git a/drivers/media/video/ivtv/ivtv-mailbox.c b/drivers/media/video/ivtv/ivtv-mailbox.c index 13a6c374d2db..1b5c0ac09a85 100644 --- a/drivers/media/video/ivtv/ivtv-mailbox.c +++ b/drivers/media/video/ivtv/ivtv-mailbox.c | |||
@@ -177,7 +177,8 @@ static int get_mailbox(struct ivtv *itv, struct ivtv_mailbox_data *mbdata, int f | |||
177 | 177 | ||
178 | /* Sleep before a retry, if not atomic */ | 178 | /* Sleep before a retry, if not atomic */ |
179 | if (!(flags & API_NO_WAIT_MB)) { | 179 | if (!(flags & API_NO_WAIT_MB)) { |
180 | if (jiffies - then > msecs_to_jiffies(10*retries)) | 180 | if (time_after(jiffies, |
181 | then + msecs_to_jiffies(10*retries))) | ||
181 | break; | 182 | break; |
182 | ivtv_msleep_timeout(10, 0); | 183 | ivtv_msleep_timeout(10, 0); |
183 | } | 184 | } |
@@ -244,7 +245,9 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) | |||
244 | data, then just return 0 as there is no need to issue this command again. | 245 | data, then just return 0 as there is no need to issue this command again. |
245 | Just an optimization to prevent unnecessary use of mailboxes. */ | 246 | Just an optimization to prevent unnecessary use of mailboxes. */ |
246 | if (itv->api_cache[cmd].last_jiffies && | 247 | if (itv->api_cache[cmd].last_jiffies && |
247 | jiffies - itv->api_cache[cmd].last_jiffies < msecs_to_jiffies(1800000) && | 248 | time_before(jiffies, |
249 | itv->api_cache[cmd].last_jiffies + | ||
250 | msecs_to_jiffies(1800000)) && | ||
248 | !memcmp(data, itv->api_cache[cmd].data, sizeof(itv->api_cache[cmd].data))) { | 251 | !memcmp(data, itv->api_cache[cmd].data, sizeof(itv->api_cache[cmd].data))) { |
249 | itv->api_cache[cmd].last_jiffies = jiffies; | 252 | itv->api_cache[cmd].last_jiffies = jiffies; |
250 | return 0; | 253 | return 0; |
@@ -299,7 +302,7 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) | |||
299 | } | 302 | } |
300 | } | 303 | } |
301 | while (!(readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE)) { | 304 | while (!(readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE)) { |
302 | if (jiffies - then > api_timeout) { | 305 | if (time_after(jiffies, then + api_timeout)) { |
303 | IVTV_DEBUG_WARN("Could not get result (%s)\n", api_info[cmd].name); | 306 | IVTV_DEBUG_WARN("Could not get result (%s)\n", api_info[cmd].name); |
304 | /* reset the mailbox, but it is likely too late already */ | 307 | /* reset the mailbox, but it is likely too late already */ |
305 | write_sync(0, &mbox->flags); | 308 | write_sync(0, &mbox->flags); |
@@ -311,7 +314,7 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) | |||
311 | else | 314 | else |
312 | ivtv_msleep_timeout(1, 0); | 315 | ivtv_msleep_timeout(1, 0); |
313 | } | 316 | } |
314 | if (jiffies - then > msecs_to_jiffies(100)) | 317 | if (time_after(jiffies, then + msecs_to_jiffies(100))) |
315 | IVTV_DEBUG_WARN("%s took %u jiffies\n", | 318 | IVTV_DEBUG_WARN("%s took %u jiffies\n", |
316 | api_info[cmd].name, | 319 | api_info[cmd].name, |
317 | jiffies_to_msecs(jiffies - then)); | 320 | jiffies_to_msecs(jiffies - then)); |
diff --git a/drivers/media/video/ivtv/ivtv-queue.c b/drivers/media/video/ivtv/ivtv-queue.c index 39a216713244..3e1deec67a5e 100644 --- a/drivers/media/video/ivtv/ivtv-queue.c +++ b/drivers/media/video/ivtv/ivtv-queue.c | |||
@@ -51,7 +51,7 @@ void ivtv_queue_init(struct ivtv_queue *q) | |||
51 | 51 | ||
52 | void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q) | 52 | void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q) |
53 | { | 53 | { |
54 | unsigned long flags = 0; | 54 | unsigned long flags; |
55 | 55 | ||
56 | /* clear the buffer if it is going to be enqueued to the free queue */ | 56 | /* clear the buffer if it is going to be enqueued to the free queue */ |
57 | if (q == &s->q_free) { | 57 | if (q == &s->q_free) { |
@@ -71,7 +71,7 @@ void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_qu | |||
71 | struct ivtv_buffer *ivtv_dequeue(struct ivtv_stream *s, struct ivtv_queue *q) | 71 | struct ivtv_buffer *ivtv_dequeue(struct ivtv_stream *s, struct ivtv_queue *q) |
72 | { | 72 | { |
73 | struct ivtv_buffer *buf = NULL; | 73 | struct ivtv_buffer *buf = NULL; |
74 | unsigned long flags = 0; | 74 | unsigned long flags; |
75 | 75 | ||
76 | spin_lock_irqsave(&s->qlock, flags); | 76 | spin_lock_irqsave(&s->qlock, flags); |
77 | if (!list_empty(&q->list)) { | 77 | if (!list_empty(&q->list)) { |
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 24d98ecf35ad..4ab8d36831ba 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -768,7 +768,8 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) | |||
768 | 768 | ||
769 | /* wait 2s for EOS interrupt */ | 769 | /* wait 2s for EOS interrupt */ |
770 | while (!test_bit(IVTV_F_I_EOS, &itv->i_flags) && | 770 | while (!test_bit(IVTV_F_I_EOS, &itv->i_flags) && |
771 | jiffies < then + msecs_to_jiffies (2000)) { | 771 | time_before(jiffies, |
772 | then + msecs_to_jiffies(2000))) { | ||
772 | schedule_timeout(msecs_to_jiffies(10)); | 773 | schedule_timeout(msecs_to_jiffies(10)); |
773 | } | 774 | } |
774 | 775 | ||
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c index 85183480a225..393d917cd672 100644 --- a/drivers/media/video/ivtv/ivtv-yuv.c +++ b/drivers/media/video/ivtv/ivtv-yuv.c | |||
@@ -718,9 +718,11 @@ static u32 ivtv_yuv_window_setup(struct ivtv *itv, struct yuv_frame_info *f) | |||
718 | f->src_w -= (osd_scale * osd_crop) >> 16; | 718 | f->src_w -= (osd_scale * osd_crop) >> 16; |
719 | } | 719 | } |
720 | 720 | ||
721 | /* The OSD can be moved. Track to it */ | 721 | if (itv->yuv_info.track_osd) { |
722 | f->dst_x += itv->yuv_info.osd_x_offset; | 722 | /* The OSD can be moved. Track to it */ |
723 | f->dst_y += itv->yuv_info.osd_y_offset; | 723 | f->dst_x += itv->yuv_info.osd_x_offset; |
724 | f->dst_y += itv->yuv_info.osd_y_offset; | ||
725 | } | ||
724 | 726 | ||
725 | /* Width & height for both src & dst must be even. | 727 | /* Width & height for both src & dst must be even. |
726 | Same for coordinates. */ | 728 | Same for coordinates. */ |
@@ -792,11 +794,19 @@ void ivtv_yuv_work_handler(struct ivtv *itv) | |||
792 | IVTV_DEBUG_YUV("Update yuv registers for frame %d\n", frame); | 794 | IVTV_DEBUG_YUV("Update yuv registers for frame %d\n", frame); |
793 | f = yi->new_frame_info[frame]; | 795 | f = yi->new_frame_info[frame]; |
794 | 796 | ||
795 | /* Update the osd pan info */ | 797 | if (yi->track_osd) { |
796 | f.pan_x = yi->osd_x_pan; | 798 | /* Snapshot the osd pan info */ |
797 | f.pan_y = yi->osd_y_pan; | 799 | f.pan_x = yi->osd_x_pan; |
798 | f.vis_w = yi->osd_vis_w; | 800 | f.pan_y = yi->osd_y_pan; |
799 | f.vis_h = yi->osd_vis_h; | 801 | f.vis_w = yi->osd_vis_w; |
802 | f.vis_h = yi->osd_vis_h; | ||
803 | } else { | ||
804 | /* Not tracking the osd, so assume full screen */ | ||
805 | f.pan_x = 0; | ||
806 | f.pan_y = 0; | ||
807 | f.vis_w = 720; | ||
808 | f.vis_h = yi->decode_height; | ||
809 | } | ||
800 | 810 | ||
801 | /* Calculate the display window coordinates. Exit if nothing left */ | 811 | /* Calculate the display window coordinates. Exit if nothing left */ |
802 | if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) | 812 | if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) |
@@ -914,7 +924,7 @@ static void ivtv_yuv_init(struct ivtv *itv) | |||
914 | } | 924 | } |
915 | 925 | ||
916 | /* Get next available yuv buffer on PVR350 */ | 926 | /* Get next available yuv buffer on PVR350 */ |
917 | void ivtv_yuv_next_free(struct ivtv *itv) | 927 | static void ivtv_yuv_next_free(struct ivtv *itv) |
918 | { | 928 | { |
919 | int draw, display; | 929 | int draw, display; |
920 | struct yuv_playback_info *yi = &itv->yuv_info; | 930 | struct yuv_playback_info *yi = &itv->yuv_info; |
@@ -937,7 +947,7 @@ void ivtv_yuv_next_free(struct ivtv *itv) | |||
937 | } | 947 | } |
938 | 948 | ||
939 | /* Set up frame according to ivtv_dma_frame parameters */ | 949 | /* Set up frame according to ivtv_dma_frame parameters */ |
940 | void ivtv_yuv_setup_frame(struct ivtv *itv, struct ivtv_dma_frame *args) | 950 | static void ivtv_yuv_setup_frame(struct ivtv *itv, struct ivtv_dma_frame *args) |
941 | { | 951 | { |
942 | struct yuv_playback_info *yi = &itv->yuv_info; | 952 | struct yuv_playback_info *yi = &itv->yuv_info; |
943 | u8 frame = yi->draw_frame; | 953 | u8 frame = yi->draw_frame; |
@@ -965,12 +975,6 @@ void ivtv_yuv_setup_frame(struct ivtv *itv, struct ivtv_dma_frame *args) | |||
965 | /* Are we going to offset the Y plane */ | 975 | /* Are we going to offset the Y plane */ |
966 | nf->offset_y = (nf->tru_h + nf->src_x < 512 - 16) ? 1 : 0; | 976 | nf->offset_y = (nf->tru_h + nf->src_x < 512 - 16) ? 1 : 0; |
967 | 977 | ||
968 | /* Snapshot the osd pan info */ | ||
969 | nf->pan_x = yi->osd_x_pan; | ||
970 | nf->pan_y = yi->osd_y_pan; | ||
971 | nf->vis_w = yi->osd_vis_w; | ||
972 | nf->vis_h = yi->osd_vis_h; | ||
973 | |||
974 | nf->update = 0; | 978 | nf->update = 0; |
975 | nf->interlaced_y = 0; | 979 | nf->interlaced_y = 0; |
976 | nf->interlaced_uv = 0; | 980 | nf->interlaced_uv = 0; |
@@ -1042,7 +1046,7 @@ void ivtv_yuv_frame_complete(struct ivtv *itv) | |||
1042 | (itv->yuv_info.draw_frame + 1) % IVTV_YUV_BUFFERS); | 1046 | (itv->yuv_info.draw_frame + 1) % IVTV_YUV_BUFFERS); |
1043 | } | 1047 | } |
1044 | 1048 | ||
1045 | int ivtv_yuv_udma_frame(struct ivtv *itv, struct ivtv_dma_frame *args) | 1049 | static int ivtv_yuv_udma_frame(struct ivtv *itv, struct ivtv_dma_frame *args) |
1046 | { | 1050 | { |
1047 | DEFINE_WAIT(wait); | 1051 | DEFINE_WAIT(wait); |
1048 | int rc = 0; | 1052 | int rc = 0; |