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);