Pull media updates from Mauro Carvalho Chehab: - v4l2: - core: fix subdev sensor ownership - subdev: Allow accessing routes with STREAMS client capability - ctrls: Add validation for HEVC active reference counts and background detection control - common: Add YUV24 format info and has_alpha helper - vb2: Change vb2_read() and vb2_write() return types to ssize_t - i2c: cvs: Add driver of Intel Computer Vision Sensing Controller(CVS) - atmel-isc: remove deprecated driver - cec: Add CEC Latency Indication Protocol (LIP) support - imon: Add iMON VFD HID OEM v1.2 key mappings - AVMatrix: new HWS capture driver - isp4: new AMD capture driver - qcom: - iris: Add hierarchical coding, B-frame, and Long-Term Reference support for encoder - camss: Add SM6350 platform support - venus: Add SM6115 platform support - chips-media: wave5: Add support for Packed YUV422, CBP profile, and background detection - csi2rx: Add multistream support and 32 dma chans - Several cleanups and fixes * tag 'media/v7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (394 commits) media: v4l2-fwnode: Fix subdev owner overwritten in v4l2_async_register_subdev_sensor() media: qcom: iris: vdec: allow GEN2 decoding into 10bit format media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats media: qcom: iris: vdec: update size and stride calculations for 10bit formats media: qcom: iris: gen2: add support for 10bit decoding media: qcom: iris: add QC10C & P010 buffer size calculations media: qcom: iris: add helpers for 8bit and 10bit formats media: qcom: iris: Fix FPS calculation and VPP FW overhead media: qcom: camss: vfe-340: Support for PIX client media: qcom: camss: vfe-340: Proper client handling media: qcom: camss: csid-340: Enable PIX interface routing media: qcom: camss: csid-340: Add port-to-interface mapping media: qcom: camss: csid-340: Switch to generic CSID_CFG/CTRL registers media: iris: Initialize HFI ops after firmware load in core init media: iris: drop struct iris_fmt media: iris: Add platform data for X1P42100 media: iris: Add hardware power on/off ops for X1P42100 media: iris: optimize COMV buffer allocation for VPU3x and VPU4x media: iris: add FPS calculation and VPP FW overhead in frequency formula media: qcom: iris: Simplify COMV size calculation ...
Showing the changes to include/uapi/linux (4 of 523 files). Show all
Unified · Split
| @@ -1701,6 +1701,188 @@ static inline void cec_ops_request_current_latency(const struct cec_msg *msg, · 1700 unmodified lines | |||
| 1701 | } | 1701 | } |
| 1702 | 1702 | ||
| 1703 | 1703 | ||
| 1704 | /* Latency Indication Protocol Feature */ | ||
| 1705 | /* Only for CEC 2.0 and up */ | ||
| 1706 | static inline void cec_msg_request_lip_support(struct cec_msg *msg, | ||
| 1707 | int reply, __u16 phys_addr) | ||
| 1708 | { | ||
| 1709 | msg->len = 4; | ||
| 1710 | msg->msg[1] = CEC_MSG_REQUEST_LIP_SUPPORT; | ||
| 1711 | msg->msg[2] = phys_addr >> 8; | ||
| 1712 | msg->msg[3] = phys_addr & 0xff; | ||
| 1713 | msg->reply = reply ? CEC_MSG_REPORT_LIP_SUPPORT : 0; | ||
| 1714 | } | ||
| 1715 | |||
| 1716 | static inline void cec_ops_request_lip_support(const struct cec_msg *msg, | ||
| 1717 | __u16 *phys_addr) | ||
| 1718 | { | ||
| 1719 | *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; | ||
| 1720 | } | ||
| 1721 | |||
| 1722 | static inline void cec_msg_report_lip_support(struct cec_msg *msg, __u32 sqid) | ||
| 1723 | { | ||
| 1724 | msg->len = 6; | ||
| 1725 | msg->msg[1] = CEC_MSG_REPORT_LIP_SUPPORT; | ||
| 1726 | msg->msg[2] = sqid >> 24; | ||
| 1727 | msg->msg[3] = (sqid >> 16) & 0xff; | ||
| 1728 | msg->msg[4] = (sqid >> 8) & 0xff; | ||
| 1729 | msg->msg[5] = sqid & 0xff; | ||
| 1730 | } | ||
| 1731 | |||
| 1732 | static inline void cec_ops_report_lip_support(const struct cec_msg *msg, | ||
| 1733 | __u32 *sqid) | ||
| 1734 | { | ||
| 1735 | *sqid = (msg->msg[2] << 24) | (msg->msg[3] << 16) | | ||
| 1736 | (msg->msg[4] << 8) | msg->msg[5]; | ||
| 1737 | } | ||
| 1738 | |||
| 1739 | static inline void cec_msg_request_audio_and_video_latency(struct cec_msg *msg, | ||
| 1740 | int reply, __u8 video_format, | ||
| 1741 | __u8 hdr_format, __u8 vrr_format, | ||
| 1742 | __u8 audio_format, | ||
| 1743 | __u8 audio_format_extension) | ||
| 1744 | { | ||
| 1745 | msg->len = 6; | ||
| 1746 | msg->msg[1] = CEC_MSG_REQUEST_AUDIO_AND_VIDEO_LATENCY; | ||
| 1747 | msg->msg[2] = video_format; | ||
| 1748 | msg->msg[3] = hdr_format; | ||
| 1749 | msg->msg[4] = vrr_format; | ||
| 1750 | msg->msg[5] = audio_format; | ||
| 1751 | if (audio_format >= 1 && audio_format <= 31) { | ||
| 1752 | msg->msg[6] = audio_format_extension; | ||
| 1753 | msg->len++; | ||
| 1754 | } | ||
| 1755 | msg->reply = reply ? CEC_MSG_REPORT_AUDIO_AND_VIDEO_LATENCY : 0; | ||
| 1756 | } | ||
| 1757 | |||
| 1758 | static inline void cec_ops_request_audio_and_video_latency(const struct cec_msg *msg, | ||
| 1759 | __u8 *video_format, | ||
| 1760 | __u8 *hdr_format, | ||
| 1761 | __u8 *vrr_format, | ||
| 1762 | __u8 *audio_format, | ||
| 1763 | __u8 *audio_format_extension) | ||
| 1764 | { | ||
| 1765 | *video_format = msg->msg[2]; | ||
| 1766 | *hdr_format = msg->msg[3]; | ||
| 1767 | *vrr_format = msg->msg[4]; | ||
| 1768 | *audio_format = msg->msg[5]; | ||
| 1769 | *audio_format_extension = msg->len > 6 ? msg->msg[6] : 0; | ||
| 1770 | } | ||
| 1771 | |||
| 1772 | static inline void cec_msg_report_audio_and_video_latency(struct cec_msg *msg, | ||
| 1773 | __u16 video_latency, | ||
| 1774 | __u16 audio_latency) | ||
| 1775 | { | ||
| 1776 | msg->len = 6; | ||
| 1777 | msg->msg[1] = CEC_MSG_REPORT_AUDIO_AND_VIDEO_LATENCY; | ||
| 1778 | msg->msg[2] = video_latency >> 8; | ||
| 1779 | msg->msg[3] = video_latency & 0xff; | ||
| 1780 | msg->msg[4] = audio_latency >> 8; | ||
| 1781 | msg->msg[5] = audio_latency & 0xff; | ||
| 1782 | } | ||
| 1783 | |||
| 1784 | static inline void cec_ops_report_audio_and_video_latency(const struct cec_msg *msg, | ||
| 1785 | __u16 *video_latency, | ||
| 1786 | __u16 *audio_latency) | ||
| 1787 | { | ||
| 1788 | *video_latency = (msg->msg[2] << 8) | msg->msg[3]; | ||
| 1789 | *audio_latency = (msg->msg[4] << 8) | msg->msg[5]; | ||
| 1790 | } | ||
| 1791 | |||
| 1792 | static inline void cec_msg_request_audio_latency(struct cec_msg *msg, | ||
| 1793 | int reply, | ||
| 1794 | __u8 audio_format, | ||
| 1795 | __u8 audio_format_extension) | ||
| 1796 | { | ||
| 1797 | msg->len = 3; | ||
| 1798 | msg->msg[1] = CEC_MSG_REQUEST_AUDIO_LATENCY; | ||
| 1799 | msg->msg[2] = audio_format; | ||
| 1800 | if (audio_format >= 1 && audio_format <= 31) { | ||
| 1801 | msg->msg[3] = audio_format_extension; | ||
| 1802 | msg->len++; | ||
| 1803 | } | ||
| 1804 | msg->reply = reply ? CEC_MSG_REPORT_AUDIO_LATENCY : 0; | ||
| 1805 | } | ||
| 1806 | |||
| 1807 | static inline void cec_ops_request_audio_latency(const struct cec_msg *msg, | ||
| 1808 | __u8 *audio_format, | ||
| 1809 | __u8 *audio_format_extension) | ||
| 1810 | { | ||
| 1811 | *audio_format = msg->msg[2]; | ||
| 1812 | *audio_format_extension = msg->len > 3 ? msg->msg[3] : 0; | ||
| 1813 | } | ||
| 1814 | |||
| 1815 | static inline void cec_msg_report_audio_latency(struct cec_msg *msg, | ||
| 1816 | __u16 audio_latency) | ||
| 1817 | { | ||
| 1818 | msg->len = 4; | ||
| 1819 | msg->msg[1] = CEC_MSG_REPORT_AUDIO_LATENCY; | ||
| 1820 | msg->msg[2] = audio_latency >> 8; | ||
| 1821 | msg->msg[3] = audio_latency & 0xff; | ||
| 1822 | } | ||
| 1823 | |||
| 1824 | static inline void cec_ops_report_audio_latency(const struct cec_msg *msg, | ||
| 1825 | __u16 *audio_latency) | ||
| 1826 | { | ||
| 1827 | *audio_latency = (msg->msg[2] << 8) | msg->msg[3]; | ||
| 1828 | } | ||
| 1829 | |||
| 1830 | static inline void cec_msg_request_video_latency(struct cec_msg *msg, | ||
| 1831 | int reply, __u8 video_format, | ||
| 1832 | __u8 hdr_format, | ||
| 1833 | __u8 vrr_format) | ||
| 1834 | { | ||
| 1835 | msg->len = 5; | ||
| 1836 | msg->msg[1] = CEC_MSG_REQUEST_VIDEO_LATENCY; | ||
| 1837 | msg->msg[2] = video_format; | ||
| 1838 | msg->msg[3] = hdr_format; | ||
| 1839 | msg->msg[4] = vrr_format; | ||
| 1840 | msg->reply = reply ? CEC_MSG_REPORT_VIDEO_LATENCY : 0; | ||
| 1841 | } | ||
| 1842 | |||
| 1843 | static inline void cec_ops_request_video_latency(const struct cec_msg *msg, | ||
| 1844 | __u8 *video_format, | ||
| 1845 | __u8 *hdr_format, | ||
| 1846 | __u8 *vrr_format) | ||
| 1847 | { | ||
| 1848 | *video_format = msg->msg[2]; | ||
| 1849 | *hdr_format = msg->msg[3]; | ||
| 1850 | *vrr_format = msg->msg[4]; | ||
| 1851 | } | ||
| 1852 | |||
| 1853 | static inline void cec_msg_report_video_latency(struct cec_msg *msg, | ||
| 1854 | __u16 video_latency) | ||
| 1855 | { | ||
| 1856 | msg->len = 4; | ||
| 1857 | msg->msg[1] = CEC_MSG_REPORT_VIDEO_LATENCY; | ||
| 1858 | msg->msg[2] = video_latency >> 8; | ||
| 1859 | msg->msg[3] = video_latency & 0xff; | ||
| 1860 | } | ||
| 1861 | |||
| 1862 | static inline void cec_ops_report_video_latency(const struct cec_msg *msg, | ||
| 1863 | __u16 *video_latency) | ||
| 1864 | { | ||
| 1865 | *video_latency = (msg->msg[2] << 8) | msg->msg[3]; | ||
| 1866 | } | ||
| 1867 | |||
| 1868 | static inline void cec_msg_update_sqid(struct cec_msg *msg, __u32 sqid) | ||
| 1869 | { | ||
| 1870 | msg->len = 6; | ||
| 1871 | msg->msg[1] = CEC_MSG_UPDATE_SQID; | ||
| 1872 | msg->msg[2] = sqid >> 24; | ||
| 1873 | msg->msg[3] = (sqid >> 16) & 0xff; | ||
| 1874 | msg->msg[4] = (sqid >> 8) & 0xff; | ||
| 1875 | msg->msg[5] = sqid & 0xff; | ||
| 1876 | } | ||
| 1877 | |||
| 1878 | static inline void cec_ops_update_sqid(const struct cec_msg *msg, | ||
| 1879 | __u32 *sqid) | ||
| 1880 | { | ||
| 1881 | *sqid = (msg->msg[2] << 24) | (msg->msg[3] << 16) | | ||
| 1882 | (msg->msg[4] << 8) | msg->msg[5]; | ||
| 1883 | } | ||
| 1884 | |||
| 1885 | |||
| 1704 | /* Capability Discovery and Control Feature */ | 1886 | /* Capability Discovery and Control Feature */ |
| 1705 | static inline void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg, | 1887 | static inline void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg, |
| 1706 | __u16 phys_addr1, | 1888 | __u16 phys_addr1, |
| @@ -742,7 +742,7 @@ struct cec_event { · 741 unmodified lines | |||
| 742 | #define CEC_OP_PRIM_DEVTYPE_PROCESSOR 7 | 742 | #define CEC_OP_PRIM_DEVTYPE_PROCESSOR 7 |
| 743 | 743 | ||
| 744 | #define CEC_MSG_SET_MENU_LANGUAGE 0x32 | 744 | #define CEC_MSG_SET_MENU_LANGUAGE 0x32 |
| 745 | #define CEC_MSG_REPORT_FEATURES 0xa6 /* HDMI 2.0 */ | 745 | #define CEC_MSG_REPORT_FEATURES 0xa6 /* CEC 2.0 */ |
| 746 | /* All Device Types Operand (all_device_types) */ | 746 | /* All Device Types Operand (all_device_types) */ |
| 747 | #define CEC_OP_ALL_DEVTYPE_TV 0x80 | 747 | #define CEC_OP_ALL_DEVTYPE_TV 0x80 |
| 748 | #define CEC_OP_ALL_DEVTYPE_RECORD 0x40 | 748 | #define CEC_OP_ALL_DEVTYPE_RECORD 0x40 |
| @@ -777,7 +777,7 @@ struct cec_event { · 28 unmodified lines | |||
| 777 | #define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX 0x02 | 777 | #define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX 0x02 |
| 778 | #define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_VOLUME_LEVEL 0x01 | 778 | #define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_VOLUME_LEVEL 0x01 |
| 779 | 779 | ||
| 780 | #define CEC_MSG_GIVE_FEATURES 0xa5 /* HDMI 2.0 */ | 780 | #define CEC_MSG_GIVE_FEATURES 0xa5 /* CEC 2.0 */ |
| 781 | 781 | ||
| 782 | 782 | ||
| 783 | /* Deck Control Feature */ | 783 | /* Deck Control Feature */ |
| @@ -1067,7 +1067,7 @@ struct cec_event { · 283 unmodified lines | |||
| 1067 | #define CEC_OP_AUD_FMT_ID_CEA861 0 | 1067 | #define CEC_OP_AUD_FMT_ID_CEA861 0 |
| 1068 | #define CEC_OP_AUD_FMT_ID_CEA861_CXT 1 | 1068 | #define CEC_OP_AUD_FMT_ID_CEA861_CXT 1 |
| 1069 | 1069 | ||
| 1070 | #define CEC_MSG_SET_AUDIO_VOLUME_LEVEL 0x73 | 1070 | #define CEC_MSG_SET_AUDIO_VOLUME_LEVEL 0x73 /* CEC 2.0 */ |
| 1071 | 1071 | ||
| 1072 | /* Audio Rate Control Feature */ | 1072 | /* Audio Rate Control Feature */ |
| 1073 | #define CEC_MSG_SET_AUDIO_RATE 0x9a | 1073 | #define CEC_MSG_SET_AUDIO_RATE 0x9a |
| @@ -1091,7 +1091,6 @@ struct cec_event { · 17 unmodified lines | |||
| 1091 | 1091 | ||
| 1092 | 1092 | ||
| 1093 | /* Dynamic Audio Lipsync Feature */ | 1093 | /* Dynamic Audio Lipsync Feature */ |
| 1094 | /* Only for CEC 2.0 and up */ | ||
| 1095 | #define CEC_MSG_REQUEST_CURRENT_LATENCY 0xa7 | 1094 | #define CEC_MSG_REQUEST_CURRENT_LATENCY 0xa7 |
| 1096 | #define CEC_MSG_REPORT_CURRENT_LATENCY 0xa8 | 1095 | #define CEC_MSG_REPORT_CURRENT_LATENCY 0xa8 |
| 1097 | /* Low Latency Mode Operand (low_latency_mode) */ | 1096 | /* Low Latency Mode Operand (low_latency_mode) */ |
| @@ -1104,6 +1103,30 @@ struct cec_event { · 6 unmodified lines | |||
| 1104 | #define CEC_OP_AUD_OUT_COMPENSATED_PARTIAL_DELAY 3 | 1103 | #define CEC_OP_AUD_OUT_COMPENSATED_PARTIAL_DELAY 3 |
| 1105 | 1104 | ||
| 1106 | 1105 | ||
| 1106 | /* Latency Indication Protocol Feature */ | ||
| 1107 | #define CEC_MSG_REQUEST_LIP_SUPPORT 0x50 /* CEC 2.0 */ | ||
| 1108 | #define CEC_MSG_REPORT_LIP_SUPPORT 0x51 /* CEC 2.0 */ | ||
| 1109 | #define CEC_MSG_REQUEST_AUDIO_AND_VIDEO_LATENCY 0x52 /* CEC 2.0 */ | ||
| 1110 | /* HDR Format Operand (hdr_format) */ | ||
| 1111 | #define CEC_OP_HDR_FORMAT_GAMMA_SDR 0 | ||
| 1112 | #define CEC_OP_HDR_FORMAT_GAMMA_HDR 1 | ||
| 1113 | #define CEC_OP_HDR_FORMAT_PQ 2 | ||
| 1114 | #define CEC_OP_HDR_FORMAT_HLG 3 | ||
| 1115 | #define CEC_OP_HDR_FORMAT_DYNAMIC_HDR_TYPE_1 8 | ||
| 1116 | #define CEC_OP_HDR_FORMAT_DYNAMIC_HDR_TYPE_2 9 | ||
| 1117 | #define CEC_OP_HDR_FORMAT_DYNAMIC_HDR_TYPE_4 11 | ||
| 1118 | #define CEC_OP_HDR_FORMAT_DV_SINK_LED 16 | ||
| 1119 | #define CEC_OP_HDR_FORMAT_DV_SOURCE_LED 17 | ||
| 1120 | #define CEC_OP_HDR_FORMAT_HDR10PLUS 24 | ||
| 1121 | #define CEC_OP_HDR_FORMAT_ETSI_TS_103_433 32 | ||
| 1122 | #define CEC_MSG_REPORT_AUDIO_AND_VIDEO_LATENCY 0x53 /* CEC 2.0 */ | ||
| 1123 | #define CEC_MSG_REQUEST_AUDIO_LATENCY 0x54 /* CEC 2.0 */ | ||
| 1124 | #define CEC_MSG_REPORT_AUDIO_LATENCY 0x55 /* CEC 2.0 */ | ||
| 1125 | #define CEC_MSG_REQUEST_VIDEO_LATENCY 0x56 /* CEC 2.0 */ | ||
| 1126 | #define CEC_MSG_REPORT_VIDEO_LATENCY 0x57 /* CEC 2.0 */ | ||
| 1127 | #define CEC_MSG_UPDATE_SQID 0x58 /* CEC 2.0 */ | ||
| 1128 | |||
| 1129 | |||
| 1107 | /* Capability Discovery and Control Feature */ | 1130 | /* Capability Discovery and Control Feature */ |
| 1108 | #define CEC_MSG_CDC_MESSAGE 0xf8 | 1131 | #define CEC_MSG_CDC_MESSAGE 0xf8 |
| 1109 | /* Ethernet-over-HDMI: nobody ever does this... */ | 1132 | /* Ethernet-over-HDMI: nobody ever does this... */ |
| @@ -967,6 +967,92 @@ struct rkisp1_cif_isp_wdr_config { · 966 unmodified lines | |||
| 967 | __u8 use_iref; | 967 | __u8 use_iref; |
| 968 | }; | 968 | }; |
| 969 | 969 | ||
| 970 | /* | ||
| 971 | * enum rkisp1_cif_isp_cac_h_clip_mode - horizontal clipping mode | ||
| 972 | * | ||
| 973 | * @RKISP1_CIF_ISP_CAC_H_CLIP_MODE_4PX: +/- 4 pixels | ||
| 974 | * @RKISP1_CIF_ISP_CAC_H_CLIP_MODE_4_5PX: +/- 4/5 pixels depending on bayer position | ||
| 975 | */ | ||
| 976 | enum rkisp1_cif_isp_cac_h_clip_mode { | ||
| 977 | RKISP1_CIF_ISP_CAC_H_CLIP_MODE_4PX = 0, | ||
| 978 | RKISP1_CIF_ISP_CAC_H_CLIP_MODE_4_5PX = 1, | ||
| 979 | }; | ||
| 980 | |||
| 981 | /** | ||
| 982 | * enum rkisp1_cif_isp_cac_v_clip_mode - vertical clipping mode | ||
| 983 | * | ||
| 984 | * @RKISP1_CIF_ISP_CAC_V_CLIP_MODE_2PX: +/- 2 pixels | ||
| 985 | * @RKISP1_CIF_ISP_CAC_V_CLIP_MODE_3PX: +/- 3 pixels | ||
| 986 | * @RKISP1_CIF_ISP_CAC_V_CLIP_MODE_3_4PX: +/- 3/4 pixels depending on bayer position | ||
| 987 | */ | ||
| 988 | enum rkisp1_cif_isp_cac_v_clip_mode { | ||
| 989 | RKISP1_CIF_ISP_CAC_V_CLIP_MODE_2PX = 0, | ||
| 990 | RKISP1_CIF_ISP_CAC_V_CLIP_MODE_3PX = 1, | ||
| 991 | RKISP1_CIF_ISP_CAC_V_CLIP_MODE_3_4PX = 2, | ||
| 992 | }; | ||
| 993 | |||
| 994 | /** | ||
| 995 | * struct rkisp1_cif_isp_cac_config - chromatic aberration correction configuration | ||
| 996 | * | ||
| 997 | * The correction is carried out by shifting the red and blue pixels relative | ||
| 998 | * to the green ones, depending on the distance from the optical center: | ||
| 999 | * | ||
| 1000 | * @h_count_start: horizontal coordinate of the optical center (13-bit unsigned integer; [1,8191]) | ||
| 1001 | * @v_count_start: vertical coordinate of the optical center (13-bit unsigned integer; [1,8191]) | ||
| 1002 | * | ||
| 1003 | * For each pixel, the x/y distances from the optical center are calculated and | ||
| 1004 | * then transformed into the [0,255] range based on the following formula: | ||
| 1005 | * | ||
| 1006 | * (((d << 4) >> ns) * nf) >> 5 | ||
| 1007 | * | ||
| 1008 | * where `d` is the distance, `ns` and `nf` are the normalization parameters: | ||
| 1009 | * | ||
| 1010 | * @x_nf: horizontal normalization scale parameter (5-bit unsigned integer; [0,31]) | ||
| 1011 | * @x_ns: horizontal normalization shift parameter (4-bit unsigned integer; [0,15]) | ||
| 1012 | * | ||
| 1013 | * @y_nf: vertical normalization scale parameter (5-bit unsigned integer; [0,31]) | ||
| 1014 | * @y_ns: vertical normalization shift parameter (4-bit unsigned integer; [0,15]) | ||
| 1015 | * | ||
| 1016 | * These parameters should be chosen based on the image resolution, the position | ||
| 1017 | * of the optical center, and the shape of pixels, so that no normalized distance | ||
| 1018 | * is larger than 255. If the pixels have square shape, the two sets of parameters | ||
| 1019 | * should be equal. | ||
| 1020 | * | ||
| 1021 | * The actual amount of correction is calculated with a third degree polynomial: | ||
| 1022 | * | ||
| 1023 | * c[0] * r + c[1] * r^2 + c[2] * r^3 | ||
| 1024 | * | ||
| 1025 | * where `c` is the set of coefficients for the given color, and `r` is distance: | ||
| 1026 | * | ||
| 1027 | * @red: red coefficients (5.4 two's complement; [-16,15.9375]) | ||
| 1028 | * @blue: blue coefficients (5.4 two's complement; [-16,15.9375]) | ||
| 1029 | * | ||
| 1030 | * Finally, the amount is clipped as requested: | ||
| 1031 | * | ||
| 1032 | * @h_clip_mode: maximum horizontal shift (from enum rkisp1_cif_isp_cac_h_clip_mode) | ||
| 1033 | * @v_clip_mode: maximum vertical shift (from enum rkisp1_cif_isp_cac_v_clip_mode) | ||
| 1034 | * | ||
| 1035 | * A positive result will shift away from the optical center, while a negative | ||
| 1036 | * one will shift towards the optical center. In the latter case, the pixel | ||
| 1037 | * values at the edges are duplicated. | ||
| 1038 | */ | ||
| 1039 | struct rkisp1_cif_isp_cac_config { | ||
| 1040 | __u8 h_clip_mode; | ||
| 1041 | __u8 v_clip_mode; | ||
| 1042 | |||
| 1043 | __u16 h_count_start; | ||
| 1044 | __u16 v_count_start; | ||
| 1045 | |||
| 1046 | __u16 red[3]; | ||
| 1047 | __u16 blue[3]; | ||
| 1048 | |||
| 1049 | __u8 x_nf; | ||
| 1050 | __u8 x_ns; | ||
| 1051 | |||
| 1052 | __u8 y_nf; | ||
| 1053 | __u8 y_ns; | ||
| 1054 | }; | ||
| 1055 | |||
| 970 | /*---------- PART2: Measurement Statistics ------------*/ | 1056 | /*---------- PART2: Measurement Statistics ------------*/ |
| 971 | 1057 | ||
| 972 | /** | 1058 | /** |
| @@ -1138,6 +1224,7 @@ struct rkisp1_stat_buffer { · 165 unmodified lines | |||
| 1138 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND: Companding expand curve | 1224 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND: Companding expand curve |
| 1139 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS: Companding compress curve | 1225 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS: Companding compress curve |
| 1140 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR: Wide dynamic range | 1226 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR: Wide dynamic range |
| 1227 | * @RKISP1_EXT_PARAMS_BLOCK_TYPE_CAC: Chromatic aberration correction | ||
| 1141 | */ | 1228 | */ |
| 1142 | enum rkisp1_ext_params_block_type { | 1229 | enum rkisp1_ext_params_block_type { |
| 1143 | RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS, | 1230 | RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS, |
| @@ -1161,6 +1248,7 @@ enum rkisp1_ext_params_block_type { · 17 unmodified lines | |||
| 1161 | RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND, | 1248 | RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND, |
| 1162 | RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS, | 1249 | RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS, |
| 1163 | RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR, | 1250 | RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR, |
| 1251 | RKISP1_EXT_PARAMS_BLOCK_TYPE_CAC, | ||
| 1164 | }; | 1252 | }; |
| 1165 | 1253 | ||
| 1166 | /* For backward compatibility */ | 1254 | /* For backward compatibility */ |
| @@ -1507,6 +1595,22 @@ struct rkisp1_ext_params_wdr_config { · 340 unmodified lines | |||
| 1507 | struct rkisp1_cif_isp_wdr_config config; | 1595 | struct rkisp1_cif_isp_wdr_config config; |
| 1508 | } __attribute__((aligned(8))); | 1596 | } __attribute__((aligned(8))); |
| 1509 | 1597 | ||
| 1598 | /** | ||
| 1599 | * struct rkisp1_ext_params_cac_config - RkISP1 extensible params CAC config | ||
| 1600 | * | ||
| 1601 | * RkISP1 extensible parameters CAC block. | ||
| 1602 | * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_CAC`. | ||
| 1603 | * | ||
| 1604 | * @header: The RkISP1 extensible parameters header, see | ||
| 1605 | * :c:type:`rkisp1_ext_params_block_header` | ||
| 1606 | * @config: CAC configuration, see | ||
| 1607 | * :c:type:`rkisp1_cif_isp_cac_config` | ||
| 1608 | */ | ||
| 1609 | struct rkisp1_ext_params_cac_config { | ||
| 1610 | struct rkisp1_ext_params_block_header header; | ||
| 1611 | struct rkisp1_cif_isp_cac_config config; | ||
| 1612 | } __attribute__((aligned(8))); | ||
| 1613 | |||
| 1510 | /* | 1614 | /* |
| 1511 | * The rkisp1_ext_params_compand_curve_config structure is counted twice as it | 1615 | * The rkisp1_ext_params_compand_curve_config structure is counted twice as it |
| 1512 | * is used for both the COMPAND_EXPAND and COMPAND_COMPRESS block types. | 1616 | * is used for both the COMPAND_EXPAND and COMPAND_COMPRESS block types. |
| @@ -1532,14 +1636,15 @@ struct rkisp1_ext_params_wdr_config { · 19 unmodified lines | |||
| 1532 | sizeof(struct rkisp1_ext_params_compand_bls_config) +\ | 1636 | sizeof(struct rkisp1_ext_params_compand_bls_config) +\ |
| 1533 | sizeof(struct rkisp1_ext_params_compand_curve_config) +\ | 1637 | sizeof(struct rkisp1_ext_params_compand_curve_config) +\ |
| 1534 | sizeof(struct rkisp1_ext_params_compand_curve_config) +\ | 1638 | sizeof(struct rkisp1_ext_params_compand_curve_config) +\ |
| 1535 | sizeof(struct rkisp1_ext_params_wdr_config)) | 1639 | sizeof(struct rkisp1_ext_params_wdr_config) +\ |
| 1640 | sizeof(struct rkisp1_ext_params_cac_config)) | ||
| 1536 | 1641 | ||
| 1537 | /** | 1642 | /** |
| 1538 | * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version | 1643 | * enum rkisp1_ext_param_buffer_version - RkISP1 extensible parameters version |
| 1539 | * | 1644 | * |
| 1540 | * @RKISP1_EXT_PARAM_BUFFER_V1: First version of RkISP1 extensible parameters | 1645 | * @RKISP1_EXT_PARAM_BUFFER_V1: First version of RkISP1 extensible parameters |
| 1541 | */ | 1646 | */ |
| 1542 | enum rksip1_ext_param_buffer_version { | 1647 | enum rkisp1_ext_param_buffer_version { |
| 1543 | RKISP1_EXT_PARAM_BUFFER_V1 = V4L2_ISP_PARAMS_VERSION_V1, | 1648 | RKISP1_EXT_PARAM_BUFFER_V1 = V4L2_ISP_PARAMS_VERSION_V1, |
| 1544 | }; | 1649 | }; |
| 1545 | 1650 | ||
| @@ -1601,7 +1706,7 @@ enum rksip1_ext_param_buffer_version { · 55 unmodified lines | |||
| 1601 | * +---------------------------------------------------------------------+ | 1706 | * +---------------------------------------------------------------------+ |
| 1602 | * | 1707 | * |
| 1603 | * @version: The RkISP1 extensible parameters buffer version, see | 1708 | * @version: The RkISP1 extensible parameters buffer version, see |
| 1604 | * :c:type:`rksip1_ext_param_buffer_version` | 1709 | * :c:type:`rkisp1_ext_param_buffer_version` |
| 1605 | * @data_size: The RkISP1 configuration data effective size, excluding this | 1710 | * @data_size: The RkISP1 configuration data effective size, excluding this |
| 1606 | * header | 1711 | * header |
| 1607 | * @data: The RkISP1 extensible configuration data blocks | 1712 | * @data: The RkISP1 extensible configuration data blocks |
| @@ -464,6 +464,8 @@ enum v4l2_mpeg_video_intra_refresh_period_type { · 463 unmodified lines | |||
| 464 | V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC = 1, | 464 | V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC = 1, |
| 465 | }; | 465 | }; |
| 466 | 466 | ||
| 467 | #define V4L2_CID_MPEG_VIDEO_BACKGROUND_DETECTION (V4L2_CID_CODEC_BASE + 238) | ||
| 468 | |||
| 467 | /* CIDs for the MPEG-2 Part 2 (H.262) codec */ | 469 | /* CIDs for the MPEG-2 Part 2 (H.262) codec */ |
| 468 | #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270) | 470 | #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270) |
| 469 | enum v4l2_mpeg_video_mpeg2_level { | 471 | enum v4l2_mpeg_video_mpeg2_level { |