From: Ajay Kumar <ajaykumar.rs@samsung.com>
To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org
Cc: joshi@samsung.com, ajaynumb@gmail.com, prashanth.g@samsung.com,
Ajay Kumar <ajaykumar.rs@samsung.com>
Subject: [RFC V2 1/3] drm: implement chaining of drm bridges
Date: Tue, 06 May 2014 01:22:26 +0530 [thread overview]
Message-ID: <1399319548-16567-2-git-send-email-ajaykumar.rs@samsung.com> (raw)
In-Reply-To: <1399319548-16567-1-git-send-email-ajaykumar.rs@samsung.com>
As of now, we can have only one bridge hanging off the encoder.
With this patch, we allow multiple bridges to hang onto the same encoder
with the use of a simple next_bridge ptr.
The drm core calls bridge->funcs for the first bridge which
is attached to it, and its upto the individual bridge drivers
to call bridge->funcs for the next bridge in the chain.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
drivers/gpu/drm/drm_crtc.c | 13 ++++++++++++-
include/drm/drm_crtc.h | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index d8b7099..fe9905f 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -918,8 +918,10 @@ EXPORT_SYMBOL(drm_connector_unplug_all);
* Zero on success, error code on failure.
*/
int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
- const struct drm_bridge_funcs *funcs)
+ struct drm_encoder *encoder,
+ const struct drm_bridge_funcs *funcs)
{
+ struct drm_bridge *temp;
int ret;
drm_modeset_lock_all(dev);
@@ -931,6 +933,15 @@ int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
bridge->dev = dev;
bridge->funcs = funcs;
+ if (encoder->bridge) {
+ temp = encoder->bridge;
+ while (temp->next_bridge)
+ temp = temp->next_bridge;
+
+ temp->next_bridge = bridge;
+ } else
+ encoder->bridge = bridge;
+
list_add_tail(&bridge->head, &dev->mode_config.bridge_list);
dev->mode_config.num_bridge++;
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e55fccb..bb6ed88 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -619,6 +619,7 @@ struct drm_bridge_funcs {
struct drm_bridge {
struct drm_device *dev;
struct list_head head;
+ struct drm_bridge *next_bridge;
struct drm_mode_object base;
@@ -862,6 +863,7 @@ extern void drm_connector_cleanup(struct drm_connector *connector);
extern void drm_connector_unplug_all(struct drm_device *dev);
extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
+ struct drm_encoder *encoder,
const struct drm_bridge_funcs *funcs);
extern void drm_bridge_cleanup(struct drm_bridge *bridge);
--
1.8.1.2
next prev parent reply other threads:[~2014-05-05 19:53 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 19:52 [RFC V2 0/3] drm/bridge: panel and chaining Ajay Kumar
2014-05-05 19:52 ` Ajay Kumar [this message]
2014-05-06 15:55 ` [RFC V2 1/3] drm: implement chaining of drm bridges Sean Paul
2014-05-06 16:12 ` Rob Clark
2014-05-06 19:51 ` Ajay kumar
2014-05-06 19:45 ` Ajay kumar
2014-05-06 20:03 ` Sean Paul
2014-05-06 20:45 ` Ajay kumar
2014-05-05 19:52 ` [RFC V2 2/3] drm/bridge: add a dummy panel driver to support lvds bridges Ajay Kumar
2014-05-05 19:52 ` [RFC V2 3/3] drm/bridge: ptn3460: support bridge chaining Ajay Kumar
2014-05-06 15:54 ` Sean Paul
2014-05-06 20:03 ` Ajay kumar
2014-05-06 20:05 ` Sean Paul
2014-05-08 6:41 ` [RFC V2 0/3] drm/bridge: panel and chaining Andrzej Hajda
2014-05-08 7:31 ` Inki Dae
2014-05-08 7:44 ` Inki Dae
2014-05-08 10:52 ` Ajay kumar
2014-05-08 11:57 ` Inki Dae
2014-05-08 18:28 ` Rob Clark
2014-05-15 9:49 ` Thierry Reding
2014-05-08 10:26 ` Ajay kumar
2014-05-08 12:59 ` Andrzej Hajda
2014-05-08 16:37 ` Ajay kumar
2014-05-08 18:24 ` Rob Clark
2014-05-09 9:08 ` Andrzej Hajda
2014-05-09 13:59 ` Rob Clark
2014-05-09 15:05 ` Ajay kumar
2014-05-12 7:06 ` Andrzej Hajda
2014-05-12 12:45 ` Rob Clark
2014-05-13 11:09 ` Andrzej Hajda
2014-05-12 16:00 ` Sean Paul
2014-05-13 12:39 ` Andrzej Hajda
2014-05-15 10:32 ` Thierry Reding
2014-05-15 12:34 ` Daniel Vetter
2014-05-15 14:51 ` Ajay kumar
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=1399319548-16567-2-git-send-email-ajaykumar.rs@samsung.com \
--to=ajaykumar.rs@samsung.com \
--cc=ajaynumb@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=joshi@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=prashanth.g@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox