From patchwork Thu Feb 15 00:49:28 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: 201217 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp86163dyb; Wed, 14 Feb 2024 16:52:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwyVy7TyxrO/nlxkkxJzK3RpEmGv4EulxHPCxqA2dEnn5envODs2BVsyF0oz616prVYc48sb3f73eImOY6f8BA8OctUg== X-Google-Smtp-Source: AGHT+IFXa/YBy8uTMIgVT0EhvdJjPwvOP+jlcfcH6mCUU48nSDPQaCn6mVgKtX15GfVztszJj3t4 X-Received: by 2002:a17:906:b352:b0:a3c:eeef:2283 with SMTP id cd18-20020a170906b35200b00a3ceeef2283mr120279ejb.43.1707958342272; Wed, 14 Feb 2024 16:52:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958342; cv=pass; d=google.com; s=arc-20160816; b=0/kwZwV/zqX1VbI/rFvRADX6AWlowgQQ0qNQrvjc9a2kNp3Q/5AYQzrKTRaVs575A6 HsYdSWnxYHiXudVC+br1p5KyL053A0fwCyOj0JEWwfrK19foMsOTeF2Q2DjNOt9cf55z KYaI/edV5Kc0CrSoGbhmOzVg3GWf0rg2qw9BQGKJdV85PyjIS6oAzDazq9atSdevNTAl nfeD2IWTQnggyNQHJSaWqcZxQfKcif4bKlvzUuO/Tu/9znabwyecjcJf8EhjqvNmPVt/ 5XfBeq85hQEuNxpdhUXqbca0FsynxYAREBjlGvulyGnyK32KsAtf1IAfES8F5DFiaYlw g5WA== 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=HWhPwNVsEg/1QoH03Vp98EnAjJm6qL80DsCwBXaI3Bk=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=dDCvaJHf2hrSjLs8nplPtqUGNaRyd2xCP5U4Md3id2sI5oiZljnw9LAN5Gu06oT5dO AqS0mdDyU0HzMd1xDgdfpJZhLtnNLekPm3916Rpo3hWYz0N3G82kOIOOVoacSfpWizeB 8R90gHZ/5POzsevaCSFlzgUCG52bG2q2WhWZXFCOXkNh2t1qr9LvYgggtq18Vo9tStP5 RHvdOJRPQHOLfQHkFT1xSQ4lH61+R+c+XbNgRXqzLnV3LM3t2J5HunyqSAke77pUsjzo WWRaH6iXwkVIcLST84av9Jkg3NJDWYFYdWNSWb3zZlP7WyjoHQIxurbfTSExB1qVXzGN ueww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rdh5+2zv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66201-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66201-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y18-20020a1709060a9200b00a3d310a2683si62115ejf.663.2024.02.14.16.52.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:52:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66201-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rdh5+2zv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66201-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66201-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D0A761F22D64 for ; Thu, 15 Feb 2024 00:52:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 604E0E559; Thu, 15 Feb 2024 00:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rdh5+2zv" 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 D2D96D536; Thu, 15 Feb 2024 00:50:15 +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=1707958215; cv=none; b=BRPvZKUlmS1G+eBQCBvm1DHfzoFodY+v7werLdV0Jqc7pPFMaszDdnV+XWHqZPXRxgWUhqfVSUrHoWH1Ywj2aAhHWt3REtPdLjFSyutmLW0CXDuQlAsmzerc4DHUsYxWMWCdKtiVA9y1omUj6BeJQryOm+EHWSXMFz7D5Q7hYPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958215; c=relaxed/simple; bh=onMwpEpCvYyOOnD0Sp7hg/kBPts5AP1MXCVhCIOJE+g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FPZha2B49NQSlMpq/xRuY0p+VOhkxoqgXVffzs+oQAaDFOeZaXctK5XC8yKuQ3RbDSN3C+CmyIVTSEqez0Esz2qZ71FNUSZuG92892tWn2Wnr7hB0XsvbjhoD0YL6QXC0zMl6VtMsDpc/JNkYXh2wFT2HY4BcIZN+w8xqC6Yirs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rdh5+2zv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4BD0C433F1; Thu, 15 Feb 2024 00:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958215; bh=onMwpEpCvYyOOnD0Sp7hg/kBPts5AP1MXCVhCIOJE+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rdh5+2zvRc2LrJ6l7s6QBojxeuh17PxDFF//fFMjlTKe4GlzMFXuYgDn4SS4CeTvG Cg0jiURwzgUCaWtz4G7vDnpGmbFm7FidT01rTbFNq12U4NTJNVhi4651ZrPc48xHL1 tEz/vnnU9EIK5/w7svcP7QwcnZaP8deSPze1Zd6a1g7S2dWSPwSsAXbxX8b42+ROpJ bizzenBgdgrkXSQDrUEK1H6yOr9pFLNEDjKhBxuHf0+vhbK4hB56nI3tEA0SbKC6UV bniF2OQ4FkCupI0d7WX3Ax/2s9V3VGLUmRVzs78rz8LR3Qb0U/i37izMdpnfUb4d9X 8hp6oNK359O0A== From: Chun-Kuang Hu To: Matthias Brugger , AngeloGioacchino Del Regno , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Chun-Kuang Hu Subject: [PATCH 6/9] media: platform: mtk-mdp3: drop calling cmdq_pkt_finalize() Date: Thu, 15 Feb 2024 00:49:28 +0000 Message-Id: <20240215004931.3808-7-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215004931.3808-1-chunkuang.hu@kernel.org> References: <20240215004931.3808-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: 1790924126785566782 X-GMAIL-MSGID: 1790924126785566782 Because client driver has the information of struct cmdq_client, so it's not necessary to store struct cmdq_client in struct cmdq_pkt. cmdq_pkt_finalize() use struct cmdq_client in struct cmdq_pkt, so it's going to be abandoned. Therefore, use cmdq_pkt_eoc() and cmdq_pkt_nop() 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..a420d492d879 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_nop(&cmd->pkt, 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;