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
55 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)55 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)
56#define VIDIOC_OMAP3ISP_STAT_REQ \56#define VIDIOC_OMAP3ISP_STAT_REQ \
57 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data)57 _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)
58#define VIDIOC_OMAP3ISP_STAT_EN \60#define VIDIOC_OMAP3ISP_STAT_EN \
59 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)61 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)
60 62
@@ -165,7 +167,14 @@ struct omap3isp_h3a_aewb_config { · 104 unmodified lines
165 * @config_counter: Number of the configuration associated with the data.167 * @config_counter: Number of the configuration associated with the data.
166 */168 */
167struct omap3isp_stat_data {169struct omap3isp_stat_data {
170#ifdef __KERNEL__
171 struct {
172 __s64 tv_sec;
173 __s64 tv_usec;
174 } ts;
175#else
168 struct timeval ts;176 struct timeval ts;
177#endif
169 void __user *buf;178 void __user *buf;
170 __u32 buf_size;179 __u32 buf_size;
171 __u16 frame_number;180 __u16 frame_number;
@@ -173,6 +182,19 @@ struct omap3isp_stat_data { · 1 unmodified line
173 __u16 config_counter;182 __u16 config_counter;
174};183};
175 184
185#ifdef __KERNEL__
186struct 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
176 198
177/* Histogram related structs */199/* Histogram related structs */
178 200