Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp422164rdb; Thu, 22 Feb 2024 07:51:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9/3mDLNbaUTqAisYgwiCANJpg6Mgt7xjc71Pd6S18EJdrXfDwFh3uguaaXIWCof5v27POEvkiy5wdYzkATWVgh35T1Evg1Yg3+4j9ug== X-Google-Smtp-Source: AGHT+IGb08drcfwiFCwbp+jv2+8urEry1ykgzYZ9+CB71uFGXE83rn5wvP7BAlBCL1UlqlmcIrNR X-Received: by 2002:a17:90b:68e:b0:299:3e54:83f6 with SMTP id m14-20020a17090b068e00b002993e5483f6mr14576580pjz.7.1708617100279; Thu, 22 Feb 2024 07:51:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617100; cv=pass; d=google.com; s=arc-20160816; b=d2wFQ7xuK73yerQo769XKrQ63gaHwTVgYf6ewPmJs0lEpToRUx5UeMsDYtwJfK892f fvkS8bbbUf5yBz/KEpcvwywc/O4m6DAyli6v5b2M5/G/TV90NGxAporqWXZ8YwGL/2jv kkeNabTzZ/h2IxAZwlAj+EIpKrxc1z9CRIeJqMl13Ry+DFpBmI+ToA9O/LOlm2e5u1vY 4vRW7898q/LO1kqGUuL/yQSGHnB8pnxcFdWA1xs+IJj9rBA1FcWKvcUJoKH+D+mrb7KJ uoDbMXxGeaitaK3cyL1xwoSOitXa5crFoaUzR5vsPF5Hooh06QLC29Ob03gQFPEtUeSa xxoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Uy9W0eC2DM+jsJntcnJJQTqaXwEfCNzBzC9jlP8GIlk=; fh=vD8tJ9d2mp7H51jNKyMUDglMjHY1Ew4hzsuiSabS+YY=; b=SQGUiw5QGeoITw41KUKc0D6r+EOzDIcEwkxoYH8E82fMb638bYgeFVB3K39ocGTvOM LiqsDY6yWuMI2gN7keTY7GcPT30uLLdbKrKjNx86SfQ9+YF7cMje7EigRsQTakAXdWPg 9RCgVa5slESiiGn3IO4xU5lX3DP4I2gJpBT3w5n19TUZdJ6R7Juz7zA4AWAPilfehfqq ilNVylxNwYclXy79SwU6bCIOxtaZ7hFG+myrtGrR7XR9Lbtn0kZe3M9BXHTcbkpZNzGN 8eipZyfL1d5YgJj/hMJLQDQtftz46zlYIe51PzEyvHwfjAnMAlTHUcMXrsBdGCapsb+y 64JA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tiBlVyOC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76798-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id pb5-20020a17090b3c0500b0029a4fc1fdb9si1184929pjb.180.2024.02.22.07.51.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:51:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76798-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tiBlVyOC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76798-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4A449289C73 for ; Thu, 22 Feb 2024 15:42:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A50DB153515; Thu, 22 Feb 2024 15:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tiBlVyOC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4C871534F8; Thu, 22 Feb 2024 15:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708616495; cv=none; b=dnbE0XTukdQMKwQ2SSKuZQvlXuCM1HHgJxjd7URlII+HfikkXXouBeGYlaWybazL4TI79QGRLjPocW72Su337xQi6FlTh5NBmzABiDB+TvExAZ5a02IBlU97Y+RZyyzQmisSXBvz24MSIs6kymsHiFwqw6q/uqqiDTIEPvdTakI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708616495; c=relaxed/simple; bh=RuWY1cv8Dhz18Wxup/ZL/5dm4lWX9+YTDfCxalcnNUo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Elcb0XDhVdJKPCtyf8OH2MWHrGJnPgnKbF8cW/UpWWtwwwNl03R9ieCqRVzhzLYkAE5I7DLHTVffCc/PHfh9KYqA6sDZTZQu+ZDvwGFtzysATsUkPK8MRbV+hWNpkVVUNo6uTWV/Zv7XDHQvSlz2VnuYKN+qTVWg1TycCU34sXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tiBlVyOC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5700C43394; Thu, 22 Feb 2024 15:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708616495; bh=RuWY1cv8Dhz18Wxup/ZL/5dm4lWX9+YTDfCxalcnNUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tiBlVyOCYtJPgJOPH/yQz3yHhsu5izAVu0rXFmi6w6IQTdn8PtsC8zim0x2V6KkLn gFG1gOFuwAKXl+Rp3793LnwLN268Tqmd38WhnUKQL0CrQN59BgC49LbtWhMxfYs87B TAYruJfJ/809V40bGe6y4NHi/Cf8AwxlYazgBLacAuyNQDdUjXyRF22XftDqeekqjV e02JE4zBp0nyDnjUCLKau6xDlPHsswTho8YevEGNB5ABJy/T7UO8Fib5hKNBMidEha SWDtS3AHAMQfcThlt1R1u6kw9JwECb30RwkQkRwT0EfAFBVTOR1yv3cOoKHKRX5kdU pmzIdAqmVsXiw== From: Chun-Kuang Hu To: Matthias Brugger , AngeloGioacchino Del Regno , Mauro Carvalho Chehab , Moudy Ho , "Jason-JH . Lin" , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Chun-Kuang Hu Subject: [PATCH v2 02/12] soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump() Date: Thu, 22 Feb 2024 15:41:10 +0000 Message-Id: <20240222154120.16959-3-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222154120.16959-1-chunkuang.hu@kernel.org> References: <20240222154120.16959-1-chunkuang.hu@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In original design, cmdq_pkt_jump() call cmdq_get_shift_pa() every time to get shift_pa. But the shift_pa is constant value for each SoC, so client driver just need to call cmdq_get_shift_pa() once and pass shift_pa to cmdq_pkt_jump() to prevent frequent function call. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 5 ++--- include/linux/soc/mediatek/mtk-cmdq.h | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 0b2e5690dacf..3380e56dd69b 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -393,14 +393,13 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value) } EXPORT_SYMBOL(cmdq_pkt_assign); -int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr) +int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) { struct cmdq_instruction inst = {}; inst.op = CMDQ_CODE_JUMP; inst.offset = CMDQ_JUMP_ABSOLUTE; - inst.value = addr >> - cmdq_get_shift_pa(((struct cmdq_client *)pkt->cl)->chan); + inst.value = addr >> shift_pa; return cmdq_pkt_append_command(pkt, inst); } EXPORT_SYMBOL(cmdq_pkt_jump); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 649955d2cf5c..72adfd867cd9 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -253,10 +253,12 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); * a physical address which should contains more instruction. * @pkt: the CMDQ packet * @addr: physical address of target instruction buffer + * @shift_pa: shift bits of physical address in CMDQ instruction. This value + * is got by cmdq_get_shift_pa(). * * Return: 0 for success; else the error code is returned */ -int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr); +int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa); /** * cmdq_pkt_finalize() - Append EOC and jump command to pkt. @@ -374,7 +376,7 @@ static inline int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value) return -EINVAL; } -static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr) +static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) { return -EINVAL; } -- 2.34.1