History

media: omap3isp: support 64-bit version of omap3isp_stat_data

C libraries with 64-bit time_t use an incompatible format for struct omap3isp_stat_data. This changes the kernel code to support either version, by moving over the normal handling to the 64-bit variant, and adding compatiblity code to handle the old binary format with the existing ioctl command code. Fortunately, the command code includes the size of the structure, so the difference gets handled automatically. In the process of eliminating the references to 'struct timeval' from the kernel, I also change the way the timestamp is generated internally, basically by open-coding the v4l2_get_timestamp() call. [Sakari Ailus: Alphabetical order of headers, clean up compat code]

Arnd Bergmann committed 8 years ago

Commit 378e3f81 parent daa36376 files · +52 −3Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/omap3isp.h+22−0
@@ -55,6 +55,8 @@ · 54 unmodified lines
5555 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)
5656 #define VIDIOC_OMAP3ISP_STAT_REQ \
5757 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data)
58+#define VIDIOC_OMAP3ISP_STAT_REQ_TIME32 \
59+ _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data_time32)
5860 #define VIDIOC_OMAP3ISP_STAT_EN \
5961 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)
6062
@@ -165,7 +167,14 @@ struct omap3isp_h3a_aewb_config { · 104 unmodified lines
165167 * @config_counter: Number of the configuration associated with the data.
166168 */
167169 struct omap3isp_stat_data {
170+#ifdef __KERNEL__
171+ struct {
172+ __s64 tv_sec;
173+ __s64 tv_usec;
174+ } ts;
175+#else
168176 struct timeval ts;
177+#endif
169178 void __user *buf;
170179 __u32 buf_size;
171180 __u16 frame_number;
@@ -173,6 +182,19 @@ struct omap3isp_stat_data { · 1 unmodified line
173182 __u16 config_counter;
174183 };
175184
185+#ifdef __KERNEL__
186+struct omap3isp_stat_data_time32 {
187+ struct {
188+ __s32 tv_sec;
189+ __s32 tv_usec;
190+ } ts;
191+ __u32 buf;
192+ __u32 buf_size;
193+ __u16 frame_number;
194+ __u16 cur_frame;
195+ __u16 config_counter;
196+};
197+#endif
176198
177199 /* Histogram related structs */
178200