From patchwork Sat Aug 31 16:28:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 2852410 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9D7F89F313 for ; Sat, 31 Aug 2013 16:21:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DEC220278 for ; Sat, 31 Aug 2013 16:21:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52C702026F for ; Sat, 31 Aug 2013 16:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754020Ab3HaQVl (ORCPT ); Sat, 31 Aug 2013 12:21:41 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:46475 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753674Ab3HaQVl (ORCPT ); Sat, 31 Aug 2013 12:21:41 -0400 Received: from lanttu.localdomain (salottisipuli.retiisi.org.uk [IPv6:2001:1bc8:102:7fc9::83:2]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id 72D7160093; Sat, 31 Aug 2013 19:21:38 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com Subject: [PATCH v1.1 3/5] media: Pads that are not connected by even a disabled link are fine Date: Sat, 31 Aug 2013 19:28:06 +0300 Message-Id: <1377966487-22565-1-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1611138.kmhZXgyzhc@avalon> References: <1611138.kmhZXgyzhc@avalon> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not require a connected link to a pad if a pad has no links connected to it. Signed-off-by: Sakari Ailus --- Hi Laurent, This goes on top of patch 2/4. I can combine the two in the end but I think this is cleaner as a separate change. drivers/media/media-entity.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index a99396b..2ad291f 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -236,6 +236,7 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, while ((entity = media_entity_graph_walk_next(&graph))) { DECLARE_BITMAP(active, entity->num_pads); + DECLARE_BITMAP(has_no_links, entity->num_pads); unsigned int i; entity->stream_count++; @@ -250,6 +251,7 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, continue; bitmap_zero(active, entity->num_pads); + bitmap_fill(has_no_links, entity->num_pads); for (i = 0; i < entity->num_links; i++) { struct media_link *link = &entity->links[i]; @@ -257,6 +259,11 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, ? link->sink : link->source; /* + * Mark that a pad is connected by a link. + */ + bitmap_clear(has_no_links, pad->index, 1); + + /* * Pads that either do not need to connect or * are connected through an enabled link are * fine. @@ -278,6 +285,9 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, goto error; } + /* Either no links or validated links are fine. */ + bitmap_or(active, active, has_no_links, entity->num_pads); + if (!bitmap_full(active, entity->num_pads)) { ret = -EPIPE; goto error;