diff options
-rw-r--r-- | isp/omap3isp.c | 25 |
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; |