All of lore.kernel.org
 help / color / mirror / Atom feed
From: Meng Yi <meng.yi@nxp.com>
To: stefan@agner.ch
Cc: jianwei.wang.chn@gmail.com, Meng Yi <meng.yi@nxp.com>,
	emil.l.velikov@gmail.com, dri-devel@lists.freedesktop.org,
	alexander.stein@systec-electronic.com
Subject: [PATCH 2/2] drm:fsl-dcu: add support for drm bridge
Date: Fri, 24 Jun 2016 17:00:45 +0800	[thread overview]
Message-ID: <1466758845-30958-2-git-send-email-meng.yi@nxp.com> (raw)
In-Reply-To: <1466758845-30958-1-git-send-email-meng.yi@nxp.com>

The current output code only supports connection to drm panels.
Add codes to support drm bridge, to supports connection to
external connectors.

Signed-off-by: Meng Yi <meng.yi@nxp.com>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
index 57a030b..f19e9b1 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
@@ -189,6 +189,7 @@ err_cleanup:
 static int fsl_dcu_attach_endpoint(struct fsl_dcu_drm_device *fsl_dev,
 				const struct of_endpoint *ep)
 {
+	struct drm_bridge *bridge;
 	struct device_node *np;
 	int ret;
 
@@ -200,8 +201,21 @@ static int fsl_dcu_attach_endpoint(struct fsl_dcu_drm_device *fsl_dev,
 		ret = fsl_dcu_attach_panel(fsl_dev, fsl_dev->connector.panel);
 		if (ret)
 			return -EPROBE_DEFER;
+		return 0;
 	}
 
+	bridge = of_drm_find_bridge(np);
+	of_node_put(np);
+	if (!bridge)
+		return -ENODEV;
+
+	fsl_dev->encoder.bridge = bridge;
+	bridge->encoder = &fsl_dev->encoder;
+
+	ret = drm_bridge_attach(fsl_dev->drm, bridge);
+	if (ret)
+		return -EPROBE_DEFER;
+
 	return 0;
 }
 
-- 
2.1.0.27.g96db324

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-06-24  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24  9:00 [PATCH 1/2] drm:fsl-dcu: rework codes to support of_graph dt binding for panel Meng Yi
2016-06-24  9:00 ` Meng Yi [this message]
2016-06-25 22:08   ` [PATCH 2/2] drm:fsl-dcu: add support for drm bridge Stefan Agner
2016-06-25 21:58 ` [PATCH 1/2] drm:fsl-dcu: rework codes to support of_graph dt binding for panel Stefan Agner

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=1466758845-30958-2-git-send-email-meng.yi@nxp.com \
    --to=meng.yi@nxp.com \
    --cc=alexander.stein@systec-electronic.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=jianwei.wang.chn@gmail.com \
    --cc=stefan@agner.ch \
    /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.