Commit 278640d4 authored by Hsiao Chien Sung's avatar Hsiao Chien Sung Committed by Chun-Kuang Hu
Browse files

drm/mediatek: Rename mtk_ddp_comp functions

parent 535960b9
Loading
Loading
Loading
Loading
+25 −20
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ 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,
static bool mtk_ddp_comp_find(struct device *dev,
			      const unsigned int *path,
			      unsigned int path_len,
			      struct mtk_ddp_comp *ddp_comp)
@@ -514,7 +514,7 @@ 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,
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)
@@ -554,23 +554,28 @@ 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,
	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,
		ret = mtk_ddp_comp_find_in_route(dev,
						 private->data->conn_routes,
						 private->data->num_conn_routes,
						 private->ddp_comp);
+1 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);