Lines Matching defs:fmt

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