From patchwork Thu Feb 15 00:49:31 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: 201228 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp96512dyb; Wed, 14 Feb 2024 17:15:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhoG3r6uUo6VtxaOz1+jesCJaL5RiATfuY8C97QondFRnNaw20QWuo8cI3eo2nlz4JunRnKuBavV947DpZCbe9Uc0dKA== X-Google-Smtp-Source: AGHT+IGj28QNDopxJ4rcnW/RrYEvrPEz24SxIt/F+1CbASYzbO1JX/udu4gb8A3ebDF+fTN5R0kO X-Received: by 2002:a05:6830:438b:b0:6e1:377e:c413 with SMTP id s11-20020a056830438b00b006e1377ec413mr331197otv.27.1707959712807; Wed, 14 Feb 2024 17:15:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707959712; cv=pass; d=google.com; s=arc-20160816; b=fxO7a54qFRKpXT2Pe5x/ZjwdOQ8cE54hoLm2brgjePJpkE/+E5DjzO5w6sWOaxC8jg yyJM+H/U73ea67zNdcSxHw5aX89BtEXTloEIyo56Akm/CUPzBW29iE2t3J3Nr+7yBk7S 5XOSGrWbXA+gG9XkagEPwUyvzdjioFjsg92jwj9pOcU5T3o3UMns5ikeoWIrskz2kUDr hVA4adBuURXDokEBOikQLKc/aEEbYIIaVdFPm9LP7OVwAwqpVuW3ZqcO8Av58eaRwrLm pK1/DrBL4Au2slM2Zm4xcvwX9STt60kqZq4TjrOSFZkw5ywSi5sw6AfxQvN3Hbm9UdrY 2VOw== 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=I/kGTTkBNPrJCHYkMUusHdDnrTmca1yjn2qBOierNbU=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=UJpXMYtOvpgCAZyxjKpqWZU+z4z+D+QEl8Oud48R8YWelTp8s7vTdiM54m/iZYwkQO IalUHFpeb8HH35kWuKnNj4AHV6MtPN0E3lbFRn8saZskpru+I1YgRwkGK7pCopGpavJ+ +k9SQELP1DCzrxJvlw7mw0UGOKuKJgZXRvWeuhtdFmYIdIJ8OCmeUxlR+eubI6FJ4HkA M0wH47NI+gjtfkP7WAvRGACR3c82ZoUInqeroBdhhm72q7oApbQ1uElOE57RuxSgjuyu pS9PfeKt7t7o0icQayFRJlTTcdLFbTjz81W3UR6baBxwe5e77iYhX+hZIEKcNTKta6fu PgEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sA9i2nL5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66204-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66204-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. [147.75.48.161]) by mx.google.com with ESMTPS id b28-20020a63715c000000b005d96d182c41si119234pgn.490.2024.02.14.17.15.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66204-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sA9i2nL5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66204-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66204-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 2E57FB2109D for ; Thu, 15 Feb 2024 00:52:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AF891400F; Thu, 15 Feb 2024 00:50:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sA9i2nL5" 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 EB82F17C9; Thu, 15 Feb 2024 00:50:22 +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=1707958223; cv=none; b=cDxAu97ObkaHDUN4DJkDtvEmTs0EPXVhh/1SMfk76KxDVg6WkiN6dHJGBI/JdQdp6mmZtoIs7Ow5ojV16vpUriLX3OGESzokjDKcMCCAuPS3ZdGSXgE90LualFw62LclULK3K/NA0KM+HUkkHLgTiIsMl/J3ynuca+70E9D2XXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958223; c=relaxed/simple; bh=Nd1NDjS7PBGCZG08y1pbAZotjpMonshTocV35vaQvPk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ReuxusgrJGmRxvNPcCwP69frpM4sIE+ZSrhEHTE7qu7b8fq5WHFJBV+TrWmap4NeU2LP+bSdLKthMzX5bdPCfsSyztIyUPOYiqQDCHpU9vC0RpjR7tqxGA7ud7Ilhaqxe7uOUTNflAQ7u5KgRgGs1aQRAvPerHx6IEmWoAu8F6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sA9i2nL5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3104C43390; Thu, 15 Feb 2024 00:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958222; bh=Nd1NDjS7PBGCZG08y1pbAZotjpMonshTocV35vaQvPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sA9i2nL58Za9xrOfR+gqXKLVZ0NKkmamnkgCtT0P5X4TWIOo6ibmYISUE7llg9e+u tuCatNrBIrc6+xUJfvduqvXb2nBh0JUYUq2BWQlA4FzjD1bMRLelrwrrTWPmEpWNLK bYN+RU6kIpY5wdWugtL3RfkFhThv/2LMw1ZrO2+iao7mk0JT8t4mdZ8rn9ANWMW0aI eiVdeCSWceN6PO5VZSK7X77B7ZTAYKrmV+OYbPbGl1VcQv1sxoVnJ38OUBET1ZRcSX ewu0//pYNU77x6grOglmUCuv+FYRUODlSfu4xvn24rvLrtDSVbEFee1m7YbLXzFmIw 4vO8WodC74HXw== 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 9/9] media: platform: mtk-mdp3: do not store struct cmdq_client in struct cmdq_pkt Date: Thu, 15 Feb 2024 00:49:31 +0000 Message-Id: <20240215004931.3808-10-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: 1790925563856319753 X-GMAIL-MSGID: 1790925563856319753 MediaTek mdp3 driver has the struct cmdq_client information, so it's not necessary to store struct cmdq_client in struct cmdq_pkt. Signed-off-by: Chun-Kuang Hu --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index a420d492d879..6aa32ab018b4 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -298,7 +298,6 @@ static int mdp_cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, return -ENOMEM; pkt->buf_size = size; - pkt->cl = (void *)client; dev = client->chan->mbox->dev; dma_addr = dma_map_single(dev, pkt->va_base, pkt->buf_size, @@ -314,10 +313,8 @@ static int mdp_cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, return 0; } -static void mdp_cmdq_pkt_destroy(struct cmdq_pkt *pkt) +static void mdp_cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt) { - struct cmdq_client *client = (struct cmdq_client *)pkt->cl; - dma_unmap_single(client->chan->mbox->dev, pkt->pa_base, pkt->buf_size, DMA_TO_DEVICE); kfree(pkt->va_base); @@ -341,7 +338,7 @@ static void mdp_auto_release_work(struct work_struct *work) atomic_dec(&mdp->job_count); wake_up(&mdp->callback_wq); - mdp_cmdq_pkt_destroy(&cmd->pkt); + mdp_cmdq_pkt_destroy(mdp->cmdq_clt, &cmd->pkt); kfree(cmd->comps); cmd->comps = NULL; kfree(cmd); @@ -388,7 +385,7 @@ static void mdp_handle_cmdq_callback(struct mbox_client *cl, void *mssg) atomic_dec(&mdp->job_count); wake_up(&mdp->callback_wq); - mdp_cmdq_pkt_destroy(&cmd->pkt); + mdp_cmdq_pkt_destroy(mdp->cmdq_clt, &cmd->pkt); kfree(cmd->comps); cmd->comps = NULL; kfree(cmd); @@ -513,7 +510,7 @@ int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param) err_free_comps: kfree(comps); err_destroy_pkt: - mdp_cmdq_pkt_destroy(&cmd->pkt); + mdp_cmdq_pkt_destroy(mdp->cmdq_clt, &cmd->pkt); err_free_cmd: kfree(cmd); err_cancel_job: