Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9451131ybl; Fri, 17 Jan 2020 12:13:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxkqMNSbH87LOO6wip12cNxLnRcPsd7fVTB8tYBwFhwfsdeDQq+1bNfeSIJcIF4+j4cpxSD X-Received: by 2002:a9d:588c:: with SMTP id x12mr7232965otg.2.1579292035030; Fri, 17 Jan 2020 12:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579292035; cv=none; d=google.com; s=arc-20160816; b=tEBVhPXzlZacV6cAO527baRuRcEeOdIl/fZOKLW6HAxmQrGryvzsSP5Usz5gUY3eCP jy+hjs4unN7U1FB5rjxNWvYSvRln35kEmavZkX4z0izXaHc5ztMYv30vZ4TaMN5f9H+7 QNoNR5ddmHE4epJNPMXCjRo7rDGtJ9BROjpywvgPmhQEEN4752IXGQpbb+W/FQonvrvV zCp1YXfRHmSWo0PUkKpf9C24ujNt1fiuXJ0PTDc07alfURLWkbIkxaVnLHD3TJ0GijOP TpndGncWsZOei5zwInXu2Ik0FWQG4/78OYiS1sVRNX8Cfqbmor6AERxutxMrOSnMNDlK me5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=7oo5JjvLZJlgWuP/dNeSPQ4pa1xuEFLvIR78AsA3TMM=; b=wmVtUfNeWVnDmCUqxxXqi9ZX+oyoDY1172xJvomCcKZVhEP7Fur6xMGkbaVG6Qlfc+ /UOcQms/ehpPs2jwYbxvRdajMzIQHWW2l7tb/3qhDwkF20T7e7j4Zre0qkUEtfdZRnJr E0TL8O7HZw0sUatqU8JGFTiqSARQ6FxRJCm4vkz3XydIeSRoHBZm3a5pimstC7iYpE9g Xttm8s9V9tVTKIyEdesDk/ogsRCTdPBw5/J8hq6o8/xguc4E5//YNTi2p/g4loCM03Vl mGer+8IAyewdPrxBGpI0ChX9j/KCgQlcpX0ogedLa+UkIwYO8pLWTZdJICaBJgUn6VyB aCBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o15si14677728otp.314.2020.01.17.12.13.42; Fri, 17 Jan 2020 12:13:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729609AbgAQUMs (ORCPT + 99 others); Fri, 17 Jan 2020 15:12:48 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43530 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbgAQUMs (ORCPT ); Fri, 17 Jan 2020 15:12:48 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 84B4F293C5F From: Helen Koike To: linux-media@vger.kernel.org Cc: hverkuil-cisco@xs4all.nl, niklas.soderlund@ragnatech.se, kernel@collabora.com, laurent.pinchart@ideasonboard.com, tfiga@chromium.org, Helen Koike , Mauro Carvalho Chehab , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH] staging: media: rkisp1: make links immutable by default Date: Fri, 17 Jan 2020 17:12:18 -0300 Message-Id: <20200117201218.3745311-1-helen.koike@collabora.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only places which make sese to allow users to enable or disable links are: * between sensors and isp: So users can select which sensor should be used while streaming * between isp and the resizers: | v here rkisp1_isp:2 -> rkisp1_resizer_mainpath -> rkisp1_mainpath (capture) \-> rkisp1_resizer_selfpath -> rkisp1_selfpath (capture) ^ here | So users can disable one of the capture paths when unused, to avoid worring about matching formats. Make the following links immutable to simplify userspace: rkisp1_resizer_mainpath -> rkisp1_mainpath rkisp1_resizer_selfpath -> rkisp1_selfpath rkisp1_params -> rkisp1_isp rkisp1_isp -> rkisp1_stats Signed-off-by: Helen Koike --- This is the topology graph after disabling all the links with media -r http://col.la/rkisp1immutable Dashed links are the only one can can be enabled/disabled, the others are immutable. drivers/staging/media/rkisp1/rkisp1-dev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c index 558126e66465..4030d5e71af1 100644 --- a/drivers/staging/media/rkisp1/rkisp1-dev.c +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c @@ -145,14 +145,15 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1) flags = 0; } - flags = MEDIA_LNK_FL_ENABLED; + flags = MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE; /* create ISP->RSZ->CAP links */ for (i = 0; i < 2; i++) { source = &rkisp1->isp.sd.entity; sink = &rkisp1->resizer_devs[i].sd.entity; ret = media_create_pad_link(source, RKISP1_ISP_PAD_SOURCE_VIDEO, - sink, RKISP1_RSZ_PAD_SINK, flags); + sink, RKISP1_RSZ_PAD_SINK, + MEDIA_LNK_FL_ENABLED); if (ret) return ret; -- 2.24.0