From patchwork Mon Feb 26 08:50:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?U2hhd24gU3VuZyAo5a6L5a2d6KyZKQ==?= X-Patchwork-Id: 206512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1960844dyb; Mon, 26 Feb 2024 01:33:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWa6woMj7x7bV4pgrEgtACWtheKPO/P2fwmIQQ5/b8vOWQn2hvKXIH2/bi8ihrbP1GaLC72uTtOTsTqbMgi1sD/ExCCCg== X-Google-Smtp-Source: AGHT+IH94B/i7w6XkL/jUEsBXupKdaqmE0COdrbI3k56vCutGI/LNhlAppxJ3f1vuxq458VFGU0N X-Received: by 2002:ac8:5851:0:b0:42e:8b56:32d6 with SMTP id h17-20020ac85851000000b0042e8b5632d6mr1125486qth.62.1708939990793; Mon, 26 Feb 2024 01:33:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708939990; cv=pass; d=google.com; s=arc-20160816; b=IYxP044CbMvmcqoZppnx33K0FC8uL4NiSKXujpCiMBb4PKw6wEllILZbwt7LxMxYmH 0psJRkJ9g+JPGExKngj2YDGEe2MmsfnoBaYJQdmaQKwcLc2STeoLs3rFwUxZr+QMILz5 UVhSOQVjsXL12+JD9480nnDzX0avpbjh35DtgFG7X+p1ZHAS2O+nx5EKwKd5Y/YR5kRU R7vFG687gpqx/RH+jU6ub4n3Wx+yN4a5WPnBpGIUV+yQwXgUqk1+MNS0PBvowvRecd21 mQnp1nqdhgtAEfJQDGSMHy7ZYhugWyJTU9IGul+z0SVMGMQRIAUXILlyIfVpbVN01C+S VQDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6TWSK64E0WodaSDGwaLUysICXNCqUF/NrEtpuNgaBYg=; fh=mgixLepzNGkyB3AoEmVNXq5zUZJ17gVX1HIqk5a+Lr0=; b=fDiEJrWp8NxPax2JICcGX8dMvlmF4Ro5pJgAjYD6SspIAO8O3uA5uCSlCYIPFfsXx8 U9C4QwLpcm3oszCN7ggFm/FcO2hII4s3OpKgmIbylh1YqHYaIQO6ifgeYVpvKvjPKabJ pI6HAksaTu47lEkhvtke2K7oxDYrdlJXobiG1K8vKMBbYoiaS54m2yVX1C2cvB565m36 PcO61bRVEEt9X9/rSA+WNn0rsfvnInJ5svQIDlcvvQflsGcOC92L2W+pyJNXlxBTzr6p yJJfY5nBFuCgkd1BmfWM42ndTCFcnmDZFq82Ndvuo9Oaqj+OX+bwnFgjuPMqbflatQ0H +7BA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="iChQ/jRl"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-80972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80972-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g19-20020ac84693000000b0042df9185b5esi4689945qto.455.2024.02.26.01.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:33:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80972-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=@mediatek.com header.s=dk header.b="iChQ/jRl"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-80972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80972-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com 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 88F141C23DE4 for ; Mon, 26 Feb 2024 09:33:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EABB6626AF; Mon, 26 Feb 2024 08:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="iChQ/jRl" Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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 21136604C3; Mon, 26 Feb 2024 08:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708937477; cv=none; b=cZ6ZY9Myl37DqphWLybUGTOlGOqRCf0kDjyISD97wxCfzgLDmP8QTXSAf5d7yZDvv4tphAVbO1xdtBQj+4uT4lwAq/pqRdEF65H+fpexgoWEG3c6zrNtW/qCfIsgg7HkXgxN8MSSqtObljBSq19shHtVKSz7PbnlkiFSpzMQAm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708937477; c=relaxed/simple; bh=s1cK/wTZhJ62FPYPPFDpMHG53T9yRhJ9UoYmk9oQSpM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t7lGTjV+FI18n4nc067THvMuTHugddxX+94HeiQ0+CE8lpdcOG3n14Oy0WUxcaIvtQLYnoCN4lY8hbTyio2/zEjyHR1nmbtnBdVK2AQ4ZnpjwhXI1NI9P9aCjecIgzVrtM+0fpx12e2fbSh8AhxcHPzqRxXtJQyFG1089FBWyTA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=iChQ/jRl; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 2b7b1578d48411eea528b71b88a53856-20240226 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=6TWSK64E0WodaSDGwaLUysICXNCqUF/NrEtpuNgaBYg=; b=iChQ/jRl3EC/2jJBzMGgAnbIEdSw9EmjBs2/7+4hv6mkDSipPSl6jxTY1jmQMKHPPL4K0hvu7AilnY931R/sUmycWkhvXv4h9hCu0jWkZ5cq7FqCWShqSDO1TKe2nmvNXc4wUl1mZ92I50w7oE0msismZHE3mGNWuvw+uxu3Gqg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:1fb294bc-d88d-401a-976a-2e33a34663c7,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:6f543d0,CLOUDID:fe62d280-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 2b7b1578d48411eea528b71b88a53856-20240226 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 511004916; Mon, 26 Feb 2024 16:51:02 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 26 Feb 2024 16:51:01 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 26 Feb 2024 16:51:01 +0800 From: Shawn Sung To: Chun-Kuang Hu , AngeloGioacchino Del Regno CC: Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , , , , , , , Hsiao Chien Sung Subject: [PATCH 10/11] drm/mediatek: Rename mtk_ddp_comp functions Date: Mon, 26 Feb 2024 16:50:58 +0800 Message-ID: <20240226085059.26850-11-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240226085059.26850-1-shawn.sung@mediatek.com> References: <20240226085059.26850-1-shawn.sung@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--10.286800-8.000000 X-TMASE-MatchedRID: /EMcd6LVODb8rQJMqxBG8D9B1SHosSXQSiliXIcwP3HJYIv7y0tu9usu 2jSWEv0MGQdEeHBaW03ijpjet3oGSJCoy9iDotiwg2gX/Emjy1TljSRvSGpq3LPfILG5l81GJ7o vlkPXpS2s+kOEMyJ9M1yQCq2zqsJAj2hRzH1UwuAURSScn+QSXt0H8LFZNFG7bkV4e2xSge7VEO AV6gUnK31lBgKiXV4xBWSou44txm4Lp4zD4jNw8JRMZUCEHkRt X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.286800-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 5A34AB1D8ECE4ED688A103E4D1E80148B5B07663B6553ABB558535E56868F4652000:8 X-MTK: N X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791953459657453619 X-GMAIL-MSGID: 1791953459657453619 From: Hsiao Chien Sung Rename functions of mtk_ddp_comp: - To align the naming rule - To reduce the code size Signed-off-by: Hsiao Chien Sung Reviewed-by: AngeloGiaocchino Del Regno --- drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 45 ++++++++++++++----------- drivers/gpu/drm/mediatek/mtk_ddp_comp.h | 3 +- drivers/gpu/drm/mediatek/mtk_dpi.c | 2 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c index ab846a9f98c5..f6d482d27c63 100644 --- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c @@ -497,10 +497,10 @@ static const struct mtk_ddp_comp_match mtk_ddp_matches[DDP_COMPONENT_DRM_ID_MAX] [DDP_COMPONENT_WDMA1] = { MTK_DISP_WDMA, 1, NULL }, }; -static bool mtk_drm_find_comp_in_ddp(struct device *dev, - const unsigned int *path, - unsigned int path_len, - struct mtk_ddp_comp *ddp_comp) +static bool mtk_ddp_comp_find(struct device *dev, + const unsigned int *path, + unsigned int path_len, + struct mtk_ddp_comp *ddp_comp) { unsigned int i; @@ -514,10 +514,10 @@ static bool mtk_drm_find_comp_in_ddp(struct device *dev, return false; } -static unsigned int mtk_drm_find_comp_in_ddp_conn_path(struct device *dev, - const struct mtk_drm_route *routes, - unsigned int num_routes, - struct mtk_ddp_comp *ddp_comp) +static unsigned int mtk_ddp_comp_find_in_route(struct device *dev, + const struct mtk_drm_route *routes, + unsigned int num_routes, + struct mtk_ddp_comp *ddp_comp) { int ret; unsigned int i; @@ -554,26 +554,31 @@ int mtk_ddp_comp_get_id(struct device_node *node, return -EINVAL; } -unsigned int mtk_drm_find_possible_crtc_by_comp(struct drm_device *drm, - struct device *dev) +unsigned int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev) { struct mtk_drm_private *private = drm->dev_private; unsigned int ret = 0; - if (mtk_drm_find_comp_in_ddp(dev, private->data->main_path, private->data->main_len, - private->ddp_comp)) + if (mtk_ddp_comp_find(dev, + private->data->main_path, + private->data->main_len, + private->ddp_comp)) ret = BIT(0); - else if (mtk_drm_find_comp_in_ddp(dev, private->data->ext_path, - private->data->ext_len, private->ddp_comp)) + else if (mtk_ddp_comp_find(dev, + private->data->ext_path, + private->data->ext_len, + private->ddp_comp)) ret = BIT(1); - else if (mtk_drm_find_comp_in_ddp(dev, private->data->third_path, - private->data->third_len, private->ddp_comp)) + else if (mtk_ddp_comp_find(dev, + private->data->third_path, + private->data->third_len, + private->ddp_comp)) ret = BIT(2); else - ret = mtk_drm_find_comp_in_ddp_conn_path(dev, - private->data->conn_routes, - private->data->num_conn_routes, - private->ddp_comp); + ret = mtk_ddp_comp_find_in_route(dev, + private->data->conn_routes, + private->data->num_conn_routes, + private->ddp_comp); return ret; } diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_ddp_comp.h index ba985206fdd2..26236691ce4c 100644 --- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.h +++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.h @@ -326,8 +326,7 @@ static inline void mtk_ddp_comp_encoder_index_set(struct mtk_ddp_comp *comp) int mtk_ddp_comp_get_id(struct device_node *node, enum mtk_ddp_comp_type comp_type); -unsigned int mtk_drm_find_possible_crtc_by_comp(struct drm_device *drm, - struct device *dev); +unsigned int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev); int mtk_ddp_comp_init(struct device_node *comp_node, struct mtk_ddp_comp *comp, unsigned int comp_id); enum mtk_ddp_comp_type mtk_ddp_comp_get_type(unsigned int comp_id); diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 84745ec9dd7c..0c83a4400088 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -805,7 +805,7 @@ static int mtk_dpi_bind(struct device *dev, struct device *master, void *data) return ret; } - dpi->encoder.possible_crtcs = mtk_drm_find_possible_crtc_by_comp(drm_dev, dpi->dev); + dpi->encoder.possible_crtcs = mtk_find_possible_crtcs(drm_dev, dpi->dev); ret = drm_bridge_attach(&dpi->encoder, &dpi->bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index a9071c4dce0e..811b7305668f 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -836,7 +836,7 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi) return ret; } - dsi->encoder.possible_crtcs = mtk_drm_find_possible_crtc_by_comp(drm, dsi->host.dev); + dsi->encoder.possible_crtcs = mtk_find_possible_crtcs(drm, dsi->host.dev); ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);