Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
"For 4 fixes for 3.3 (all trivial):
- uvc video driver: fixes a division by zero;
- davinci: add module.h to fix compilation;
- smsusb: fix the delivery system setting;
- smsdvb: the get_frontend implementation there is broken.

The smsdvb patch has 127 lines, but it is trivial: instead of
returning a cache of the set_frontend (with is wrong, as it doesn't
have the updated values for the data, and the implementation there is
buggy), it copies the information of the detected DVB parameters from
the smsdvb private structures into the corresponding DVBv5 struct
fields."

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] smsdvb: fix get_frontend
[media] smsusb: fix the default delivery system setting
[media] media: davinci: added module.h to resolve unresolved macros
[media] [FOR,v3.3] uvcvideo: Avoid division by 0 in timestamp calculation

+128 -14
+118 -9
drivers/media/dvb/siano/smsdvb.c
··· 49 49 50 50 struct completion tune_done; 51 51 52 - /* todo: save freq/band instead whole struct */ 53 - struct dtv_frontend_properties fe_params; 54 - 55 52 struct SMSHOSTLIB_STATISTICS_DVB_S sms_stat_dvb; 56 53 int event_fe_state; 57 54 int event_unc_state; ··· 741 744 struct dtv_frontend_properties *fep = &fe->dtv_property_cache; 742 745 struct smsdvb_client_t *client = 743 746 container_of(fe, struct smsdvb_client_t, frontend); 747 + struct smscore_device_t *coredev = client->coredev; 748 + struct TRANSMISSION_STATISTICS_S *td = 749 + &client->sms_stat_dvb.TransmissionData; 744 750 745 - sms_debug(""); 751 + switch (smscore_get_device_mode(coredev)) { 752 + case DEVICE_MODE_DVBT: 753 + case DEVICE_MODE_DVBT_BDA: 754 + fep->frequency = td->Frequency; 746 755 747 - /* todo: */ 748 - memcpy(fep, &client->fe_params, 749 - sizeof(struct dtv_frontend_properties)); 756 + switch (td->Bandwidth) { 757 + case 6: 758 + fep->bandwidth_hz = 6000000; 759 + break; 760 + case 7: 761 + fep->bandwidth_hz = 7000000; 762 + break; 763 + case 8: 764 + fep->bandwidth_hz = 8000000; 765 + break; 766 + } 767 + 768 + switch (td->TransmissionMode) { 769 + case 2: 770 + fep->transmission_mode = TRANSMISSION_MODE_2K; 771 + break; 772 + case 8: 773 + fep->transmission_mode = TRANSMISSION_MODE_8K; 774 + } 775 + 776 + switch (td->GuardInterval) { 777 + case 0: 778 + fep->guard_interval = GUARD_INTERVAL_1_32; 779 + break; 780 + case 1: 781 + fep->guard_interval = GUARD_INTERVAL_1_16; 782 + break; 783 + case 2: 784 + fep->guard_interval = GUARD_INTERVAL_1_8; 785 + break; 786 + case 3: 787 + fep->guard_interval = GUARD_INTERVAL_1_4; 788 + break; 789 + } 790 + 791 + switch (td->CodeRate) { 792 + case 0: 793 + fep->code_rate_HP = FEC_1_2; 794 + break; 795 + case 1: 796 + fep->code_rate_HP = FEC_2_3; 797 + break; 798 + case 2: 799 + fep->code_rate_HP = FEC_3_4; 800 + break; 801 + case 3: 802 + fep->code_rate_HP = FEC_5_6; 803 + break; 804 + case 4: 805 + fep->code_rate_HP = FEC_7_8; 806 + break; 807 + } 808 + 809 + switch (td->LPCodeRate) { 810 + case 0: 811 + fep->code_rate_LP = FEC_1_2; 812 + break; 813 + case 1: 814 + fep->code_rate_LP = FEC_2_3; 815 + break; 816 + case 2: 817 + fep->code_rate_LP = FEC_3_4; 818 + break; 819 + case 3: 820 + fep->code_rate_LP = FEC_5_6; 821 + break; 822 + case 4: 823 + fep->code_rate_LP = FEC_7_8; 824 + break; 825 + } 826 + 827 + switch (td->Constellation) { 828 + case 0: 829 + fep->modulation = QPSK; 830 + break; 831 + case 1: 832 + fep->modulation = QAM_16; 833 + break; 834 + case 2: 835 + fep->modulation = QAM_64; 836 + break; 837 + } 838 + 839 + switch (td->Hierarchy) { 840 + case 0: 841 + fep->hierarchy = HIERARCHY_NONE; 842 + break; 843 + case 1: 844 + fep->hierarchy = HIERARCHY_1; 845 + break; 846 + case 2: 847 + fep->hierarchy = HIERARCHY_2; 848 + break; 849 + case 3: 850 + fep->hierarchy = HIERARCHY_4; 851 + break; 852 + } 853 + 854 + fep->inversion = INVERSION_AUTO; 855 + break; 856 + case DEVICE_MODE_ISDBT: 857 + case DEVICE_MODE_ISDBT_BDA: 858 + fep->frequency = td->Frequency; 859 + fep->bandwidth_hz = 6000000; 860 + /* todo: retrive the other parameters */ 861 + break; 862 + default: 863 + return -EINVAL; 864 + } 750 865 751 866 return 0; 752 867 } ··· 981 872 switch (smscore_get_device_mode(coredev)) { 982 873 case DEVICE_MODE_DVBT: 983 874 case DEVICE_MODE_DVBT_BDA: 984 - smsdvb_fe_ops.delsys[0] = SYS_DVBT; 875 + client->frontend.ops.delsys[0] = SYS_DVBT; 985 876 break; 986 877 case DEVICE_MODE_ISDBT: 987 878 case DEVICE_MODE_ISDBT_BDA: 988 - smsdvb_fe_ops.delsys[0] = SYS_ISDBT; 879 + client->frontend.ops.delsys[0] = SYS_ISDBT; 989 880 break; 990 881 } 991 882
+1
drivers/media/video/davinci/isif.c
··· 34 34 #include <linux/videodev2.h> 35 35 #include <linux/clk.h> 36 36 #include <linux/err.h> 37 + #include <linux/module.h> 37 38 38 39 #include <mach/mux.h> 39 40
+9 -5
drivers/media/video/uvc/uvc_video.c
··· 611 611 delta_stc = buf->pts - (1UL << 31); 612 612 x1 = first->dev_stc - delta_stc; 613 613 x2 = last->dev_stc - delta_stc; 614 + if (x1 == x2) 615 + goto done; 616 + 614 617 y1 = (first->dev_sof + 2048) << 16; 615 618 y2 = (last->dev_sof + 2048) << 16; 616 - 617 619 if (y2 < y1) 618 620 y2 += 2048 << 16; 619 621 ··· 633 631 x1, x2, y1, y2, clock->sof_offset); 634 632 635 633 /* Second step, SOF to host clock conversion. */ 636 - ts = timespec_sub(last->host_ts, first->host_ts); 637 634 x1 = (uvc_video_clock_host_sof(first) + 2048) << 16; 638 635 x2 = (uvc_video_clock_host_sof(last) + 2048) << 16; 639 - y1 = NSEC_PER_SEC; 640 - y2 = (ts.tv_sec + 1) * NSEC_PER_SEC + ts.tv_nsec; 641 - 642 636 if (x2 < x1) 643 637 x2 += 2048 << 16; 638 + if (x1 == x2) 639 + goto done; 640 + 641 + ts = timespec_sub(last->host_ts, first->host_ts); 642 + y1 = NSEC_PER_SEC; 643 + y2 = (ts.tv_sec + 1) * NSEC_PER_SEC + ts.tv_nsec; 644 644 645 645 /* Interpolated and host SOF timestamps can wrap around at slightly 646 646 * different times. Handle this by adding or removing 2048 to or from