Skip to content

Commit 278640d

Browse files
Hsiao Chien SungChun-Kuang Hu
authored andcommitted
drm/mediatek: Rename mtk_ddp_comp functions
Rename functions of mtk_ddp_comp: - To align the naming rule - To reduce the code size Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: CK Hu <[email protected]> Signed-off-by: Hsiao Chien Sung <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 535960b commit 278640d

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

drivers/gpu/drm/mediatek/mtk_ddp_comp.c

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,10 @@ static const struct mtk_ddp_comp_match mtk_ddp_matches[DDP_COMPONENT_DRM_ID_MAX]
497497
[DDP_COMPONENT_WDMA1] = { MTK_DISP_WDMA, 1, NULL },
498498
};
499499

500-
static bool mtk_drm_find_comp_in_ddp(struct device *dev,
501-
const unsigned int *path,
502-
unsigned int path_len,
503-
struct mtk_ddp_comp *ddp_comp)
500+
static bool mtk_ddp_comp_find(struct device *dev,
501+
const unsigned int *path,
502+
unsigned int path_len,
503+
struct mtk_ddp_comp *ddp_comp)
504504
{
505505
unsigned int i;
506506

@@ -514,10 +514,10 @@ static bool mtk_drm_find_comp_in_ddp(struct device *dev,
514514
return false;
515515
}
516516

517-
static unsigned int mtk_drm_find_comp_in_ddp_conn_path(struct device *dev,
518-
const struct mtk_drm_route *routes,
519-
unsigned int num_routes,
520-
struct mtk_ddp_comp *ddp_comp)
517+
static unsigned int mtk_ddp_comp_find_in_route(struct device *dev,
518+
const struct mtk_drm_route *routes,
519+
unsigned int num_routes,
520+
struct mtk_ddp_comp *ddp_comp)
521521
{
522522
int ret;
523523
unsigned int i;
@@ -554,26 +554,31 @@ int mtk_ddp_comp_get_id(struct device_node *node,
554554
return -EINVAL;
555555
}
556556

557-
unsigned int mtk_drm_find_possible_crtc_by_comp(struct drm_device *drm,
558-
struct device *dev)
557+
unsigned int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev)
559558
{
560559
struct mtk_drm_private *private = drm->dev_private;
561560
unsigned int ret = 0;
562561

563-
if (mtk_drm_find_comp_in_ddp(dev, private->data->main_path, private->data->main_len,
564-
private->ddp_comp))
562+
if (mtk_ddp_comp_find(dev,
563+
private->data->main_path,
564+
private->data->main_len,
565+
private->ddp_comp))
565566
ret = BIT(0);
566-
else if (mtk_drm_find_comp_in_ddp(dev, private->data->ext_path,
567-
private->data->ext_len, private->ddp_comp))
567+
else if (mtk_ddp_comp_find(dev,
568+
private->data->ext_path,
569+
private->data->ext_len,
570+
private->ddp_comp))
568571
ret = BIT(1);
569-
else if (mtk_drm_find_comp_in_ddp(dev, private->data->third_path,
570-
private->data->third_len, private->ddp_comp))
572+
else if (mtk_ddp_comp_find(dev,
573+
private->data->third_path,
574+
private->data->third_len,
575+
private->ddp_comp))
571576
ret = BIT(2);
572577
else
573-
ret = mtk_drm_find_comp_in_ddp_conn_path(dev,
574-
private->data->conn_routes,
575-
private->data->num_conn_routes,
576-
private->ddp_comp);
578+
ret = mtk_ddp_comp_find_in_route(dev,
579+
private->data->conn_routes,
580+
private->data->num_conn_routes,
581+
private->ddp_comp);
577582

578583
return ret;
579584
}

drivers/gpu/drm/mediatek/mtk_ddp_comp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ static inline void mtk_ddp_comp_encoder_index_set(struct mtk_ddp_comp *comp)
326326

327327
int mtk_ddp_comp_get_id(struct device_node *node,
328328
enum mtk_ddp_comp_type comp_type);
329-
unsigned int mtk_drm_find_possible_crtc_by_comp(struct drm_device *drm,
330-
struct device *dev);
329+
unsigned int mtk_find_possible_crtcs(struct drm_device *drm, struct device *dev);
331330
int mtk_ddp_comp_init(struct device_node *comp_node, struct mtk_ddp_comp *comp,
332331
unsigned int comp_id);
333332
enum mtk_ddp_comp_type mtk_ddp_comp_get_type(unsigned int comp_id);

drivers/gpu/drm/mediatek/mtk_dpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ static int mtk_dpi_bind(struct device *dev, struct device *master, void *data)
805805
return ret;
806806
}
807807

808-
dpi->encoder.possible_crtcs = mtk_drm_find_possible_crtc_by_comp(drm_dev, dpi->dev);
808+
dpi->encoder.possible_crtcs = mtk_find_possible_crtcs(drm_dev, dpi->dev);
809809

810810
ret = drm_bridge_attach(&dpi->encoder, &dpi->bridge, NULL,
811811
DRM_BRIDGE_ATTACH_NO_CONNECTOR);

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
836836
return ret;
837837
}
838838

839-
dsi->encoder.possible_crtcs = mtk_drm_find_possible_crtc_by_comp(drm, dsi->host.dev);
839+
dsi->encoder.possible_crtcs = mtk_find_possible_crtcs(drm, dsi->host.dev);
840840

841841
ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL,
842842
DRM_BRIDGE_ATTACH_NO_CONNECTOR);

0 commit comments

Comments
 (0)