diff mbox

[3/9] drm/msm/mdp: mdp4: Update LCDC/LVDS port parsing

Message ID 1462273081-5814-4-git-send-email-architt@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Archit Taneja May 3, 2016, 10:57 a.m. UTC
The LCDC port is the first in the list of the output ports in MDP4.
Mention this explicitly in the driver.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Philipp Zabel May 3, 2016, 1:50 p.m. UTC | #1
Am Dienstag, den 03.05.2016, 16:27 +0530 schrieb Archit Taneja:
> The LCDC port is the first in the list of the output ports in MDP4.
> Mention this explicitly in the driver.
> 
> Signed-off-by: Archit Taneja <architt@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
> index f8e0cea..cd129f4 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
> @@ -263,9 +263,13 @@ static struct device_node *mdp4_detect_lcdc_panel(struct drm_device *dev)
>  	struct device_node *endpoint, *panel_node;
>  	struct device_node *np = dev->dev->of_node;
>  
> -	endpoint = of_graph_get_next_endpoint(np, NULL);
> +	/*
> +	 * LCDC/LVDS is the first port described in the list of ports in the
> +	 * MDP4 DT node.
> +	 */
> +	endpoint = of_graph_get_endpoint_by_regs(np, 0, -1);
>  	if (!endpoint) {
> -		DBG("no endpoint in MDP4 to fetch LVDS panel\n");
> +		DBG("no LVDS panel remote endpoint\n");
>  		return NULL;
>  	}

Oh nice, I wasn't aware of of_graph_get_endpoint_by_regs().
We should switch imx-drm and exynos to use it, too.

regards
Philipp
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
index f8e0cea..cd129f4 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
@@ -263,9 +263,13 @@  static struct device_node *mdp4_detect_lcdc_panel(struct drm_device *dev)
 	struct device_node *endpoint, *panel_node;
 	struct device_node *np = dev->dev->of_node;
 
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	/*
+	 * LCDC/LVDS is the first port described in the list of ports in the
+	 * MDP4 DT node.
+	 */
+	endpoint = of_graph_get_endpoint_by_regs(np, 0, -1);
 	if (!endpoint) {
-		DBG("no endpoint in MDP4 to fetch LVDS panel\n");
+		DBG("no LVDS panel remote endpoint\n");
 		return NULL;
 	}