From patchwork Thu Dec 15 12:16:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 33594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp316019wrn; Thu, 15 Dec 2022 04:18:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7RLOtD6TR3Oz9+rs1QnouDpzLkz7nMDhlcKM8rTirCgNCbeG9upXzCswSZT9IVBqfJe07y X-Received: by 2002:a17:902:ce08:b0:189:d2e4:9829 with SMTP id k8-20020a170902ce0800b00189d2e49829mr23443455plg.15.1671106737821; Thu, 15 Dec 2022 04:18:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671106737; cv=none; d=google.com; s=arc-20160816; b=HZ/jer9VhjaXzXER3nwCKTc1ghAjylY2snxjEew7jV7RMHQWlC8MZkWtdE4joXE7HU 5ApJ9yiPYEoFJTzOER7EIkOz4UQ1vumYKTEiGuf99gS9KG0abgJRwDAm+3sB1PzfDYSd 25HuZNFM9OAW8oUXERjYXbCApGwYtCPjsmrCeNRPaO+kUNHj6yL8QmjP1kiZQHepiEfp EItQV51vviANAn5KrO6Gxu4h7UaHlYS0gvDI7gBuPhfhf4TljLSjnyVZrAV3A9RiqI/F Hk+aKU9GVcKJDucb6aRmx6zdP9qNZBBEiyk8zv8ClsLUqQPAWcu98LwkA3A9tpmzZfIZ wSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+Y6IqfpHVXStAzc4AO8m2lr4lOc/W/O3q0smpM1ijis=; b=COA9CYOOZYOycZq2WFXqsB2lIlc1WTTEdlC0ZMEWorvhc/3L1/OTT9qYNNZZYjJVzI WHWLwDoacA9Q4Sf5zdlEisq71BA40JQgUhFOGt7T3bM8cgS+2RoY8rVC4qoPOB8QpsIL 85sFyoMAFUD4XJBfb/XoQlRDAuQMv8iH3B8T5dL6BFgRXKDg5ZOGK3rFQqYT5B9QErUf GLTCsMynEc8xWGkzvPPG4xf3wG/AwLaVAr60LiqcMr1QXdehkPpXbC9HH4LQaPVzNwda VBeS07OTtz24zCC5THfsw8jHyTbG9W4VdYgkqAPZr6St8jlNH6yc/IUFYZkVYMXXgzhQ JJWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=NEEBJekP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a1709026b4900b0018863e1bc39si5316984plt.248.2022.12.15.04.18.43; Thu, 15 Dec 2022 04:18:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=NEEBJekP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbiLOMRg (ORCPT + 99 others); Thu, 15 Dec 2022 07:17:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230193AbiLOMRP (ORCPT ); Thu, 15 Dec 2022 07:17:15 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAE752E9EF; Thu, 15 Dec 2022 04:17:14 -0800 (PST) Received: from desky.lan (91-154-32-225.elisa-laajakaista.fi [91.154.32.225]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9EAB118DE; Thu, 15 Dec 2022 13:17:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1671106631; bh=ymG6MvHj6boQZtL1hwOYJOSWgZFfnIzbVfrOp6foLTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NEEBJekPcn80wGL5ub7Utbig9IRrAx8Y51HF0glm9tpfjoUUIrxULyJPFXHJFRxm3 xShEykbpw6v1XJdBONlsjwXVGX46BEbZRDb/EZqpd92CAUwTodp3b3awv0knyDHPb2 MuLf06AaSN/TExct9vxYMizB9jPaB1kXlXPdtBVw= From: Tomi Valkeinen To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, sakari.ailus@linux.intel.com, Jacopo Mondi , Laurent Pinchart , niklas.soderlund+renesas@ragnatech.se, Mauro Carvalho Chehab , Hans Verkuil , satish.nagireddy@getcruise.com, Tomasz Figa Cc: Tomi Valkeinen Subject: [PATCH v16 06/20] media: subdev: Require code change to enable [GS]_ROUTING Date: Thu, 15 Dec 2022 14:16:20 +0200 Message-Id: <20221215121634.287100-7-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221215121634.287100-1-tomi.valkeinen@ideasonboard.com> References: <20221215121634.287100-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752282418679241892?= X-GMAIL-MSGID: =?utf-8?q?1752282418679241892?= Streams API is an experimental feature. To use Streams API, the user needs to change a variable in v4l2-subdev.c and recompile the kernel. This commit should be reverted when the Streams API is deemed ready for production use. Signed-off-by: Tomi Valkeinen --- drivers/media/v4l2-core/v4l2-subdev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 61b429016a2f..c31b44800e39 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -23,6 +23,13 @@ #include #include +/* + * Streams API is an experimental feature. To use Streams API, set + * 'v4l2_subdev_enable_streams_api' to 1 below. + */ + +static bool v4l2_subdev_enable_streams_api = 0; + /* * Maximum stream ID is 63 for now, as we use u64 bitmask to represent a set * of streams. @@ -751,6 +758,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, struct v4l2_subdev_routing *routing = arg; struct v4l2_subdev_krouting *krouting; + if (!v4l2_subdev_enable_streams_api) + return -ENOIOCTLCMD; + if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) return -ENOIOCTLCMD; @@ -778,6 +788,9 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg, struct v4l2_subdev_krouting krouting = {}; unsigned int i; + if (!v4l2_subdev_enable_streams_api) + return -ENOIOCTLCMD; + if (!(sd->flags & V4L2_SUBDEV_FL_STREAMS)) return -ENOIOCTLCMD;