All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Benoit Parrot <bparrot@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Pratyush Yadav <p.yadav@ti.com>,
	Lokesh Vutla <lokeshvutla@ti.com>,
	linux-media@vger.kernel.org
Cc: sakari.ailus@linux.intel.com,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Subject: [PATCH 1/4] media: ti-vpe: cal: add embedded data support
Date: Tue, 27 Apr 2021 16:20:25 +0300	[thread overview]
Message-ID: <20210427132028.1005757-2-tomi.valkeinen@ideasonboard.com> (raw)
In-Reply-To: <20210427132028.1005757-1-tomi.valkeinen@ideasonboard.com>

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(-)

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 */
-- 
2.25.1


  reply	other threads:[~2021-04-27 13:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 13:20 [PATCH 0/4] media: ti-vpe: cal: multiplexed streams support Tomi Valkeinen
2021-04-27 13:20 ` Tomi Valkeinen [this message]
2021-04-29  3:03   ` [PATCH 1/4] media: ti-vpe: cal: add embedded data support Laurent Pinchart
2021-04-27 13:20 ` [PATCH 2/4] media: ti-vpe: cal: use frame desc to get vc and dt Tomi Valkeinen
2021-04-29  3:14   ` Laurent Pinchart
2021-04-27 13:20 ` [PATCH 3/4] media: ti-vpe: cal: add routing support Tomi Valkeinen
2021-04-29  3:27   ` Laurent Pinchart
2021-04-29  3:49     ` Laurent Pinchart
2021-04-27 13:20 ` [PATCH 4/4] media: ti-vpe: cal: add multiplexed streams support Tomi Valkeinen
2021-04-29  3:53 ` [PATCH 0/4] media: ti-vpe: cal: " Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210427132028.1005757-2-tomi.valkeinen@ideasonboard.com \
    --to=tomi.valkeinen@ideasonboard.com \
    --cc=bparrot@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=p.yadav@ti.com \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.