From patchwork Thu Feb 22 15:41:18 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: 204833 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp29384dyb; Thu, 22 Feb 2024 07:51:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU33pd9qkKbr61zU93BBEO/iy4W5bU5Qk2/JDJDidimXG1QmW/n0dUQVMSdjHbMfkCJGZw0Y1vUVbTf77XGOb70PoXM5w== X-Google-Smtp-Source: AGHT+IGbXI9LE7+czc+diA81D66UQOST8gzZ5RA7nVTZIzceDnXSwcnq4p6Jx9IkuSLRq+tzwrL8 X-Received: by 2002:a05:6359:4c1a:b0:17a:ce47:3986 with SMTP id kj26-20020a0563594c1a00b0017ace473986mr19346705rwc.28.1708617113055; Thu, 22 Feb 2024 07:51:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617113; cv=pass; d=google.com; s=arc-20160816; b=qATEj9x1+bT+0Rt6b+9QJZcU8kMhrMi3SUKntkqlibXSvWk+LKmiQP6RJPxal22RkS FO+cZSkvM0+8dC2XWWuZBx9rbUIEhYPGPfZB1yfs0FxtZXN3WHTyVDs3mP0DDwxH8XBY gakPFTQS3t673ZydE434XyxH5PxButwyprTHNtMoTcGeDKqbhACIzclHEO7Qi7aPkt8I db2h0HJk2Cj/re5+xUcDlvoE3MYFv4HRXVQ7n8YfRgw8iPm727gz22nvivIQ4w9W7Bt6 DDfcQhSF04U2e3jqiWnpp7qj9CoaGt92JgE+YVUXLnXcNzFDlyQed0Xmz9Da7mSWp2uL k8QQ== 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=Gg/ThM+TLiVE6WJbjtMjLEFTXXF/HE62xjrwPLpeINM=; fh=vD8tJ9d2mp7H51jNKyMUDglMjHY1Ew4hzsuiSabS+YY=; b=w7Eh2BTc7VBAPs7J21Xx7LYRIPcd4omjeNpxn2sPgoxOTbMiTx3RAftDFtBF0XIUvo IHa+ZoPtdC7fZ1qcpobURkZtuHbv7xH6E6r+1BryW67h48GWIzLyw9z1PNQ4+Y+wrAk1 51hM87HvTwDGl6zKIQzPtjntuH8grDNtS7FwIRpb0+htQGngmDxqyO/Dt4tcFjHJsc7s gGM4zqeee1IQ8/AU1eLmL9hvYJBTjxJsuP8w/N8EQ73lAhHFn0evCTElIP9fIEd2DZvI RlxLSYt3F5NmpQ6RPGtglsusWLYemev83Y2zGLz/fMEObTfME4hfPojuO5W+PI/+Ugzc Ow3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQUAk1TB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76808-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76808-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s22-20020a63af56000000b005e0b862f469si9646901pgo.158.2024.02.22.07.51.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:51:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76808-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQUAk1TB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76808-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76808-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 10670B27EE4 for ; Thu, 22 Feb 2024 15:46:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 733BF1586EE; Thu, 22 Feb 2024 15:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uQUAk1TB" 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 DCCF11586D5; Thu, 22 Feb 2024 15:42:01 +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=1708616522; cv=none; b=bmEDvI9NGB8CVt/F/8yGwpZyJiIuOan5EHsPZQNXyIongky4fI+Pet24AtPLBlDZNgOn1xdTIGG7zgHpoh7dzjJPScOXe4rQ0uDynvnGxQ5NMtxA7HK4h0+q/GG7A4RmGVl+KGRyAmKScEdGP/rHAsF8HmAWOMHGhhRrRmMpa8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708616522; c=relaxed/simple; bh=EnlDgbrVCRzMk/5nA8phcXNSHmHCcO7T/tMtxNbprvs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lm/g3KzdiDQ2eCk7BZdzTjcn8AI7cgavZR0TaXFNvGp0D0HRdJweG0SiiBxlP1HaLYQUzthXOhYEzaXXPxrKEXUK6KpNpyGp1n+l/07tgMiPQ8bXxXUDFNURDci2Vd787oI65tFKs814nRbupKKZZo6Uz1CgNJZM/MWMSZHsrn8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uQUAk1TB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DA22C43390; Thu, 22 Feb 2024 15:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708616521; bh=EnlDgbrVCRzMk/5nA8phcXNSHmHCcO7T/tMtxNbprvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uQUAk1TBgeFaNwoHocfLvos2nHMyvH2XhcOjildr5QnbcV2KxngArqmqNWBVDSjzG Rr60cmb1GL7P5guQAhUHdGl8n17FvfS14znBK6SuHtcLOmjQsLqT2VfryOM5b/Go2k qvY/6/yWtPNrJMKmilSD9hky8QFKJeipX5pfeh0Y1TbPyjeogfzMvz3m1TPJC/wIey tZPcuuf0Ae6zfvyrJZVfN8knDfILwu/d/n51eDiRcZXDk7HFoOl967jQFc5CJCRXwB DWUEHXISRfU+C9fjoVXBr8lpUtKNb83AGQLg31Gy3Prv41xtoGM9+GoekwBQvm5prS muIVquBk9yXQA== 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 10/12] media: platform: mtk-mdp3: Get fine-grain control of cmdq_pkt_finalize() Date: Thu, 22 Feb 2024 15:41:18 +0000 Message-Id: <20240222154120.16959-11-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791614897971193350 X-GMAIL-MSGID: 1791614897971193350 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 6adac857a477..b720e69b341d 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -471,7 +471,8 @@ int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param) dev_err(dev, "mdp_path_config error\n"); 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++) memcpy(&comps[i], path->comps[i].comp, diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index 94f4ed78523b..2214744c937c 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -231,6 +231,8 @@ static int mdp_probe(struct platform_device *pdev) goto err_put_scp; } + 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 7e21d226ceb8..ed61e0bb69ee 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -83,6 +83,7 @@ struct mdp_dev { u32 id_count; struct ida mdp_ida; struct cmdq_client *cmdq_clt; + u8 cmdq_shift_pa; wait_queue_head_t callback_wq; struct v4l2_device v4l2_dev;