From patchwork Thu Jul 4 15:49:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13723935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0D6EC41513 for ; Thu, 4 Jul 2024 15:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PpvbHu6z5zLLGHDWKceD7lbVzRAp3Vumbcxyr2sAIQI=; b=vWmPuRhzZCUmJl RUH0/I0XM6TxOVtaTxIjPeHfnSd5wEoeAeRwWrOzE9Uhl0hHhRg4XLtoSuNFzv50WMQy4SS4O1/kL HooNy2cD4IWnn0ZkVhjw1WJdChZA2tUVLDTXO7HbQEgMRphB1RM5AGesdykUYZVJ9XZathS8wiHxT j2pNJ5NjGcVObwR6U+diSQSDfFNUHsMmg+xZKFz0dpuV5I/kZB+QJELWE2W/y7HPvg1VKM6gqJhZ8 b4/eP2ZRo8aPdLLXUJyFpQWVsXgLVJfM2zI0TiwUZtwkBTqq8E/VL+TeM4K9QhcJk49zayzbhWHqP aBBmmp8e4Nwlz4p2sMQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPOif-0000000Dka2-2pTx; Thu, 04 Jul 2024 15:50:01 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPOia-0000000DkXI-3x6r for linux-rockchip@lists.infradead.org; Thu, 04 Jul 2024 15:49:59 +0000 Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D65DAA27; Thu, 4 Jul 2024 17:49:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720108166; bh=kc7rOE1SRWXqYszACekAhn3MoWNVww0rPEitfYLmnfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LH7UcE610uPFLfAB5/ZqxmL7jLTpWPt5oObqZKXqC3WIkmpZNV1LZh6IUglB04hXd UMGLgOu23sE4HGO2PdnLzrOHJ3e8EJwvF8R8/jVDhHF2PRnQC9ZpOUQzdbRFa0Tv9W jhYxyZ08D33sg7q6IZKBxuimmav5ikm+KRNBpqNc= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Dafna Hirschfeld , Jacopo Mondi , Paul Elder , linux-rockchip@lists.infradead.org Subject: [PATCH v2 2/5] media: rkisp1: Add features mask to extensible block handlers Date: Thu, 4 Jul 2024 18:49:29 +0300 Message-ID: <20240704154932.6686-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240704154932.6686-1-laurent.pinchart@ideasonboard.com> References: <20240704154932.6686-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240704_084957_139591_451C69B9 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Future ISP parameter blocks for i.MX8MP-specific features will not support on Rockchip platforms as they lack the corresponding hardware. Introduce a features mask in the extensible block handlers to indicate which device features a block require, and ignore blocks that require unavailable features. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Paul Elder --- Changes since v1: - Expand comment - Fix feature check test --- drivers/media/platform/rockchip/rkisp1/rkisp1-params.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c index c56365c7c51f..d3a7c7f55db0 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c @@ -1845,6 +1845,7 @@ static const struct rkisp1_ext_params_handler { size_t size; rkisp1_block_handler handler; unsigned int group; + unsigned int features; } rkisp1_ext_params_handlers[] = { [RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS] = { .size = sizeof(struct rkisp1_ext_params_bls_config), @@ -1951,11 +1952,18 @@ static void rkisp1_ext_params_config(struct rkisp1_params *params, &cfg->data[block_offset]; block_offset += block->header.size; - /* Make sure the block is in the list of groups to configure. */ + /* + * Make sure the block is supported by the platform and in the + * list of groups to configure. + */ block_handler = &rkisp1_ext_params_handlers[block->header.type]; if (!(block_handler->group & block_group_mask)) continue; + if ((params->rkisp1->info->features & block_handler->features) != + block_handler->features) + continue; + block_handler->handler(params, block); if (block->header.enable == RKISP1_EXT_PARAMS_BLOCK_DISABLE)