From patchwork Sat Nov 20 12:05:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Cohen X-Patchwork-Id: 4993 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Sat, 20 Nov 2010 10:06:06 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PJmCk-0004xd-FN for mchehab@gaivota; Sat, 20 Nov 2010 10:06:06 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Sat, 20 Nov 2010 10:06:06 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PJmBE-0005W8-Ke; Sat, 20 Nov 2010 12:04:32 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653Ab0KTMEa (ORCPT + 1 other); Sat, 20 Nov 2010 07:04:30 -0500 Received: from smtp.nokia.com ([147.243.128.24]:34876 "EHLO mgw-da01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752587Ab0KTME3 (ORCPT ); Sat, 20 Nov 2010 07:04:29 -0500 Received: from nokia.com (localhost [127.0.0.1]) by mgw-da01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id oAKC4RaP019676; Sat, 20 Nov 2010 14:04:28 +0200 Received: from esdhcp04381.research.nokia.com ([esdhcp040180.research.nokia.com [172.21.40.180]]) by mgw-da01.nokia.com with RELAY id oAKC3ujW019048 ; Sat, 20 Nov 2010 14:03:59 +0200 From: David Cohen To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, lane@brooks.nu, "Cohen David (Nokia-MS/Helsinki)" Subject: [omap3isp][PATCH v2] omap3isp: does not allow pipeline with multiple video outputs yet Date: Sat, 20 Nov 2010 14:05:03 +0200 Message-Id: <1290254703-20357-1-git-send-email-david.cohen@nokia.com> X-Mailer: git-send-email 1.7.2.3 X-Nokia-AV: Clean Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab From: Cohen David (Nokia-MS/Helsinki) The ISP core doesn't support pipelines with multiple video outputs. Revisit this when it will be implemented, and return -EBUSY for now. Signed-off-by: David Cohen --- drivers/media/video/isp/ispccdc.c | 26 ++++++++++++++++++++------ drivers/media/video/isp/ispcsi2.c | 19 +++++++++++++++---- drivers/media/video/isp/isppreview.c | 19 +++++++++++++++---- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c index 2541c92..6cca5ce 100644 --- a/drivers/media/video/isp/ispccdc.c +++ b/drivers/media/video/isp/ispccdc.c @@ -2018,30 +2018,44 @@ static int ccdc_link_setup(struct media_entity *entity, break; + /* + * This driver currently does not support pipeline with multiples + * video outputs. It must return -EBUSY while it's not implemented. + */ + case CCDC_PAD_SOURCE_VP | (MEDIA_ENTITY_TYPE_SUBDEV << 16): /* Write to preview engine, histogram and H3A. When none of * those links are active, the video port can be disabled. */ - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (ccdc->output & ~CCDC_OUTPUT_PREVIEW) + return -EBUSY; ccdc->output |= CCDC_OUTPUT_PREVIEW; - else + } else { ccdc->output &= ~CCDC_OUTPUT_PREVIEW; + } break; case CCDC_PAD_SOURCE_OF | (MEDIA_ENTITY_TYPE_NODE << 16): /* Write to memory */ - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (ccdc->output & ~CCDC_OUTPUT_MEMORY) + return -EBUSY; ccdc->output |= CCDC_OUTPUT_MEMORY; - else + } else { ccdc->output &= ~CCDC_OUTPUT_MEMORY; + } break; case CCDC_PAD_SOURCE_OF | (MEDIA_ENTITY_TYPE_SUBDEV << 16): /* Write to resizer */ - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (ccdc->output & ~CCDC_OUTPUT_RESIZER) + return -EBUSY; ccdc->output |= CCDC_OUTPUT_RESIZER; - else + } else { ccdc->output &= ~CCDC_OUTPUT_RESIZER; + } break; default: diff --git a/drivers/media/video/isp/ispcsi2.c b/drivers/media/video/isp/ispcsi2.c index a94c1ec..ddf485b 100644 --- a/drivers/media/video/isp/ispcsi2.c +++ b/drivers/media/video/isp/ispcsi2.c @@ -1046,19 +1046,30 @@ static int csi2_link_setup(struct media_entity *entity, struct isp_csi2_device *csi2 = v4l2_get_subdevdata(sd); struct isp_csi2_ctrl_cfg *ctrl = &csi2->ctrl; + /* + * This driver currently does not support pipeline with multiples + * video outputs. It must return -EBUSY while it's not implemented. + */ + switch (local->index | (remote->entity->type << 16)) { case CSI2_PAD_SOURCE | (MEDIA_ENTITY_TYPE_NODE << 16): - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (csi2->output & ~CSI2_OUTPUT_MEMORY) + return -EBUSY; csi2->output |= CSI2_OUTPUT_MEMORY; - else + } else { csi2->output &= ~CSI2_OUTPUT_MEMORY; + } break; case CSI2_PAD_SOURCE | (MEDIA_ENTITY_TYPE_SUBDEV << 16): - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (csi2->output & ~CSI2_OUTPUT_CCDC) + return -EBUSY; csi2->output |= CSI2_OUTPUT_CCDC; - else + } else { csi2->output &= ~CSI2_OUTPUT_CCDC; + } break; default: diff --git a/drivers/media/video/isp/isppreview.c b/drivers/media/video/isp/isppreview.c index 8da0de1..55f2bf4 100644 --- a/drivers/media/video/isp/isppreview.c +++ b/drivers/media/video/isp/isppreview.c @@ -2013,20 +2013,31 @@ static int preview_link_setup(struct media_entity *entity, } break; + /* + * This driver currently does not support pipeline with multiples + * video outputs. It must return -EBUSY while it's not implemented. + */ + case PREV_PAD_SOURCE | (MEDIA_ENTITY_TYPE_NODE << 16): /* write to memory */ - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (prev->output & ~PREVIEW_OUTPUT_MEMORY) + return -EBUSY; prev->output |= PREVIEW_OUTPUT_MEMORY; - else + } else { prev->output &= ~PREVIEW_OUTPUT_MEMORY; + } break; case PREV_PAD_SOURCE | (MEDIA_ENTITY_TYPE_SUBDEV << 16): /* write to resizer */ - if (flags & MEDIA_LINK_FLAG_ACTIVE) + if (flags & MEDIA_LINK_FLAG_ACTIVE) { + if (prev->output & ~PREVIEW_OUTPUT_RESIZER) + return -EBUSY; prev->output |= PREVIEW_OUTPUT_RESIZER; - else + } else { prev->output &= ~PREVIEW_OUTPUT_RESIZER; + } break; default: