summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-10-23 04:12:56 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-03-07 22:48:40 +0100
commitf77136733b0bce4444b4e4fc852d3fd837d15446 (patch)
tree830c64c3e3870a6e2615424136c3759dfd9e8ab9
parent7171e8263fada3f37d955ec538c58ebb73d02b38 (diff)
isp: Support format conversion in scaler
Include the preview engine in the scaler pipeline if the requested input format is not a YUV format. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--isp/omap3isp.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/isp/omap3isp.c b/isp/omap3isp.c
index 6a9bfa5..9f4d7d5 100644
--- a/isp/omap3isp.c
+++ b/isp/omap3isp.c
@@ -35,6 +35,7 @@
#define ENTITY_CCDC "OMAP3 ISP CCDC"
#define ENTITY_CCDC_OUTPUT "OMAP3 ISP CCDC output"
+#define ENTITY_PREVIEW_INPUT "OMAP3 ISP preview input"
#define ENTITY_PREVIEW "OMAP3 ISP preview"
#define ENTITY_RESIZER "OMAP3 ISP resizer"
#define ENTITY_RESIZER_INPUT "OMAP3 ISP resizer input"
@@ -1535,9 +1536,27 @@ int omap3_isp_scaler_setup(struct omap3_isp_device *isp,
struct v4l2_mbus_framefmt __ofmt;
int ret;
- ret = omap3_isp_pipeline_build(isp, &isp->scaler, ENTITY_RESIZER_INPUT,
- ENTITY_RESIZER, ENTITY_RESIZER_OUTPUT,
- NULL);
+ /* Build the pipeline. Include the preview engine if the input format is
+ * not a YUV format.
+ */
+ switch (ifmt->code) {
+ case V4L2_MBUS_FMT_UYVY8_1X16:
+ case V4L2_MBUS_FMT_YUYV8_1X16:
+ ret = omap3_isp_pipeline_build(isp, &isp->scaler,
+ ENTITY_RESIZER_INPUT,
+ ENTITY_RESIZER,
+ ENTITY_RESIZER_OUTPUT,
+ NULL);
+ break;
+ default:
+ ret = omap3_isp_pipeline_build(isp, &isp->scaler,
+ ENTITY_PREVIEW_INPUT,
+ ENTITY_PREVIEW, ENTITY_RESIZER,
+ ENTITY_RESIZER_OUTPUT,
+ NULL);
+ break;
+ }
+
if (ret < 0) {
printf("error: unable to build scaler pipeline (%d)\n", ret);
return ret;