From patchwork Sat Aug 10 09:09:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Kuang Hu X-Patchwork-Id: 818347 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 B1A7715749A; Sat, 10 Aug 2024 09:09:36 +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=1723280976; cv=none; b=j2JoMB5MKY1jOocxugm9OzdPRGsvkHgmovLUJ42F6Fb1gtDwgUTkG+DQaXQwsal4Oc5k5m+IjML55UXQg68UAIdhNiqGmRLd0JflDSLVyUNiIJ9RlKhrPTOu7F1d2Zbp2EReGyLLmCi6Ld62fXYlT8MS4OU7LfoMuAVfd5UVTt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723280976; c=relaxed/simple; bh=u4qlRZ2eV0ZOdvBBZQ2siEBLpxLioWPrDZ4+vm8xMBo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gKgOAsmq2rANMb6WhYnrSMkC0Rn0VHkdWaT7KX/Y4k6jBL6WeHCgcL03Sx70I8O2slMKh0CZ0Hw2yyg7ExPjpGxiMrCVrZrlMC1N5fMyg2ea6NIWkSuz7Fb1Fwny8AaxZD4RZdqPVvu6wsX9OGkQJu1noOPhBwThsLJJovZ1PGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j2iKqV1u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j2iKqV1u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D7D6C4AF0F; Sat, 10 Aug 2024 09:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723280976; bh=u4qlRZ2eV0ZOdvBBZQ2siEBLpxLioWPrDZ4+vm8xMBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j2iKqV1u/46W7Ll5iVnbj44tPB9aP3U/pkayBcXBilA5DSOhp6yLEOuT+oWxsym1O 4NRDySkxhwsDdu5ywRioQVnXTrdVBV3C/Y9RbrxxqSVTa9NM2fUPcNj7qoLniNmjFv qiJwyM91x3vDEqvgnQeWE1hxIenCcLN2+2WK66Okaf8qlZbYfyZ7WESjZXsLnTdoM5 H0VkU8CD6zBKI4NNUP1GUf3ovM6pfwOIbsSNtUA8ax4zdaFr9ytWVPnqBdObFls1NN 02aPbPUh27JR+HOMNPX7lT/XKfmZGZPzz5yP7EpJ35qB99tX3kEIwJCf2V7iN8VEnN K2CHc0aS1qGew== 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 v3 3/5] media: platform: mtk-mdp3: Get fine-grain control of cmdq_pkt_finalize() Date: Sat, 10 Aug 2024 09:09:16 +0000 Message-Id: <20240810090918.7457-4-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240810090918.7457-1-chunkuang.hu@kernel.org> References: <20240810090918.7457-1-chunkuang.hu@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In order to have fine-grained control, use cmdq_pkt_eoc() and cmdq_pkt_jump_rel() to replace cmdq_pkt_finalize(). Signed-off-by: Chun-Kuang Hu --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 3 ++- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 ++ drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index ea2ea119dd2a..0cddafedbecc 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -676,7 +676,8 @@ static struct mdp_cmdq_cmd *mdp_cmdq_prepare(struct mdp_dev *mdp, dev_err(dev, "mdp_path_config error %d\n", pp_idx); goto err_free_path; } - cmdq_pkt_finalize(&cmd->pkt); + cmdq_pkt_eoc(&cmd->pkt); + cmdq_pkt_jump_rel(&cmd->pkt, CMDQ_INST_SIZE, mdp->cmdq_shift_pa); for (i = 0; i < num_comp; i++) { s32 inner_id = MDP_COMP_NONE; diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 37e7b985d52c..22b0aafccb85 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -314,6 +314,8 @@ static int mdp_probe(struct platform_device *pdev) } } + mdp->cmdq_shift_pa = cmdq_get_shift_pa(mdp->cmdq_clt->chan); + init_waitqueue_head(&mdp->callback_wq); ida_init(&mdp->mdp_ida); platform_set_drvdata(pdev, mdp); diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h index 430251f63754..78c87c4eaba9 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -126,6 +126,7 @@ struct mdp_dev { u32 id_count; struct ida mdp_ida; struct cmdq_client *cmdq_clt[MDP_PP_MAX]; + u8 cmdq_shift_pa; wait_queue_head_t callback_wq; struct v4l2_device v4l2_dev;