diff mbox series

[1/4] media: ti-vpe: cal: add embedded data support

Message ID 20210427132028.1005757-2-tomi.valkeinen@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: ti-vpe: cal: multiplexed streams support | expand

Commit Message

Tomi Valkeinen April 27, 2021, 1:20 p.m. UTC
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>
---
 drivers/media/platform/ti-vpe/cal.c | 17 ++++++++++-------
 drivers/media/platform/ti-vpe/cal.h |  1 +
 2 files changed, 11 insertions(+), 7 deletions(-)

Comments

Laurent Pinchart April 29, 2021, 3:03 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Tue, Apr 27, 2021 at 04:20:25PM +0300, Tomi Valkeinen wrote:
> 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>

> ---
>  drivers/media/platform/ti-vpe/cal.c | 17 ++++++++++-------
>  drivers/media/platform/ti-vpe/cal.h |  1 +
>  2 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
> index 62c45add4efe..fcc81024ae18 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -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;
> +
> +	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;
> -	ctx->use_pix_proc = true;
> +		ctx->pix_proc = ret;
> +	}
>  
>  	return 0;
>  }
> diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
> index 42a3f8004077..29b865d1a238 100644
> --- a/drivers/media/platform/ti-vpe/cal.h
> +++ b/drivers/media/platform/ti-vpe/cal.h
> @@ -88,6 +88,7 @@ struct cal_format_info {
>  	u32	code;
>  	/* Bits per pixel */
>  	u8	bpp;
> +	bool	meta;
>  };
>  
>  /* buffer for one video frame */
diff mbox series

Patch

diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index 62c45add4efe..fcc81024ae18 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -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;
+
+	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;
-	ctx->use_pix_proc = true;
+		ctx->pix_proc = ret;
+	}
 
 	return 0;
 }
diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
index 42a3f8004077..29b865d1a238 100644
--- a/drivers/media/platform/ti-vpe/cal.h
+++ b/drivers/media/platform/ti-vpe/cal.h
@@ -88,6 +88,7 @@  struct cal_format_info {
 	u32	code;
 	/* Bits per pixel */
 	u8	bpp;
+	bool	meta;
 };
 
 /* buffer for one video frame */