Lines Matching refs:fmt

131 static char *fourcc_to_str(u32 fmt)  in fourcc_to_str()  argument
135 code[0] = (unsigned char)(fmt & 0xff); in fourcc_to_str()
136 code[1] = (unsigned char)((fmt >> 8) & 0xff); in fourcc_to_str()
137 code[2] = (unsigned char)((fmt >> 16) & 0xff); in fourcc_to_str()
138 code[3] = (unsigned char)((fmt >> 24) & 0xff); in fourcc_to_str()
152 const struct cal_fmt *fmt; in find_format_by_pix() local
156 fmt = ctx->active_fmt[k]; in find_format_by_pix()
157 if (fmt->fourcc == pixelformat) in find_format_by_pix()
158 return fmt; in find_format_by_pix()
167 const struct cal_fmt *fmt; in find_format_by_code() local
171 fmt = ctx->active_fmt[k]; in find_format_by_code()
172 if (fmt->code == code) in find_format_by_code()
173 return fmt; in find_format_by_code()
196 const struct cal_fmt *fmt; in cal_enum_fmt_vid_cap() local
201 fmt = ctx->active_fmt[f->index]; in cal_enum_fmt_vid_cap()
203 f->pixelformat = fmt->fourcc; in cal_enum_fmt_vid_cap()
209 struct v4l2_mbus_framefmt *fmt) in __subdev_get_format() argument
222 *fmt = *mbus_fmt; in __subdev_get_format()
225 fmt->width, fmt->height, fmt->code); in __subdev_get_format()
231 struct v4l2_mbus_framefmt *fmt) in __subdev_set_format() argument
239 *mbus_fmt = *fmt; in __subdev_set_format()
246 fmt->width, fmt->height, fmt->code); in __subdev_set_format()
252 const struct cal_fmt *fmt, in cal_calc_format_size() argument
257 if (!fmt) { in cal_calc_format_size()
267 max_width = MAX_WIDTH_BYTES / (ALIGN(fmt->bpp, 8) >> 3); in cal_calc_format_size()
268 v4l_bound_align_image(&f->fmt.pix.width, 48, max_width, 2, in cal_calc_format_size()
269 &f->fmt.pix.height, 32, MAX_HEIGHT_LINES, 0, 0); in cal_calc_format_size()
271 bpl = (f->fmt.pix.width * ALIGN(fmt->bpp, 8)) >> 3; in cal_calc_format_size()
272 f->fmt.pix.bytesperline = ALIGN(bpl, 16); in cal_calc_format_size()
274 f->fmt.pix.sizeimage = f->fmt.pix.height * in cal_calc_format_size()
275 f->fmt.pix.bytesperline; in cal_calc_format_size()
278 __func__, fourcc_to_str(f->fmt.pix.pixelformat), in cal_calc_format_size()
279 f->fmt.pix.width, f->fmt.pix.height, in cal_calc_format_size()
280 f->fmt.pix.bytesperline, f->fmt.pix.sizeimage); in cal_calc_format_size()
299 const struct cal_fmt *fmt; in cal_try_fmt_vid_cap() local
303 fmt = find_format_by_pix(ctx, f->fmt.pix.pixelformat); in cal_try_fmt_vid_cap()
304 if (!fmt) { in cal_try_fmt_vid_cap()
306 f->fmt.pix.pixelformat); in cal_try_fmt_vid_cap()
309 fmt = ctx->active_fmt[0]; in cal_try_fmt_vid_cap()
310 f->fmt.pix.pixelformat = fmt->fourcc; in cal_try_fmt_vid_cap()
313 f->fmt.pix.field = ctx->v_fmt.fmt.pix.field; in cal_try_fmt_vid_cap()
319 fse.code = fmt->code; in cal_try_fmt_vid_cap()
327 if ((f->fmt.pix.width == fse.max_width) && in cal_try_fmt_vid_cap()
328 (f->fmt.pix.height == fse.max_height)) { in cal_try_fmt_vid_cap()
331 } else if ((f->fmt.pix.width >= fse.min_width) && in cal_try_fmt_vid_cap()
332 (f->fmt.pix.width <= fse.max_width) && in cal_try_fmt_vid_cap()
333 (f->fmt.pix.height >= fse.min_height) && in cal_try_fmt_vid_cap()
334 (f->fmt.pix.height <= fse.max_height)) { in cal_try_fmt_vid_cap()
342 f->fmt.pix.width = ctx->v_fmt.fmt.pix.width; in cal_try_fmt_vid_cap()
343 f->fmt.pix.height = ctx->v_fmt.fmt.pix.height; in cal_try_fmt_vid_cap()
350 f->fmt.pix.colorspace = ctx->v_fmt.fmt.pix.colorspace; in cal_try_fmt_vid_cap()
351 return cal_calc_format_size(ctx, fmt, f); in cal_try_fmt_vid_cap()
359 const struct cal_fmt *fmt; in cal_s_fmt_vid_cap() local
372 fmt = find_format_by_pix(ctx, f->fmt.pix.pixelformat); in cal_s_fmt_vid_cap()
374 v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, fmt->code); in cal_s_fmt_vid_cap()
381 if (mbus_fmt.code != fmt->code) { in cal_s_fmt_vid_cap()
388 v4l2_fill_pix_format(&ctx->v_fmt.fmt.pix, &mbus_fmt); in cal_s_fmt_vid_cap()
390 ctx->v_fmt.fmt.pix.pixelformat = fmt->fourcc; in cal_s_fmt_vid_cap()
391 cal_calc_format_size(ctx, fmt, &ctx->v_fmt); in cal_s_fmt_vid_cap()
392 ctx->fmt = fmt; in cal_s_fmt_vid_cap()
403 const struct cal_fmt *fmt; in cal_enum_framesizes() local
408 fmt = find_format_by_pix(ctx, fsize->pixel_format); in cal_enum_framesizes()
409 if (!fmt) { in cal_enum_framesizes()
417 fse.code = fmt->code; in cal_enum_framesizes()
463 const struct cal_fmt *fmt; in cal_enum_frameintervals() local
472 fmt = find_format_by_pix(ctx, fival->pixel_format); in cal_enum_frameintervals()
473 if (!fmt) in cal_enum_frameintervals()
476 fie.code = fmt->code; in cal_enum_frameintervals()
532 unsigned int size = ctx->v_fmt.fmt.pix.sizeimage; in cal_queue_setup()
558 if (WARN_ON(!ctx->fmt)) in cal_buffer_prepare()
561 size = ctx->v_fmt.fmt.pix.sizeimage; in cal_buffer_prepare()
616 cal_ctx_wr_dma_config(ctx, ctx->v_fmt.fmt.pix.bytesperline, in cal_start_streaming()
617 ctx->v_fmt.fmt.pix.height); in cal_start_streaming()
621 ret = cal_camerarx_start(ctx->phy, ctx->fmt); in cal_start_streaming()
724 const struct cal_fmt *fmt; in cal_ctx_v4l2_init_formats() local
748 const struct cal_fmt *fmt = &cal_formats[k]; in cal_ctx_v4l2_init_formats() local
750 if (mbus_code.code == fmt->code) { in cal_ctx_v4l2_init_formats()
751 ctx->active_fmt[i] = fmt; in cal_ctx_v4l2_init_formats()
754 fourcc_to_str(fmt->fourcc), in cal_ctx_v4l2_init_formats()
755 fmt->code, i); in cal_ctx_v4l2_init_formats()
771 fmt = find_format_by_code(ctx, mbus_fmt.code); in cal_ctx_v4l2_init_formats()
772 if (!fmt) { in cal_ctx_v4l2_init_formats()
779 v4l2_fill_pix_format(&ctx->v_fmt.fmt.pix, &mbus_fmt); in cal_ctx_v4l2_init_formats()
781 ctx->v_fmt.fmt.pix.pixelformat = fmt->fourcc; in cal_ctx_v4l2_init_formats()
782 cal_calc_format_size(ctx, fmt, &ctx->v_fmt); in cal_ctx_v4l2_init_formats()
783 ctx->fmt = fmt; in cal_ctx_v4l2_init_formats()