Lines Matching +full:1 +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0-or-later
27 * Video4linux 1/2 integration by Justin Schoeman
46 #include <media/v4l2-common.h>
47 #include <media/v4l2-device.h>
48 #include <media/v4l2-ctrls.h>
73 v4l2_ctrl_fill(qctrl->id, &name, &qctrl->type, in v4l2_ctrl_query_fill()
74 &min, &max, &step, &def, &qctrl->flags); in v4l2_ctrl_query_fill()
77 return -EINVAL; in v4l2_ctrl_query_fill()
79 qctrl->minimum = min; in v4l2_ctrl_query_fill()
80 qctrl->maximum = max; in v4l2_ctrl_query_fill()
81 qctrl->step = step; in v4l2_ctrl_query_fill()
82 qctrl->default_value = def; in v4l2_ctrl_query_fill()
83 qctrl->reserved[0] = qctrl->reserved[1] = 0; in v4l2_ctrl_query_fill()
84 strscpy(qctrl->name, name, sizeof(qctrl->name)); in v4l2_ctrl_query_fill()
97 unsigned int mask = ~((1 << align) - 1); in clamp_align()
104 x = (x + (1 << (align - 1))) & mask; in clamp_align()
137 unsigned int wmaxa = __fls(wmax ^ (wmin - 1)); in v4l_bound_align_image()
139 unsigned int hmaxa = __fls(hmax ^ (hmin - 1)); in v4l_bound_align_image()
145 *w = clamp_align(*w, wmin, wmax, walign + 1); in v4l_bound_align_image()
148 *h = clamp_align(*h, hmin, hmax, halign + 1); in v4l_bound_align_image()
172 error = abs(*entry_width - width) + abs(*entry_height - height); in __v4l2_find_nearest_size()
192 if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && in v4l2_g_parm_cap()
193 a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) in v4l2_g_parm_cap()
194 return -EINVAL; in v4l2_g_parm_cap()
196 if (vdev->device_caps & V4L2_CAP_READWRITE) in v4l2_g_parm_cap()
197 a->parm.capture.readbuffers = 2; in v4l2_g_parm_cap()
199 a->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; in v4l2_g_parm_cap()
202 a->parm.capture.timeperframe = ival.interval; in v4l2_g_parm_cap()
211 .interval = a->parm.capture.timeperframe in v4l2_s_parm_cap()
215 if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && in v4l2_s_parm_cap()
216 a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) in v4l2_s_parm_cap()
217 return -EINVAL; in v4l2_s_parm_cap()
219 memset(&a->parm, 0, sizeof(a->parm)); in v4l2_s_parm_cap()
220 if (vdev->device_caps & V4L2_CAP_READWRITE) in v4l2_s_parm_cap()
221 a->parm.capture.readbuffers = 2; in v4l2_s_parm_cap()
223 a->parm.capture.readbuffers = 0; in v4l2_s_parm_cap()
226 a->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; in v4l2_s_parm_cap()
229 a->parm.capture.timeperframe = ival.interval; in v4l2_s_parm_cap()
238 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 3, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
239 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 3, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
240 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 3, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
241 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
242 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
243 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
244 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
245 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
246 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
247 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
248 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
249 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
250 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
251 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
252 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
253 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
254 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
255 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
256 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
257 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
258 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 8, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
259 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
260 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
261 …2_PIXEL_ENC_RGB, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
264 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
265 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
266 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
267 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
268 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
269 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
270 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
271 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
272 …_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv… in v4l2_format_info()
274 …_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv… in v4l2_format_info()
278 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = … in v4l2_format_info()
279 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = … in v4l2_format_info()
280 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
281 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
282 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
283 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
284 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
285 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .bpp_div = … in v4l2_format_info()
287 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = … in v4l2_format_info()
288 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = … in v4l2_format_info()
289 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
290 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = … in v4l2_format_info()
291 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = … in v4l2_format_info()
292 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
293 …2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
296 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = … in v4l2_format_info()
297 …l_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = … in v4l2_format_info()
298 .block_w = { 4, 2, 0, 0 }, .block_h = { 1, 1, 0, 0 }}, in v4l2_format_info()
299 …el_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .bpp_div = … in v4l2_format_info()
302 …IXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 },… in v4l2_format_info()
303 …IXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 },… in v4l2_format_info()
304 …, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, … in v4l2_format_info()
305 …, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, … in v4l2_format_info()
306 …, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, … in v4l2_format_info()
307 …, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, … in v4l2_format_info()
309 …IXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 },… in v4l2_format_info()
310 …IXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 },… in v4l2_format_info()
311 …, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, … in v4l2_format_info()
312 …, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, … in v4l2_format_info()
313 ….mem_planes = 2, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .v… in v4l2_format_info()
316 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
317 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
318 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
319 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
320 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
321 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
322 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
323 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
324 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
325 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
326 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
327 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
328 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
329 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
330 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
331 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 1, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
332 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
333 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
334 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
335 …PIXEL_ENC_BAYER, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 in v4l2_format_info()
348 if (!info->block_w[plane]) in v4l2_format_block_width()
349 return 1; in v4l2_format_block_width()
350 return info->block_w[plane]; in v4l2_format_block_width()
355 if (!info->block_h[plane]) in v4l2_format_block_height()
356 return 1; in v4l2_format_block_height()
357 return info->block_h[plane]; in v4l2_format_block_height()
370 *width = clamp_roundup(*width, frmsize->min_width, frmsize->max_width, in v4l2_apply_frmsize_constraints()
371 frmsize->step_width); in v4l2_apply_frmsize_constraints()
372 *height = clamp_roundup(*height, frmsize->min_height, frmsize->max_height, in v4l2_apply_frmsize_constraints()
373 frmsize->step_height); in v4l2_apply_frmsize_constraints()
386 return -EINVAL; in v4l2_fill_pixfmt_mp()
388 pixfmt->width = width; in v4l2_fill_pixfmt_mp()
389 pixfmt->height = height; in v4l2_fill_pixfmt_mp()
390 pixfmt->pixelformat = pixelformat; in v4l2_fill_pixfmt_mp()
391 pixfmt->num_planes = info->mem_planes; in v4l2_fill_pixfmt_mp()
393 if (info->mem_planes == 1) { in v4l2_fill_pixfmt_mp()
394 plane = &pixfmt->plane_fmt[0]; in v4l2_fill_pixfmt_mp()
395 …plane->bytesperline = ALIGN(width, v4l2_format_block_width(info, 0)) * info->bpp[0] / info->bpp_di… in v4l2_fill_pixfmt_mp()
396 plane->sizeimage = 0; in v4l2_fill_pixfmt_mp()
398 for (i = 0; i < info->comp_planes; i++) { in v4l2_fill_pixfmt_mp()
399 unsigned int hdiv = (i == 0) ? 1 : info->hdiv; in v4l2_fill_pixfmt_mp()
400 unsigned int vdiv = (i == 0) ? 1 : info->vdiv; in v4l2_fill_pixfmt_mp()
407 plane->sizeimage += info->bpp[i] * in v4l2_fill_pixfmt_mp()
409 DIV_ROUND_UP(aligned_height, vdiv) / info->bpp_div[i]; in v4l2_fill_pixfmt_mp()
412 for (i = 0; i < info->comp_planes; i++) { in v4l2_fill_pixfmt_mp()
413 unsigned int hdiv = (i == 0) ? 1 : info->hdiv; in v4l2_fill_pixfmt_mp()
414 unsigned int vdiv = (i == 0) ? 1 : info->vdiv; in v4l2_fill_pixfmt_mp()
421 plane = &pixfmt->plane_fmt[i]; in v4l2_fill_pixfmt_mp()
422 plane->bytesperline = in v4l2_fill_pixfmt_mp()
423 info->bpp[i] * DIV_ROUND_UP(aligned_width, hdiv) / info->bpp_div[i]; in v4l2_fill_pixfmt_mp()
424 plane->sizeimage = in v4l2_fill_pixfmt_mp()
425 plane->bytesperline * DIV_ROUND_UP(aligned_height, vdiv); in v4l2_fill_pixfmt_mp()
440 return -EINVAL; in v4l2_fill_pixfmt()
443 if (info->mem_planes > 1) in v4l2_fill_pixfmt()
444 return -EINVAL; in v4l2_fill_pixfmt()
446 pixfmt->width = width; in v4l2_fill_pixfmt()
447 pixfmt->height = height; in v4l2_fill_pixfmt()
448 pixfmt->pixelformat = pixelformat; in v4l2_fill_pixfmt()
449 …pixfmt->bytesperline = ALIGN(width, v4l2_format_block_width(info, 0)) * info->bpp[0] / info->bpp_d… in v4l2_fill_pixfmt()
450 pixfmt->sizeimage = 0; in v4l2_fill_pixfmt()
452 for (i = 0; i < info->comp_planes; i++) { in v4l2_fill_pixfmt()
453 unsigned int hdiv = (i == 0) ? 1 : info->hdiv; in v4l2_fill_pixfmt()
454 unsigned int vdiv = (i == 0) ? 1 : info->vdiv; in v4l2_fill_pixfmt()
461 pixfmt->sizeimage += info->bpp[i] * in v4l2_fill_pixfmt()
463 DIV_ROUND_UP(aligned_height, vdiv) / info->bpp_div[i]; in v4l2_fill_pixfmt()
484 return -ENOENT; in v4l2_get_link_freq()
489 return -ENOENT; in v4l2_get_link_freq()
493 return -ENOENT; in v4l2_get_link_freq()
503 return freq > 0 ? freq : -EINVAL; in v4l2_get_link_freq()
509 * idea here is to convert fractions such as 333333/10000000 to 1/30 using
511 * arbitrary parameters to remove non-significative terms from the simple
543 r = x - an[n] * y; in v4l2_simplify_fraction()
550 y = 1; in v4l2_simplify_fraction()
552 for (i = n; i > 0; --i) { in v4l2_simplify_fraction()
554 y = an[i-1] * y + x; in v4l2_simplify_fraction()
575 numerator/denominator >= ((u32)-1)/10000000) in v4l2_fraction_to_interval()
576 return (u32)-1; in v4l2_fraction_to_interval()
584 while (numerator > ((u32)-1)/multiplier) { in v4l2_fraction_to_interval()
605 return -ENODATA; in v4l2_link_freq_to_bitmap()
633 return -ENOENT; in v4l2_link_freq_to_bitmap()