Re: [PATCH 10/11] drm/mediatek: Rename mtk_ddp_comp functions

2024-03-14 Thread 胡俊光


Re: [PATCH 10/11] drm/mediatek: Rename mtk_ddp_comp functions

2024-02-26 Thread AngeloGioacchino Del Regno

Il 26/02/24 09:50, Shawn Sung ha scritto:

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 





[PATCH 10/11] drm/mediatek: Rename mtk_ddp_comp functions

2024-02-26 Thread Shawn Sung
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 
---
 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