All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: andy.gross@linaro.org, robdclark@gmail.com
Cc: linux-arm-msm@vger.kernel.org, john.stultz@linaro.org,
	dri-devel@lists.freedesktop.org,
	Archit Taneja <architt@codeaurora.org>
Subject: [PATCH v3 1/4] drm/msm/mdp4: Fix issue with LCDC/LVDS port parsing
Date: Tue, 13 Sep 2016 20:51:34 +0530	[thread overview]
Message-ID: <1473780097-11388-2-git-send-email-architt@codeaurora.org> (raw)
In-Reply-To: <1473780097-11388-1-git-send-email-architt@codeaurora.org>

The LVDS port is the first in the list of the output ports in MDP4.
The driver assumed that if the port and its corresponding endpoint
is defined, then there should be a panel node too. This isn't
necessary since boards may not really use a LVDS panel. Don't fail
if there isn't a panel node available.

While we're at it, use of_graph_get_endpoint_by_regs instead of
of_graph_get_next_endpoint to make it more explicit that the LVDS
output is at port 0.

Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
index 7b39e89..571a91e 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
@@ -228,18 +228,21 @@ 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);
+	/*
+	 * LVDS/LCDC 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 remote endpoint\n");
 		return NULL;
 	}
 
-	/* don't proceed if we have an endpoint but no panel_node tied to it */
 	panel_node = of_graph_get_remote_port_parent(endpoint);
 	if (!panel_node) {
-		dev_err(dev->dev, "no valid panel node\n");
+		DBG("no valid panel node in LVDS endpoint\n");
 		of_node_put(endpoint);
-		return ERR_PTR(-ENODEV);
+		return NULL;
 	}
 
 	of_node_put(endpoint);
@@ -262,14 +265,12 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
 	switch (intf_type) {
 	case DRM_MODE_ENCODER_LVDS:
 		/*
-		 * bail out early if:
-		 * - there is no panel node (no need to initialize lcdc
-		 *   encoder and lvds connector), or
-		 * - panel node is a bad pointer
+		 * bail out early if there is no panel node (no need to
+		 * initialize LCDC encoder and LVDS connector)
 		 */
 		panel_node = mdp4_detect_lcdc_panel(dev);
-		if (IS_ERR_OR_NULL(panel_node))
-			return PTR_ERR(panel_node);
+		if (!panel_node)
+			return 0;
 
 		encoder = mdp4_lcdc_encoder_init(dev, panel_node);
 		if (IS_ERR(encoder)) {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

  reply	other threads:[~2016-09-13 15:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08  5:55 [PATCH 0/4] drm/msm: HDMI support on IFC6410 Archit Taneja
2016-07-08  5:55 ` [PATCH 1/4] drm/msm/mdp4: Fix issue with LCDC/LVDS port parsing Archit Taneja
2016-07-08  5:55 ` [PATCH 2/4] drm/msm/hdmi: Use more DT friendly GPIO names Archit Taneja
2016-07-13 13:45   ` Rob Herring
2016-07-14  8:34     ` Archit Taneja
2016-07-08  5:55 ` [PATCH 3/4] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
2016-07-08  5:55 ` [PATCH 4/4] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja
2016-09-01 13:36 ` [PATCH v2 0/4] drm/msm: HDMI support on IFC6410 Archit Taneja
2016-09-01 13:36   ` [PATCH v2 1/4] drm/msm/mdp4: Fix issue with LCDC/LVDS port parsing Archit Taneja
2016-09-07 22:17     ` John Stultz
2016-09-01 13:36   ` [PATCH v2 2/4] drm/msm/hdmi: Clean up HDMI gpio DT bindings Archit Taneja
     [not found]     ` <1472737015-29382-3-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-07 22:18       ` John Stultz
2016-09-12 13:19       ` Rob Herring
2016-09-13  7:12         ` Archit Taneja
2016-09-13 13:15           ` Archit Taneja
2016-09-01 13:36   ` [PATCH v2 3/4] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
2016-09-07 22:19     ` John Stultz
2016-09-01 13:36   ` [PATCH v2 4/4] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja
2016-09-07 23:32   ` [RFC][PATCH 5/4] arm: dts: qcom: apq8064: Add dsi, gpu and iommu nodes John Stultz
2016-09-07 23:32     ` [PATCH 6/4] arm: dts: qcom: apq8064-nexus7: Add DSI and panel nodes John Stultz
2016-09-08  5:05       ` vinay simha
2016-09-08  4:58     ` [RFC][PATCH 5/4] arm: dts: qcom: apq8064: Add dsi, gpu and iommu nodes vinay simha
2016-09-12  8:46     ` Archit Taneja
2016-09-13 15:21   ` [PATCH v3 0/4] drm/msm: HDMI support on IFC6410 Archit Taneja
2016-09-13 15:21     ` Archit Taneja [this message]
2016-09-13 15:21     ` [PATCH v3 3/4] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
     [not found]       ` <1473780097-11388-4-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-13 21:44         ` Stephen Boyd
2016-09-14 17:57           ` Archit Taneja
     [not found]     ` <1473780097-11388-1-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-13 15:21       ` [PATCH v3 2/4] drm/msm/hdmi: Clean up HDMI gpio DT bindings Archit Taneja
2016-09-13 19:31         ` Rob Herring
2016-09-13 15:21       ` [PATCH v3 4/4] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja
2016-09-23  6:33     ` [PATCH v4 0/2] drm/msm: HDMI support on IFC6410 Archit Taneja
2016-09-23  6:33       ` [PATCH v4 1/2] arm: dts: qcom: apq8064: Add display DT nodes Archit Taneja
2016-09-23  6:33       ` [PATCH v4 2/2] arm: dts: qcom: apq8064-ifc6410: Add HDMI support Archit Taneja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473780097-11388-2-git-send-email-architt@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.