From f77136733b0bce4444b4e4fc852d3fd837d15446 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 23 Oct 2012 04:12:56 +0200 Subject: 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 --- isp/omap3isp.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'isp/omap3isp.c') 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; -- cgit v1.2.3