Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp424139rdb; Thu, 22 Feb 2024 07:55:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXIiT7QSzoNERkP6+ko6k8+2Sa+qUA+qUUtEJXvyIGVfXRw7na4RT/H7/Y2EHMcgiuszQ7KqRno7FHzXtXFgs4V3vB2l7iiDLC+7TksCQ== X-Google-Smtp-Source: AGHT+IGEHYj/j3vZZQ5+zHzSz92FsqUGsYaRhD/lMg4Ol0GsbsIATWLc6awXyTw20EbrYwMkASZD X-Received: by 2002:a17:90a:7d13:b0:299:3550:9fda with SMTP id g19-20020a17090a7d1300b0029935509fdamr16834214pjl.6.1708617332487; Thu, 22 Feb 2024 07:55:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617332; cv=pass; d=google.com; s=arc-20160816; b=PSlb6n0EQLfUE1iCJpMnPkUbRam7sjPE7DcdVhImCWuVD7hHlkjEoTiR82GIZASWYW drdBPrZ+htCmvc6abtRYel6lQF6fmmhOJ/Jvc/BD2uQNGT6hGff/znKTuEfExs+PP6MI hElOpZTD4A1NRSlIifrnEkGoTevqzRb5BjyodQY0qsISaj4OXBnffkOxtoMQUG1qet/F ARMiYDFxNVVfGxtWZUA8bdBVprhh+YmrYeBk1/7Q54285ipT4L0bA8UXEO6UvyotCi8O qqJTzPodQA82xBhjok4KxF1xWB775wRECH531wt+WaXfPQChmDiG9NisdXZ9Lvc5ZVEc eJBQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76808-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w14-20020a17090a1b8e00b00298a01535acsi3776509pjc.105.2024.02.22.07.55.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:55:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76808-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 BD82328CB59 for ; Thu, 22 Feb 2024 15:45:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF1201586E3; Thu, 22 Feb 2024 15:42:02 +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 Content-Transfer-Encoding: 8bit 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; -- 2.34.1