From patchwork Thu Feb 15 00:49:23 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: 201222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp95024dyb; Wed, 14 Feb 2024 17:11:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxL+a8IAGNtyDyerp6V6PVBxBfPnbOgr59r1UbArlR3xL7a+LpKrAbycojyf4x/f98SKmyfBOx9Ujb198WiBrVPH+MXA== X-Google-Smtp-Source: AGHT+IFIXIGupY4npRXio85VKAyv8N9zjpIaibpiRJGzsO+4ceXtdnZhqHx+tmF0M3SQVWsHx/8B X-Received: by 2002:a17:902:d4c1:b0:1da:232:df37 with SMTP id o1-20020a170902d4c100b001da0232df37mr439661plg.36.1707959502109; Wed, 14 Feb 2024 17:11:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707959502; cv=pass; d=google.com; s=arc-20160816; b=ZDolHuQDeg9ChA8fymDViM/kpql7sHNygYWoRb7MSZQOsXzZC+rSLO4zJyL2mY+9eb AVshkNSENxtcdQEJDIrsMXyheOww8SQwtwce2igjOocRc3ZTcE61grgsQACZifGIC5Iq iZliB9OeCBep1u2JBge2vG+PUaOMacRCLe4MyzvUu8jng77g7Kl34nglPAhcgm1Ey1d4 RFJqblaqjrt4iMBqq66S965bq6dE6L8XEZY9Ay0VI+eKnepK0GjD//LFqlipoku43dJg N7hyAGLZvGAPNsVTj+dN0mcd/dWjdZPTRZTxo9Yf7anUfLyvm8tkjcczx6zWtwMSdRdP mm+Q== 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=TZGzN7ubTR177376omnKYws6LluzZVJncHmcsyGwrDg=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=fBDjRVrTWWJYypThuVf5I3qOwDJw1HgvhUnB47so6F5kG9oo+gP9QQcybuJ1QYicQ4 72HVb/g+nzJNSUGPDUreMukiJ6M9+VhAWPEJSupz9sqN9qmCmyJ+tDzg1o5xZl8NS0HF Hs+xjnuPNScx1gV9TsRpJrTT3wdlt9HKcN67D6gSIqp8OKRolEjo6B5iTmxDJhAumZe9 mC4qa8EsCbMLoJ3W4p+OI7EGk85OG1DFyoSJAyCtd3lPnbyY8VUwCt4a/5XlZ+n+nDAE thBt1gyPi38aMoBjdNBP5NKb1h6PiQ5rOAKRLQUDLeTxeHjmO8tWlY2FImQ0/Y9sLRVN SddA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ag2V3tuA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66196-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66196-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 lw16-20020a1709032ad000b001db45a4224dsi117718plb.601.2024.02.14.17.11.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:11:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66196-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=Ag2V3tuA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66196-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66196-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 04D35B27B19 for ; Thu, 15 Feb 2024 00:50:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B8174A07; Thu, 15 Feb 2024 00:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ag2V3tuA" 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 6903315D1; Thu, 15 Feb 2024 00:50:04 +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=1707958204; cv=none; b=ravJYCQkEK+x9V4zYyVSAMIxlpQgneWgXPTVpHMIgoSypbf5hivSTy6tGoVICwYunlMLRtCvQGTJ1BItA3nCJQyN1l+3C47PB4Tre2EoMXqrihRNs6RBcyx+I/DFYPTgfBt8U+kV8/SYd2pCpIoWXJgwrWLfar1Hc9+kCDZV/HQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958204; c=relaxed/simple; bh=oUOUUVVZ6ZE4H6VaL1Zw1wSnRwLVun/8c8sWOEB2D/g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m0SUTkOf64dszpqc1WObep/mLRHShfVm7jUG2YHYd3uWXARAhWvd9rnk1mlHw0LPIU8mQSiWQg8bsaHCAK9ceC5dpATUYxYEOvMIimQvYI9/xVua77NGdBs2sxbA4CUaKRo7DYgDP79R86pBNxCCmW+c1PNVzZd95hg2TPzLZiE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ag2V3tuA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3283C433C7; Thu, 15 Feb 2024 00:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958203; bh=oUOUUVVZ6ZE4H6VaL1Zw1wSnRwLVun/8c8sWOEB2D/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ag2V3tuALPT3VgSFUAo0/klHrjQ1WrIxAcOnBaBzhTzZNXXmzIBi8I57TIRA+X+f6 DZ4WhHkUDXfc9y+xKp8iuiAK3VRfZoWcd5vdiBzBlxguWE/Mi1WBf06pLgdFHZXME5 fMdHBlzoNgRzeNGcbWJH305rIsF4lhWzo6GUAoT6ZLLZx1QMVxNeXCHSheR/LEieWj qXowmJgTqmuADgl3uczYo9+kOUVGepiC+M2XGGG+ntsuCdgM4FOBy+KK5hHrebpFTE MN1qK1AdRLMQkLsvVVljZAbgOfW8kiPU1MesybPiIgXTwXAqIA0YOZ+RMrrqIsHq1j cpskpba95MXew== 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 1/9] soc: mediatek: cmdq: Remove unused helper funciton Date: Thu, 15 Feb 2024 00:49:23 +0000 Message-Id: <20240215004931.3808-2-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: 1790925342711789712 X-GMAIL-MSGID: 1790925342711789712 cmdq_pkt_create(), cmdq_pkt_destroy(), and cmdq_pkt_flush_async() are not used by all client drivers (MediaTek drm driver and MediaTek mdp3 driver), so remove them. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 59 -------------------------- include/linux/soc/mediatek/mtk-cmdq.h | 40 ----------------- 2 files changed, 99 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index b0cd071c4719..67e17974d1e6 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -105,50 +105,6 @@ void cmdq_mbox_destroy(struct cmdq_client *client) } EXPORT_SYMBOL(cmdq_mbox_destroy); -struct cmdq_pkt *cmdq_pkt_create(struct cmdq_client *client, size_t size) -{ - struct cmdq_pkt *pkt; - struct device *dev; - dma_addr_t dma_addr; - - pkt = kzalloc(sizeof(*pkt), GFP_KERNEL); - if (!pkt) - return ERR_PTR(-ENOMEM); - pkt->va_base = kzalloc(size, GFP_KERNEL); - if (!pkt->va_base) { - kfree(pkt); - return ERR_PTR(-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, - DMA_TO_DEVICE); - if (dma_mapping_error(dev, dma_addr)) { - dev_err(dev, "dma map failed, size=%u\n", (u32)(u64)size); - kfree(pkt->va_base); - kfree(pkt); - return ERR_PTR(-ENOMEM); - } - - pkt->pa_base = dma_addr; - - return pkt; -} -EXPORT_SYMBOL(cmdq_pkt_create); - -void cmdq_pkt_destroy(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); - kfree(pkt); -} -EXPORT_SYMBOL(cmdq_pkt_destroy); - static int cmdq_pkt_append_command(struct cmdq_pkt *pkt, struct cmdq_instruction inst) { @@ -426,19 +382,4 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt) } EXPORT_SYMBOL(cmdq_pkt_finalize); -int cmdq_pkt_flush_async(struct cmdq_pkt *pkt) -{ - int err; - struct cmdq_client *client = (struct cmdq_client *)pkt->cl; - - err = mbox_send_message(client->chan, pkt); - if (err < 0) - return err; - /* We can send next packet immediately, so just call txdone. */ - mbox_client_txdone(client->chan, 0); - - return 0; -} -EXPORT_SYMBOL(cmdq_pkt_flush_async); - MODULE_LICENSE("GPL v2"); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 649955d2cf5c..6c42d817d368 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -59,21 +59,6 @@ struct cmdq_client *cmdq_mbox_create(struct device *dev, int index); */ void cmdq_mbox_destroy(struct cmdq_client *client); -/** - * cmdq_pkt_create() - create a CMDQ packet - * @client: the CMDQ mailbox client - * @size: required CMDQ buffer size - * - * Return: CMDQ packet pointer - */ -struct cmdq_pkt *cmdq_pkt_create(struct cmdq_client *client, size_t size); - -/** - * cmdq_pkt_destroy() - destroy the CMDQ packet - * @pkt: the CMDQ packet - */ -void cmdq_pkt_destroy(struct cmdq_pkt *pkt); - /** * cmdq_pkt_write() - append write command to the CMDQ packet * @pkt: the CMDQ packet @@ -266,19 +251,6 @@ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr); */ int cmdq_pkt_finalize(struct cmdq_pkt *pkt); -/** - * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ - * packet and call back at the end of done packet - * @pkt: the CMDQ packet - * - * Return: 0 for success; else the error code is returned - * - * Trigger CMDQ to asynchronously execute the CMDQ packet and call back - * at the end of done packet. Note that this is an ASYNC function. When the - * function returned, it may or may not be finished. - */ -int cmdq_pkt_flush_async(struct cmdq_pkt *pkt); - #else /* IS_ENABLED(CONFIG_MTK_CMDQ) */ static inline int cmdq_dev_get_client_reg(struct device *dev, @@ -294,13 +266,6 @@ static inline struct cmdq_client *cmdq_mbox_create(struct device *dev, int index static inline void cmdq_mbox_destroy(struct cmdq_client *client) { } -static inline struct cmdq_pkt *cmdq_pkt_create(struct cmdq_client *client, size_t size) -{ - return ERR_PTR(-EINVAL); -} - -static inline void cmdq_pkt_destroy(struct cmdq_pkt *pkt) { } - static inline int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value) { return -ENOENT; @@ -384,11 +349,6 @@ static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) return -EINVAL; } -static inline int cmdq_pkt_flush_async(struct cmdq_pkt *pkt) -{ - return -EINVAL; -} - #endif /* IS_ENABLED(CONFIG_MTK_CMDQ) */ #endif /* __MTK_CMDQ_H__ */ From patchwork Thu Feb 15 00:49:24 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: 201212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp85963dyb; Wed, 14 Feb 2024 16:51:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWElDoASX9ngssCQas2GmYAbJVtq5ooHbWFIxipChuyUVo35oDmsIJuY2BrE5hS98ZoPKDGt7CWzN0shaSvBTIb0Uo/w== X-Google-Smtp-Source: AGHT+IFnCHPfMtUXncDzIeI8u9lHtzbC6ZhSpSGPRK33br0NMbJ4NImbnwE7AQSdhNIPRSh9kgYS X-Received: by 2002:a0c:dd0e:0:b0:68c:cd4f:6d53 with SMTP id u14-20020a0cdd0e000000b0068ccd4f6d53mr277459qvk.2.1707958303872; Wed, 14 Feb 2024 16:51:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958303; cv=pass; d=google.com; s=arc-20160816; b=JNFLhntdEBSj5mhWbkPXhCUphgUWlBKI+BOPh8sRsOctdIhrlQ4COpLWuId540QiWF W1wuB1Y9YMa7FLxk5C/oBxuMGOxHaKL07a9Yn6AZFP8EvW+E40CUPKOtUEhCfR1dDIJ9 XcYfaNdKO+fDsXCOg1jZi7Co7ByZvezSIR2g1gY4tYKWJ1RdeCnbo1kujPPMaPg/Ly0w YTwrvkmM17+QHVr+7b2pZE97vsbAdOLBZbs8WN1O6Sncs1r+hMq1XQTxZluMG51ZuB5Y sH08ULEuidKfyGqnL1nB9TDl4j3I+ZcTGKL85uAV9IW+zBZ6ceFK+5dXT5hmLe1oN0Wr K/2w== 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=6RSd2DDnlN3L/G9mxlDsQpMLI2Qm5CBaJZVyRwPA2jc=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=whxlT8kB2XFG8OLdspzMPd358nalwz0gZvnwxm6fhGyRDKF/NZEhUN9AwtveAzi9+V NHhUK9FqzbvduozHYJVjUueUmi3xbGvLH6cB6hfkPfCBd26huEsfYQ/pTTOprGeJbUWP iyCo/5K2VsvXdevwVji2H2Nk55NOCaZqK7G++9zF1IbI5bOfAPz4q8FPyLxchQq5tEpP byH3vfPXQmFuvwD3FfJXTZvBv+ioYxWK/L8ANfJGMuCJq0BYf6ts9TwijeOXr8NGaiK9 GBktXaXjyRwjt9ALVuLAS99i41YL6J9d19nRPLFZmxnF7wrCWIkpcoudu3NvEV51JbJ8 bjQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y4SrMWPn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66197-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66197-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gm8-20020a056214268800b0068f02ffe514si263733qvb.612.2024.02.14.16.51.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:51:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66197-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y4SrMWPn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66197-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66197-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A8FC21C29CE5 for ; Thu, 15 Feb 2024 00:50:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59E9C7484; Thu, 15 Feb 2024 00:50:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y4SrMWPn" 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 CB0584A01; Thu, 15 Feb 2024 00:50:06 +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=1707958206; cv=none; b=ptDmSlE/nUcJSI2U4sQiN+Z6ubusHZdirGvODMKSyYuPr/VEE9bVM/H9ZqMSXtkvwIbcqhrW5U24HTURCV7RTDD04cc1Me9Z2Nu12LP8ZgxNTvO7VcFeq3tjRACNXm+aoU+V6mudm8WHtvjAv8fkqALF1INR9lMTEdWL6U6pUus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958206; c=relaxed/simple; bh=BIeHFKJRxR/tz+Sb8qGs+H0wGg4wyyBVsQF9o4cfHQk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KpprnHaHWaepZSw+do+SrrIkiohkLclsHbGkCibQtOSjPjMcWOgfNxYeMQ//PIpYx2r6QfZqgiDpCUseSBTi6pSqOiWZzSWk8JE9FeGLcPulLlgsy4GpSP23EwXTdYVHfH8yg2R6JnTcN9u9P5zqevPt0gQLvla6eZ23tGdjhD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y4SrMWPn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A4F4C43399; Thu, 15 Feb 2024 00:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958206; bh=BIeHFKJRxR/tz+Sb8qGs+H0wGg4wyyBVsQF9o4cfHQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4SrMWPnJV/p3bkb6Gqik+U8yVgMiHSaXZ2VoWYqDv4tEPx1IplKfi+xQ9JU6c7aN IhoGPmnD1tv6m4jNlkwm3zx4N+H5phQSJ2R29PMi58bklwg+DxKDGF2MlkIuYaXmCy e+O3y4IRXhgCCXxQMnK98rVo+JuRmvV8SVK8d7evJaQoLGBPFBdjobgmJnMpQqYsqD 3Ecyx2IoAIROaYYLuYf0eiClE6h0LkrM8jyEZuHGj/vLxfKU/0KcyXxpkYmMBwvMfq P8i+QjTcFM2JPbVup8YBrwDJF4Lzmg0v3iXw5IYb1LtfATbe8EZCSMqlX89QN70CY/ Or9UNM/yIQifA== 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 2/9] soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump() Date: Thu, 15 Feb 2024 00:49:24 +0000 Message-Id: <20240215004931.3808-3-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: 1790924086717529834 X-GMAIL-MSGID: 1790924086717529834 In original design, cmdq_pkt_jump() call cmdq_get_shift_pa() every time to get shift_pa. But the shift_pa is constant value for each SoC, so client driver just need to call cmdq_get_shift_pa() once and pass shift_pa to cmdq_pkt_jump() to prevent frequent function call. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 5 ++--- include/linux/soc/mediatek/mtk-cmdq.h | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 67e17974d1e6..ed4ef95adf5b 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -348,14 +348,13 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value) } EXPORT_SYMBOL(cmdq_pkt_assign); -int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr) +int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) { struct cmdq_instruction inst = {}; inst.op = CMDQ_CODE_JUMP; inst.offset = CMDQ_JUMP_RELATIVE; - inst.value = addr >> - cmdq_get_shift_pa(((struct cmdq_client *)pkt->cl)->chan); + inst.value = addr >> shift_pa; return cmdq_pkt_append_command(pkt, inst); } EXPORT_SYMBOL(cmdq_pkt_jump); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 6c42d817d368..6215191a328d 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -238,10 +238,12 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); * a physical address which should contains more instruction. * @pkt: the CMDQ packet * @addr: physical address of target instruction buffer + * @shift_pa: shift bits of physical address in CMDQ instruction. This value + * is got by cmdq_get_shift_pa(). * * Return: 0 for success; else the error code is returned */ -int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr); +int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa); /** * cmdq_pkt_finalize() - Append EOC and jump command to pkt. @@ -339,7 +341,7 @@ static inline int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value) return -EINVAL; } -static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr) +static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) { return -EINVAL; } From patchwork Thu Feb 15 00:49:25 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: 201213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp85995dyb; Wed, 14 Feb 2024 16:51:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVtqDiTkgsQYlKBiMG3Gk7dnrjL1iIiwxm+RbsZaPO7AwD7W6dNPcuYo7Yz9lb5tRkFnTLn/dWIwKh5cpFdqo27RAYnlw== X-Google-Smtp-Source: AGHT+IEq/GV6NRE7rInDYr3zaRavgQJTpoATgrUKWBeq7eDHqJ9Dxh3CW1pl+z+hTf8rhSixT4x3 X-Received: by 2002:a05:620a:468d:b0:785:d952:af50 with SMTP id bq13-20020a05620a468d00b00785d952af50mr507824qkb.76.1707958309729; Wed, 14 Feb 2024 16:51:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958309; cv=pass; d=google.com; s=arc-20160816; b=kF9eEu/QUeKlN6Hcz2jLB02BGQ7qow6UFGBQrfjPUj33J9nLJXKZjSzeBpVLcPPlTF xZjBN6KYY/zQk6HB6DZjrwN0TGEqkpG+RT9bxPjlYNczQvW9FwZ2RejglKbKZVaqMwSF Iuuqk6v2I5FR+2yWVZgIrJk/H2yEoxDN8yYApJLLCOU4t5QrSc355n92jJFIe+KFdJNi Af8q76fxrK8lUooIjGA9/shAQVDMHzcFxhnzIMnpRJ2YT/jcJ+e39Z4WmyH2l6aq4mUg IgcbFLEI8UuIvs4M4/1Ybcc+R/9fTXVpg37ZMq9Rgf95Fb0T9IGiilJXp6nbjpQlHxe3 TMxw== 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=wktiZ7HUtb2+Q2NhWcelGAYCc1x/knQvGbZ7CeUFnZM=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=Hx9n3htMA2sVkr+RtW6ga6Ni1knDfrdzwel+Ge6IXTVjgnO6n9AUVyuY2rrT+wCDJ8 1M6toR32ssiqeHg/NuGZbIsEoa6FnM5djWezVY5lNwrOmGEvaeqDnIQafihSmTigxQgy vFTRjZFseViX6q5kljzTH+EZm2RHSgWaaaua4uBHQjnlmyPt3T0rE9Nk918CEAtNpfLm ap9ITB1vQy7rPstl08Nr9C/6WU1okE9D4brgu3fY8+y04IFWYB3GyB+kQbhs+m636vkM zffwsZ4px/3MTcGrgdA2vq5hw71rPBJ/e1+ic6gev+20DfCcwWisa+r2CJHnZI2aKUsx QJIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EdY468GL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66198-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66198-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g7-20020a05620a218700b007872453d88bsi345042qka.289.2024.02.14.16.51.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:51:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66198-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EdY468GL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66198-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66198-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A81821C29FC4 for ; Thu, 15 Feb 2024 00:51:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CD36EDE; Thu, 15 Feb 2024 00:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EdY468GL" 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 B576A611B; Thu, 15 Feb 2024 00:50:08 +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=1707958208; cv=none; b=MlIcA3xBWUWVYT+HygqZkSXoOeTUVeWbqM6TWJXD6Y1Ir3zYfP/V8LyNI/o2of2gUlfLK9SjA1l29tqTYGRZkugUSL932O9VEVMclXW57UgQOXRY+Lv+1lNenR1vECLuQEo06cheX0yF6oqjQKdWsDAQmEqjqhyzFxJbM/YBIC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958208; c=relaxed/simple; bh=RwnPPmbshIPrHAhqt6nvIojZaFpX1mNKJof+jE1wWoo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=flUBZrbKQo9IUMwby5yvGVXv0AZvrV5aQpKM/MMN6+dSLBLLe8FwC0KInxlq9/9uDhZjy9KLdcg1Irj/C2eC7v5ngk/KXI7YOliNE0fAVxh6b91mxGllOkMkO9kHu1lD3KEX527eT8n1r1BjYsTkpzTVZxSZjxXBOrNuSsNV0QY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EdY468GL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAE18C43390; Thu, 15 Feb 2024 00:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958208; bh=RwnPPmbshIPrHAhqt6nvIojZaFpX1mNKJof+jE1wWoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EdY468GL32M/G+gwv+w8ZLQRt22cvdi4p+clmYR7lBpR8Hz6COfk4WHL1LBt7E4pm rCoGXVDTvlEr0RmzBpPCzDXjLkU7MWi0a0FBD494UymBcfDtsylmYnXgy6pa+HhaOo V0+5zDNIK+lNekTH0wRZ5oUasQf9nGNaIAviARu649+NmdxAck0HrDrZtN49YYFtSf XdvvPIENaud4rOP+MiXn+TpoEobLUoG/FseG+mML8ErNSHc8qcUXpmoknhmTS+T9by azP5czVyz3ekp1ybTf1gJBsffPFcxUaYjVqhxx/udbcNPmsjkvOC5yLjv0CQvhzt5z SQ+VXFjLwmO/A== 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 3/9] soc: mediatek: cmdq: Add cmdq_pkt_eoc() helper function Date: Thu, 15 Feb 2024 00:49:25 +0000 Message-Id: <20240215004931.3808-4-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: 1790924092608948362 X-GMAIL-MSGID: 1790924092608948362 cmdq_pkt_eoc() append eoc command to CMDQ packet. eoc command would ask GCE to generate IRQ. It's usually appended to the end of packet to notify all command in the packet is done. Signed-off-by: Chun-Kuang Hu Reviewed-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-cmdq-helper.c | 10 ++++++++++ include/linux/soc/mediatek/mtk-cmdq.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index ed4ef95adf5b..e982997117c2 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -359,6 +359,16 @@ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) } EXPORT_SYMBOL(cmdq_pkt_jump); +int cmdq_pkt_eoc(struct cmdq_pkt *pkt) +{ + struct cmdq_instruction inst = { {0} }; + + inst.op = CMDQ_CODE_EOC; + inst.value = CMDQ_EOC_IRQ_EN; + return cmdq_pkt_append_command(pkt, inst); +} +EXPORT_SYMBOL(cmdq_pkt_eoc); + int cmdq_pkt_finalize(struct cmdq_pkt *pkt) { struct cmdq_instruction inst = { {0} }; diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 6215191a328d..a67f719dec0b 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -245,6 +245,16 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); */ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa); +/** + * cmdq_pkt_eoc() - Append eoc command to the CMDQ packet, ask GCE + * to generate IRQ. It's usually appended to the end of + * packet to notify that all command in the packet is done. + * @pkt: the CMDQ packet + * + * Return: 0 for success; else the error code is returned + */ +int cmdq_pkt_eoc(struct cmdq_pkt *pkt); + /** * cmdq_pkt_finalize() - Append EOC and jump command to pkt. * @pkt: the CMDQ packet @@ -346,6 +356,11 @@ static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_ return -EINVAL; } +static inline int cmdq_pkt_eoc(struct cmdq_pkt *pkt) +{ + return -EINVAL; +} + static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) { return -EINVAL; From patchwork Thu Feb 15 00:49:26 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: 201214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp86034dyb; Wed, 14 Feb 2024 16:51:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmKlTtyPo/5UwlEvn4XTQ/WNONpQ9vEZJA22ntNw1btGG8vW9THuzft/BQpwNHATbvrxn9YSR3heenJO+ONPPtF6RFHw== X-Google-Smtp-Source: AGHT+IHM6DySaTs3//FSyzdRiix55mB54QNB2SgeP3UGhtui5wqGWEdw6Jtgx05daSlZ6c31yuPy X-Received: by 2002:a05:620a:14ad:b0:785:86e7:ed9c with SMTP id x13-20020a05620a14ad00b0078586e7ed9cmr441209qkj.2.1707958317860; Wed, 14 Feb 2024 16:51:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958317; cv=pass; d=google.com; s=arc-20160816; b=y/tcv2urteJZQwAAx7uEHacOoVwpJAipw5Q7IoqKaUvlt2e51FMfj8VCd89Y5YJaX+ VHgLA2oLQaNV1FnkTsVCvKgycT/Sdg0HGiS1I+pqOVV6AlrdBO2sfrMPO5LCvTUIj8Pb WIQZaScln79s7ikOcwhtOqKvJRr52xuKJExmC1DMfgLr2joKHlvTZtyP0ycVCfhHSA9V T/8YPKooeIqnn6sxZmg4o0UoFMRAlnbLqDc769ctPUxipRtz0bMYGVDfCltIxg/Ul5iR An+V/LYXI6VTvKbwCF23vVxx/6zioXoEXcv/7UNgoWfRAwVjxmCH5T3Kt0VXSPIdDlUL iOdQ== 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=TL24nmqzcuN/aA6k9o6mlcLy+zY4riqwYRuIiIlz3yM=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=pkGKWbshRP4n3kZYMsYprWyiv5i19cIDR4hd6jSaf6629Zm5xiNU/WHh4PGBUUVfI1 KXcA9tRDqvjYiO6gNaupFHI/+m3Asc3gIQQVEHimFu2d26XE0rCaMEJqS6PxCIQQTBK/ G7LSdaEnW+cIP+7O1qIqTIoAiCAW7YWV5DQnSGAuy0eFjgWv7cAOS05gV4xyg75AoTcy Frm27CSCpnkCJvsWWSX2kru/Gga8XifKRXGeXbRAZyLa5e4Mv8aEtQv4awWX6eqZy6je rXq7x0Y0zZyA/D3467MUMhfviWHZZFXQYVdp6aPT+zEOPIdmHwINzhEVJW/eNEpnBUdb Aotg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BG8swuC7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66199-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66199-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v20-20020a05620a0a9400b00785c992a039si337038qkg.597.2024.02.14.16.51.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:51:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66199-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BG8swuC7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66199-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66199-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 16A0F1C26AD5 for ; Thu, 15 Feb 2024 00:51:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FE40BA55; Thu, 15 Feb 2024 00:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BG8swuC7" 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 0E3918F6F; Thu, 15 Feb 2024 00:50:11 +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=1707958211; cv=none; b=GPnJ/VWDUjegsU+Pg9ybFjMjUc0GDKrYURZ+cu8vdNklK7z7AeA1Y+zP85YTdTXyUTYJBxKnwgcfLBA+ud79//YvNDffoEfOITtf+l31ILQbF1argWmAYPf9bYyvg3hVbFvu5nij5Z9NUV2j4c4zhqaRtxVxIxeO2f3axfdo48g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958211; c=relaxed/simple; bh=7Y5HUcTOOASw7q/i66H/i3KoMA/Mx0KFs62yKsM7Q3U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=i1kprDMUG6VBEB2mnB88ezjyfhoPaerVBpHTXujCiz1diI9SEbvQj8pGunsgUJFZagaqK1cugRmw/GdLMQdj7xYzXPAOOHJTvIsieEZ+s8bEwzfbBzg3uj4Wu2/Oz2z3L48wMSOelK4qMpvt1fr2bJElaBzU7YVHFGdkF0CNeT0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BG8swuC7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04E13C433F1; Thu, 15 Feb 2024 00:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958210; bh=7Y5HUcTOOASw7q/i66H/i3KoMA/Mx0KFs62yKsM7Q3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BG8swuC7G7o0rc6PZD+BP6DnZFqHhFPMSq6dQMm688+1cJOISJSAFtHpXi2YZs7Ol WeM5Fd70Is5xAllHt8MST0VoNH9/LjZeSNVZrZsaMs/kgdrFr9/8iIkpehRk2W+Ne3 aJyHnj0GkzPRAbiJdEgODAgTUqlsO12INSZffnQsk1XIV+W8jI2vYWyvUYgddYR8Fl BOHn13x+9jah2yOtFMQAJIB8uo9dfOc1Z9GYHhvFdWyLACPuFqdbel/LDDss5AGfc4 A3+Qn1MAxuyNIig+Xz/u5MAzjDAUoHUbC44eYRyOfN2e1QnoaavfLaCGt/CNTO7wOn ZNF7737Oj0biw== 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 4/9] soc: mediatek: cmdq: Add cmdq_pkt_nop() helper function Date: Thu, 15 Feb 2024 00:49:26 +0000 Message-Id: <20240215004931.3808-5-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: 1790924101206951306 X-GMAIL-MSGID: 1790924101206951306 cmdq_pkt_nop() append nop command to the packet. nop command ask GCE to do no operation. Signed-off-by: Chun-Kuang Hu Reviewed-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-cmdq-helper.c | 11 +++++++++++ include/linux/soc/mediatek/mtk-cmdq.h | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index e982997117c2..1be950b4ec7f 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -369,6 +369,17 @@ int cmdq_pkt_eoc(struct cmdq_pkt *pkt) } EXPORT_SYMBOL(cmdq_pkt_eoc); +int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa) +{ + struct cmdq_instruction inst = { {0} }; + + /* Jumping to next instruction is equal to no operation */ + inst.op = CMDQ_CODE_JUMP; + inst.value = CMDQ_INST_SIZE >> shift_pa; + return cmdq_pkt_append_command(pkt, inst); +} +EXPORT_SYMBOL(cmdq_pkt_nop); + int cmdq_pkt_finalize(struct cmdq_pkt *pkt) { struct cmdq_instruction inst = { {0} }; diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index a67f719dec0b..8179ba5238f9 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -255,6 +255,17 @@ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa); */ int cmdq_pkt_eoc(struct cmdq_pkt *pkt); +/** + * cmdq_pkt_nop() - Append nop command to the CMDQ packet, ask GCE + * to do no operation. + * @pkt: the CMDQ packet + * @shift_pa: shift bits of physical address in CMDQ instruction. This value + * is got by cmdq_get_shift_pa(). + * + * Return: 0 for success; else the error code is returned + */ +int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa); + /** * cmdq_pkt_finalize() - Append EOC and jump command to pkt. * @pkt: the CMDQ packet @@ -361,6 +372,11 @@ static inline int cmdq_pkt_eoc(struct cmdq_pkt *pkt) return -EINVAL; } +static inline int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa) +{ + return -EINVAL; +} + static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) { return -EINVAL; From patchwork Thu Feb 15 00:49:27 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: 201215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp86076dyb; Wed, 14 Feb 2024 16:52:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVidQBMt0nA4Tfuo1YiGcEKFEZidAQHN1JDtIdqJL+3+LcQkaSeUoHuxpq8xX6uK7Q8NGe1/UKJFkQP2THxExnKdtGWrw== X-Google-Smtp-Source: AGHT+IEqE1mTh5dMyOjE/21r+E/aK2DemcMbRib7YuK0Bl95vjyzdfx2FnnmQ+9Gr+EZL2+uAMVS X-Received: by 2002:a05:6214:3bc3:b0:68c:d943:61ea with SMTP id ng3-20020a0562143bc300b0068cd94361eamr6414347qvb.17.1707958326470; Wed, 14 Feb 2024 16:52:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958326; cv=pass; d=google.com; s=arc-20160816; b=Hs+JhvK7pbFgOHFLMW5JUuNSNHH0RmPrUic5taEJuNnI1gmMEKEkpcA5bqEUhFFo1J ABfHImFHRR+cg9Q0SKE0zyOhgGGqMLW5lB17JUU+VTzblKK4agKaqMPmIx+FwdmrK7zB w7kQjQ+Hp48aWB7zGSBbhJA0rBD4YadeEDA4BW2bQP3MfMg7r87j3J3uU0MLuVkpu6jf CFkRJ2EOaAGGVXh/3Sz/R24t/wI7D2emtwWxo+1V0+NoARKgNu+5VO5F3snCZ9u8Jrua XWLCrJJq/FxlhyqokCZUuWMjWejDzSMTX3ZrReravmrRP6Q/v9+MOj0EZBmjWUhnxqkg uJpA== 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=VmU5djMcZq3un9NXE8bxt+eQx9GKGrESkVjr84+O68E=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=f2RgS24FAhJDgKUSvLd8uL9WUzcIZTqfnoa2K2ioWCR9oKOUPfw0LEJI+RKVxaoazm AMfswOwdWSsFGTuej0ZlM/HyM/jdotp2If/Z/GB01by90oln6rv1vywpkKWRSS4NwiW5 i0Ppv7K708GbAKbq6W+lS81tvae7F91zOAU33tAQGCiohthERz0SuuuBT5QKmSiT9PqW Y61wZbxnCpBkm2yi5FESmORyx0DZAViKpSLZN7W1Kbt/nrSx9y0v0kZGqFIxpqCRjhEh wO2uZaZ4zhATQ3LwVTB3VSQcZO6uhKDv9DgBlQPA1EJtldJGgdHxdttjI/UI9riRhoXE VAtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bqp3Z+5F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66200-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c30-20020ac86e9e000000b0042c1accc565si225103qtv.51.2024.02.14.16.52.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:52:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bqp3Z+5F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66200-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 776741C2915E for ; Thu, 15 Feb 2024 00:51:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDCCED53B; Thu, 15 Feb 2024 00:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bqp3Z+5F" 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 70D4ABA4B; Thu, 15 Feb 2024 00:50:13 +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=1707958213; cv=none; b=G1gi+CJZAZd8+MmEo9Gi+I19eP2RByxVNMGHsXM3NHZqTdWwUnl/PX4sh26WXB2K0Dfn2e5X+OsYwRldWy/c16Vi/IY3Uyx0C0+kag150Pa/RVvmZh8yXwfe4Emqea7UIXBtcJ9W53dKobTuXQidzg2cmN74XyW09aoe2F+tz0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958213; c=relaxed/simple; bh=TyYfmOPE/p3NSd8TeId10uLJdlRXk+ZcnArj63ZnB78=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=L0F30FFHcIqLr9ZzfCzG4qqtvWA04D2YLDVDOGSeguG5VOKYQ3sZnoJRP/wlTl+Rg4ESaOk1cklblT1hEPPABaSg5JJfjEUTL5T3yAHchcg/fcBOJD2tCmAOTXpsK8L+woFoAtLn82Wt7w/WcMN/kDETm44cOD36WFLt9GKSis8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bqp3Z+5F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52FCAC433F1; Thu, 15 Feb 2024 00:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958213; bh=TyYfmOPE/p3NSd8TeId10uLJdlRXk+ZcnArj63ZnB78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bqp3Z+5F53mWZq048afnxrfe7nQprPLQu+KBQWmQOH2mkqI5soXwZfsv99yhXWWta tb3QXoONODumGhTKQw1KTG+7Wo4q0nB/ywNPFI3f63X1ZzP7JW51J4MMGlt6HsNq4P 6nz7CMPGf4tG/tB119Sg0av2sKA7Opvr6vVclFqutXXz5KPsfgLGl4qigdh1LdIhJH NIq1RPhRv7OQZNNhTHK76OSiOSaLdQ8MOMKhV4Xyv7Ya4K65hDpLW3IxgpXfDIXCAp BDJjBTB9O9x0iwIlkX8tQlYVApISqlTPIAnmKKwY/1Eyz91MyxaCFXc/XTp3XbpsW9 kXm/K4qhZZD4g== 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 5/9] drm/mediatek: Drop calling cmdq_pkt_finalize() Date: Thu, 15 Feb 2024 00:49:27 +0000 Message-Id: <20240215004931.3808-6-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: 1790924109934116951 X-GMAIL-MSGID: 1790924109934116951 For some client driver, it want to reduce latency between excuting previous packet command and next packet command, so append jump command to the end of previous packet and the jump destination address is the start address of next packet command buffer. Before next packet exist, the previous packet has no information of where to jump to, so append nop command first. When next packet exist, change nop command to jump command. For mediatek drm driver, it never has next packet, so appending nop command is redundant. Because cmdq_pkt_finalize() would append nop command, so change calling cmdq_pkt_finalize() to cmdq_pkt_eoc() to prevent append redundant nop command. Signed-off-by: Chun-Kuang Hu Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index c729af3b9822..df693fa268ce 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -593,7 +593,7 @@ static void mtk_drm_crtc_update_config(struct mtk_drm_crtc *mtk_crtc, cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event); cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event, false); mtk_crtc_ddp_config(crtc, cmdq_handle); - cmdq_pkt_finalize(cmdq_handle); + cmdq_pkt_eoc(cmdq_handle); dma_sync_single_for_device(mtk_crtc->cmdq_client.chan->mbox->dev, cmdq_handle->pa_base, cmdq_handle->cmd_buf_size, 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; From patchwork Thu Feb 15 00:49:29 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: 201216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp86156dyb; Wed, 14 Feb 2024 16:52:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdXXWwhy4uRhcBHSSKAnQM8Ho4DmWLc/6lELAZrgKW5myL5sGdD7uoeQQ7D8ZEtnPFSdOvb7J+7Hg5sknAoDUdZCa3iw== X-Google-Smtp-Source: AGHT+IG20+NoCYESYt6znv47W1yeeyT8tNtF4BYX7UEtAMxIj0U8UwaVAB7K9KmaGLkNppjaxsbu X-Received: by 2002:a9d:73d0:0:b0:6e2:d9d9:5500 with SMTP id m16-20020a9d73d0000000b006e2d9d95500mr206475otk.24.1707958341503; Wed, 14 Feb 2024 16:52:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958341; cv=pass; d=google.com; s=arc-20160816; b=x4pNHhunMxeftrMvN4an2VG+R5uyJmsk/FXSoKOyUyYC9htYpN9PxYI95cxEs8LQGc 6pSznNmHiH11uHVm7q4DKIiZO65LGX9k2LNrZGXKOA3/hZKCk4DL0zs7x8aPOJzKQDh4 0e4PfgOYAZ9fiMr0KcvX3zNG5qrlQXx3YRy/YhpcHRWMgQv9vFlTTBYTJpCwQKFBkFwd ykBu6b8+Bga5J9HxrmutOynnhYAB7dU340gDFYCzlgJxD/am+qJPLQT3J6NEQMbZLR9w Ndb2LjABCI5TD2klWRR2HCTpuR6E8jaUE0hqNTVitlyg8RaGX7xXFFxiFigm5dm1hDOa xQwQ== 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=pqZ/kgKDACXdPeK9sM637WSqPrRbymAx6Sooj6UWiLQ=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=sOyw7LbnYT/3Yjk+AOlv6hLySg0jPLAnE9VsEOueZVD2GRf0WUaawT3Yvc38TdL3wa ty2/0KEDIwsJet2oAe1MbC9u9hnR8JEd5+xO1wYQ05hPnW8njTR8zR0uA6GFeIVwt9q1 4xHrdGu9MK28IvMWNE7AEEqdQgmYKUy4lvEXMjsDXm7WXMZrppIJsSV3NmP/MAO2Xq2s QM30j2oOqXibLSuW6xWexAQOuqIbKRSjo4Yvb+hmt/5wZFsDHCf4leuRFUbpwRBp6eBm /ID4qUUjMyTE4d8d24e43pKHdvZVrHRiVF2AOZ/T4w4HGAFGo2fZJRgifGgxhKX5YCBW iYxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oxx40D/8"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h25-20020a633859000000b005dc47dd5dccsi82138pgn.893.2024.02.14.16.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:52:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oxx40D/8"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66202-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 43A8E284F86 for ; Thu, 15 Feb 2024 00:52:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A24915A4; Thu, 15 Feb 2024 00:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oxx40D/8" 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 9EE9EE566; Thu, 15 Feb 2024 00:50:18 +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=1707958218; cv=none; b=Bnx740eJMBOokPSvkt1pbHrKRclDkZdfCB5aBX97/sx/M/Gf+PVpqSdRmnJSBk8p9yUhNwnFiWUK8y8xiU8nTbk6Qasy7dqQ8uiZNfb9IJdKlgc/sXt/fMC0mtLTtIvZrjsdvzBYXi8jDo4z537xiOFoRoC+QKWC/udSEKRJuRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958218; c=relaxed/simple; bh=dPziziTO31/IgvG01QjFF6q9F9Ksbkg3Q8cm4HNP0Sk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RkDMwIIzAmqJK+kmp1GGqk3z/WKzcTAV8R93zNMYI/wWtUcCA0l+rK6KGghgPzxbCqDmx68ZSQsvPzr/t2ZalOCduY9ec/se11zuN79fq2iztGer/TFUwV66hy4sMRf60vOOvE40bekMmMh2bsNz1Aq7gsNEFqBW9ZlBaSA+YUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oxx40D/8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25994C433B2; Thu, 15 Feb 2024 00:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958218; bh=dPziziTO31/IgvG01QjFF6q9F9Ksbkg3Q8cm4HNP0Sk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oxx40D/89a6FlorbWuMzZEYV6v9l4FbG9HoWoWtIQbtV0NtDuB5wgcHL//ag4s+4q TCgrMKpr9bn4NrblZK2iJsOfLDeRcdTEYJRC2DUXD8GbOcf9BOM19ThwxHzCpbFfuE 65xCCK7+1IzuOQtm+JmczPhYQDYwqoX1zUs9rjTRff+hT2qWQA5wIp5raLibyOslrK W66bvZknkAFeqPjeIwe4oM+WfWh0ej8sF8ipaeoZvmhEBD6BVuF5yPoRV4+LpVIp0N ZQB560i4SHwe2FD+b6LfJMoLQJA+i8Yv892a1KyZs/9f+7+/vZcM01+jdy6vCwR892 y1Y4ICvyDigvw== 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 7/9] soc: mediatek: cmdq: Remove cmdq_pkt_finalize() helper function Date: Thu, 15 Feb 2024 00:49:29 +0000 Message-Id: <20240215004931.3808-8-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: 1790924125814416020 X-GMAIL-MSGID: 1790924125814416020 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 client driver use cmdq_pkt_eoc() and cmdq_pkt_nop() to replace cmdq_pkt_finalize() and this function could be removed. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 22 ---------------------- include/linux/soc/mediatek/mtk-cmdq.h | 13 ------------- 2 files changed, 35 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 1be950b4ec7f..9b937db7398c 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -380,26 +380,4 @@ int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa) } EXPORT_SYMBOL(cmdq_pkt_nop); -int cmdq_pkt_finalize(struct cmdq_pkt *pkt) -{ - struct cmdq_instruction inst = { {0} }; - int err; - - /* insert EOC and generate IRQ for each command iteration */ - inst.op = CMDQ_CODE_EOC; - inst.value = CMDQ_EOC_IRQ_EN; - err = cmdq_pkt_append_command(pkt, inst); - if (err < 0) - return err; - - /* JUMP to end */ - inst.op = CMDQ_CODE_JUMP; - inst.value = CMDQ_JUMP_PASS >> - cmdq_get_shift_pa(((struct cmdq_client *)pkt->cl)->chan); - err = cmdq_pkt_append_command(pkt, inst); - - return err; -} -EXPORT_SYMBOL(cmdq_pkt_finalize); - MODULE_LICENSE("GPL v2"); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 8179ba5238f9..f1d571475b52 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -266,14 +266,6 @@ int cmdq_pkt_eoc(struct cmdq_pkt *pkt); */ int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa); -/** - * cmdq_pkt_finalize() - Append EOC and jump command to pkt. - * @pkt: the CMDQ packet - * - * Return: 0 for success; else the error code is returned - */ -int cmdq_pkt_finalize(struct cmdq_pkt *pkt); - #else /* IS_ENABLED(CONFIG_MTK_CMDQ) */ static inline int cmdq_dev_get_client_reg(struct device *dev, @@ -377,11 +369,6 @@ static inline int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa) return -EINVAL; } -static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) -{ - return -EINVAL; -} - #endif /* IS_ENABLED(CONFIG_MTK_CMDQ) */ #endif /* __MTK_CMDQ_H__ */ From patchwork Thu Feb 15 00:49:30 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: 201218 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp86286dyb; Wed, 14 Feb 2024 16:52:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWW3HyPTrFgZfjLO7GNIehCMJswmra3JOp0JNhk4Ggev0zVnH+4HEDtGXVFT1a27jJzX/gAo/4jCHfTbOfshRIl+JVnRA== X-Google-Smtp-Source: AGHT+IFiLp1ARubSs1giKDEMJUppXILT25Kt5oc5+fBlwqys+vPONxtHC2mp0l2N78x6GEPjVzLv X-Received: by 2002:a05:620a:170d:b0:786:ae5e:2a49 with SMTP id az13-20020a05620a170d00b00786ae5e2a49mr6512066qkb.25.1707958363106; Wed, 14 Feb 2024 16:52:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958363; cv=pass; d=google.com; s=arc-20160816; b=g2qVezqQahDrKv0efGP7rxn7fCgsL1Ax+fFG/xQoXfAke3doXMhc73g3lf3ON7hCDT VVdizUpQNziIyZeD2cbS4yAXu0N+kgG+wczBUSo3w3l6awyys1kM0YG81I1+OYa94xro Lkh3Rb7J3yDZphB2504pgSA62htya1XWja62FecyE1gtqs4owKXXiJOUN7YcAGPuXXYN qPq6Q24w4BFcDDoOcFpzcEe7IboNIvqeDMMN7Z+64sQz2dy8rnp6Vt8SkCktkQaKgsqy aZovtrg1GChgLwocZb7AmbKgYCqPoDliZD3+0u7SCG8U1WGptqJdmxfuhOiaDQtMUoBj z9wQ== 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=iiK58UkVAOSUSedMUddKNEDSO0SoHFEJlFLbMNmUzdQ=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=KjRioNmU5KegClADreMkOUNEporwpiPCqGQua3yCjZPmqzQZmVpK1UevPNHK8E+j74 JuMeELT1isj/B/DP1yd7cj0KKFjUpLnIIMjGbia4xDuItF+UhiX6fm3qPRZWO5b8ZQWy PxKYtu1YVoHDPmvs025QJ+Vsix9sjJqENvymJWdJqZTd4PYDMAWNqzVAZBTD1YNKN48G yuF4MCD7Xwdg96NNEybhuNUOENgQg2GMPrciPNSWhXQIt12DZqURO+v+pspcmjOl5rmo xtjNE1o6P+2m2U3lauU1YUnIAH+/UHi6FWZiTQO8lJ/jOI74SVD1sK2dYkyHq4nGBLgh D6eQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pply8qty; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66203-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66203-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk15-20020a05620a1a0f00b0078732d4c2desi402533qkb.85.2024.02.14.16.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66203-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pply8qty; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66203-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66203-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E17E41C20899 for ; Thu, 15 Feb 2024 00:52:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 869AC13AE3; Thu, 15 Feb 2024 00:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pply8qty" 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 EA2F112B9C; Thu, 15 Feb 2024 00:50:20 +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=1707958221; cv=none; b=hgjKiP7opNaaNJizx8BF1AiPcIKg5eoDeLLrjB2KwmePcOuhkSAGJ22Tjjqe6yc00UKgVHTdk+LAIyYT4IADs+FxMWTmnom1FZ4/woumrlerYrBHKZEiZ0WBa5nKxiX+iQId9FQMSeYNL4QboKWTuzsOAh1rXC18O8po8iUbxUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958221; c=relaxed/simple; bh=xJOjG1xcF7TMBorsm4SdyXtFrb+p13IDHenhHoOED0Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IelxtBM/IWsGwy1iyQZtUggYrOZoYjtku3LT6tw2pWH2cXUtwdoAkQwOUdPHe9ki1wgRC3g3d58W66KhkPJk7cQiUeEfjgV8GcS8tBzJggHtwBRjmy7B2onrFN+ANspIWf8aLDJjPYkp8UT3caZ6st3iJzndZuqkhz3sCByvP8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pply8qty; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EB44C433C7; Thu, 15 Feb 2024 00:50:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958220; bh=xJOjG1xcF7TMBorsm4SdyXtFrb+p13IDHenhHoOED0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pply8qtyHCycTwTDcxWtAAj78lAggMF7xQxPbnGPKhOJDJL3X9lm/72ENeLwGlGnW T2W/JeE7YzAU0dT31xlYfp72sH+kiZn+jTo8fCVrEoy/+qPKUlwaipZ83ib/JrWplc 2RxsQYT3X1WZmgLNUOOVs574uLaigErmr8ERocCsy5AqwKnVS+Oji0zrBzRbzQuFGx TH0gfJDOGvrFRC6rMAP9phcHjoOvbUTGBNf+X38JVfYzPaVR6NYL5CE9FCVEol5WlY MKy1BuKRI5AQuxoOwm3HiVSYhZl0oix/MVP479BLS/FsyLA8nPxmY0EyW9TI0q3Vs4 shE9D8xkp/bpA== 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 8/9] drm/mediatek: Do not store struct cmdq_client in struct cmdq_pkt Date: Thu, 15 Feb 2024 00:49:30 +0000 Message-Id: <20240215004931.3808-9-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: 1790924148172580896 X-GMAIL-MSGID: 1790924148172580896 MediaTek drm driver has the struct cmdq_client information, so it's not necessary to store this information in struct cmdq_pkt. Signed-off-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index df693fa268ce..0d54cbefee0b 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -123,7 +123,6 @@ static int mtk_drm_cmdq_pkt_create(struct cmdq_client *client, struct cmdq_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, @@ -139,10 +138,8 @@ static int mtk_drm_cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt * return 0; } -static void mtk_drm_cmdq_pkt_destroy(struct cmdq_pkt *pkt) +static void mtk_drm_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); @@ -156,7 +153,7 @@ static void mtk_drm_crtc_destroy(struct drm_crtc *crtc) mtk_mutex_put(mtk_crtc->mutex); #if IS_REACHABLE(CONFIG_MTK_CMDQ) - mtk_drm_cmdq_pkt_destroy(&mtk_crtc->cmdq_handle); + mtk_drm_cmdq_pkt_destroy(&mtk_crtc->cmdq_client, &mtk_crtc->cmdq_handle); if (mtk_crtc->cmdq_client.chan) { mbox_free_channel(mtk_crtc->cmdq_client.chan); 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: