OSDN Git Service

media: ti-vpe: cal: add embedded data support
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 14 Jun 2021 11:23:45 +0000 (13:23 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 12 Jul 2021 12:22:11 +0000 (14:22 +0200)
Add support for capturing embedded data from the sensor. The only
difference with capturing pixel data and embedded data is that we need
to ensure the PIX PROC is disabled for embedded data so that CAL doesn't
repack the data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti-vpe/cal.c
drivers/media/platform/ti-vpe/cal.h

index cce627c..05bdc6d 100644 (file)
@@ -473,14 +473,17 @@ int cal_ctx_prepare(struct cal_ctx *ctx)
 {
        int ret;
 
-       ret = cal_reserve_pix_proc(ctx->cal);
-       if (ret < 0) {
-               ctx_err(ctx, "Failed to reserve pix proc: %d\n", ret);
-               return ret;
-       }
+       ctx->use_pix_proc = !ctx->fmtinfo->meta;
 
-       ctx->pix_proc = ret;
-       ctx->use_pix_proc = true;
+       if (ctx->use_pix_proc) {
+               ret = cal_reserve_pix_proc(ctx->cal);
+               if (ret < 0) {
+                       ctx_err(ctx, "Failed to reserve pix proc: %d\n", ret);
+                       return ret;
+               }
+
+               ctx->pix_proc = ret;
+       }
 
        return 0;
 }
index d3e89d2..527e22d 100644 (file)
@@ -88,6 +88,7 @@ struct cal_format_info {
        u32     code;
        /* Bits per pixel */
        u8      bpp;
+       bool    meta;
 };
 
 /* buffer for one video frame */