Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp897114rba; Thu, 21 Mar 2024 18:33:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcqKLGMdm56AnSOHXF43XWhsiuaCby/hXIzPDYrnaUNMU0tMLwWYNyQccpaK1gEc+Uar8d4Ul2HJ6ftJVl3N3XG1IzofhcB24QLPiUGg== X-Google-Smtp-Source: AGHT+IFiB6bP1KM7pNOMbUHGlworDsW+aI24hTsLhb4wmX1uvCQ6l0uaZ/5DZB+i3wZv9ii3uKpm X-Received: by 2002:a05:6871:a485:b0:220:8c42:117a with SMTP id wa5-20020a056871a48500b002208c42117amr955445oab.40.1711071230451; Thu, 21 Mar 2024 18:33:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711071230; cv=pass; d=google.com; s=arc-20160816; b=bru13iZfb9zGyEgOEEbQSOhwF6vvddj1rKGYrt22sDrLq0TwLSeA4jYx6iP4JIQXN2 7r6Zhy+a4DKz7b6+CJFNLR2Y/5+sZw3rWU875HP+ULG2nx06RaUAUZeHA1qQLMrN6pmd JMEoxbrk5FVWc3FMA6j0oY2iyuZ9mRYbs0Qc6DeCMpmToopGNdadppDwMq5kavRkUg+j PZ3prHqzUCY6Pev3wrRzQuXFw2vsNzOW2aDYry42bo42GHWVGVjGJEcC3uhEJt9Ny20d Pd6ABVckStnH6O7Ewz3dtFRLFMJGNHgnr5/JccnAkjwxqfvznuRrqEwt90pivhL4Kk4v tZCA== 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=o1k/aUAzB2fs9zIPVErc6M8VvXwK6zQtTbz3WRA0EkE=; fh=mgixLepzNGkyB3AoEmVNXq5zUZJ17gVX1HIqk5a+Lr0=; b=N3/koJxPW9SEW9rluMSDAMtlBpdmN/V+Gx+XvGASuyXlDiwhb737MXNg8FUbDUGn4r MjDGROj7tfxsAd8hFRMnO1T3VbleqMDYH6/MJ8BfbE78dRVi/G/P6q9ynmriFXcHiYew 12SkodLK4prMEJD3COGmZ7qaH6oXy1axXQsBJeMZ6+EYMMsm6g6UBiyMlMgFnw3W34cR PwoM0jAI4e2IY9Q8IXPNkSe9EZxW0WFcR0QUKwOehNy0o368h4PoIucXD57qrxvLCZrF e/WvykzFTGLjqvPR1MUQk1zHaUprp/8E//9Scn9C9JD/j4Yl4OBsOPAWT74r9PaMKqlS KJ9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=F09LJkwG; 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-110856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id gu19-20020a056a004e5300b006e7c1a26087si802528pfb.296.2024.03.21.18.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 18:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110856-linux.lists.archive=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=@mediatek.com header.s=dk header.b=F09LJkwG; 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-110856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110856-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7C548B22B43 for ; Fri, 22 Mar 2024 01:32:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29D9839AF1; Fri, 22 Mar 2024 01:28:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="F09LJkwG" 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 65A538488; Fri, 22 Mar 2024 01:28:27 +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=1711070909; cv=none; b=GoaVCFrRdC7vY3bt/LBbTYdpZcCDsS4m4zqqU3zgRflihIjh+oEDmIBSnWHGBfeDOHzoEfG1Mx25RbujjecKox5+2BD/6DNH/waVxVgBNHb9cCW4cs/ne96CneLOa9w/yow7xJvKJUkXFmoKy5ITz8pHxy4MghnwGQIC+nTqwxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711070909; c=relaxed/simple; bh=J8PAlSvS6S+W1VRK68CambaGaXTQwsBaBwUnbIpWu58=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LhTR7+4LjJ6k/VtrfR60gn1yNsJhnZCTtoFQKQ2zK3kgo+0sUv7AX8aLN/AECKFdAwRSgH2wM8sJUl/8lQV5nsn9cwBnST2Iww2kdR9VfotcfPGJtjnwr6QcfsS1kmdio19hF2g7vz/TSh3apwu1pUgwSXxGKgzyXaMs8LR7r4s= 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=F09LJkwG; 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: 72e0c0dce7eb11eeb8927bc1f75efef4-20240322 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=o1k/aUAzB2fs9zIPVErc6M8VvXwK6zQtTbz3WRA0EkE=; b=F09LJkwGTMZOwtUeUNXmbEMSjo4aKm64Nhwxi5svmIKN6oka7/db2U2OS/Df9v8BRIltbfx/LUoqb1X6hMouHrTrbPqJKEDzLklReF+QTW0S5eJjMDioNv/CTk5Hah6zVKBlo7xZhVFlFLPTPME0bsLNzL56Q4jEO6ztwtC91pY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:bfa0095a-2ed5-4e50-9db6-76c6dac3f3c2,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:1d184a85-8d4f-477b-89d2-1e3bdbef96d1,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: 72e0c0dce7eb11eeb8927bc1f75efef4-20240322 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 318486600; Fri, 22 Mar 2024 09:28:12 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 22 Mar 2024 09:28:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 22 Mar 2024 09:28:11 +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=20K=C3=B6nig?= , , , , , , , Hsiao Chien Sung Subject: [PATCH v4 14/14] drm/mediatek: Rename mtk_ddp_comp functions Date: Fri, 22 Mar 2024 09:28:08 +0800 Message-ID: <20240322012808.26234-15-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240322012808.26234-1-shawn.sung@mediatek.com> References: <20240322012808.26234-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 Content-Type: text/plain X-MTK: N From: Hsiao Chien Sung Rename functions of mtk_ddp_comp: - To align the naming rule - To reduce the code size Reviewed-by: AngeloGiaocchino Del Regno Reviewed-by: CK Hu Signed-off-by: Hsiao Chien Sung --- 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 c3441508f452f..17b0364112922 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 ba985206fdd24..26236691ce4c2 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 fbf63e0441337..bfe8653005dbf 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 e29c37fb5be09..67239606adbfc 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); -- 2.18.0