From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [PATCH 05/11] drm/dp/mst: add concept of base connector id
Date: Tue, 9 Sep 2014 16:28:10 +1000 [thread overview]
Message-ID: <1410244096-9854-6-git-send-email-airlied@gmail.com> (raw)
In-Reply-To: <1410244096-9854-1-git-send-email-airlied@gmail.com>
From: Dave Airlie <airlied@redhat.com>
This gives us a base identifier to group tiled outputs from.
However after reading about the Dell 5k monitor I expect this
is probably too little, and we need some sort of hash table
from the monitor EDID serial number.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/drm_dp_mst_topology.c | 30 ++++++++++++++++++++++++++----
include/drm/drm_dp_mst_helper.h | 4 ++++
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 234a82c..5d2a08e 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -778,14 +778,14 @@ out:
return ret;
}
-static struct drm_dp_mst_branch *drm_dp_add_mst_branch_device(u8 lct, u8 *rad)
+static struct drm_dp_mst_branch *drm_dp_add_mst_branch_device(u8 lct, u8 *rad, u8 conn_base_id)
{
struct drm_dp_mst_branch *mstb;
mstb = kzalloc(sizeof(*mstb), GFP_KERNEL);
if (!mstb)
return NULL;
-
+ mstb->conn_base_id = conn_base_id;
mstb->lct = lct;
if (lct > 1)
memcpy(mstb->rad, rad, lct / 2);
@@ -983,7 +983,7 @@ static bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port)
case DP_PEER_DEVICE_MST_BRANCHING:
lct = drm_dp_calculate_rad(port, rad);
- port->mstb = drm_dp_add_mst_branch_device(lct, rad);
+ port->mstb = drm_dp_add_mst_branch_device(lct, rad, 0);
port->mstb->mgr = port->mgr;
port->mstb->port_parent = port;
@@ -1097,6 +1097,9 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
build_mst_prop_path(port, mstb, proppath);
port->connector = (*mstb->mgr->cbs->add_connector)(mstb->mgr, port, proppath);
+ if (port->mstb) {
+ port->mstb->conn_base_id = port->connector->base.id;
+ }
if (port->port_num >= 8)
port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc);
}
@@ -1849,7 +1852,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
mgr->avail_slots = mgr->total_slots;
/* add initial branch device at LCT 1 */
- mstb = drm_dp_add_mst_branch_device(1, NULL);
+ mstb = drm_dp_add_mst_branch_device(1, NULL, mgr->conn_base_id);
if (mstb == NULL) {
ret = -ENOMEM;
goto out_unlock;
@@ -2216,6 +2219,25 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_
}
EXPORT_SYMBOL(drm_dp_mst_get_edid);
+int drm_dp_mst_get_base_id(struct drm_dp_mst_topology_mgr *mgr,
+ struct drm_dp_mst_port *port)
+{
+ int val;
+ /* we need to search for the port in the mgr in case its gone */
+ port = drm_dp_get_validated_port_ref(mgr, port);
+ if (!port)
+ return 0;
+
+ if (!port->parent) {
+ drm_dp_put_port(port);
+ return 0;
+ }
+
+ val = port->parent->conn_base_id;
+ drm_dp_put_port(port);
+ return val;
+}
+EXPORT_SYMBOL(drm_dp_mst_get_base_id);
/**
* drm_dp_find_vcpi_slots() - find slots for this PBN value
* @mgr: manager to use
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index ee6fbad..e28d6763 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -131,6 +131,8 @@ struct drm_dp_mst_branch {
struct drm_dp_sideband_msg_tx *tx_slots[2];
int last_seqno;
bool link_address_sent;
+
+ int conn_base_id;
};
@@ -480,6 +482,8 @@ enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector *connector
struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
+int drm_dp_mst_get_base_id(struct drm_dp_mst_topology_mgr *mgr,
+ struct drm_dp_mst_port *port);
int drm_dp_calc_pbn_mode(int clock, int bpp);
--
1.9.3
next prev parent reply other threads:[~2014-09-09 6:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 6:28 [RFC] attempting to hide 30" monitor in kernel (raw) Dave Airlie
2014-09-09 6:28 ` [PATCH 01/11] drm/mst: rework payload table allocation to conform better Dave Airlie
2014-09-09 6:28 ` [PATCH 02/11] drm/i915: add config option to enable/disable DP MST Dave Airlie
2014-09-09 7:51 ` Jani Nikula
2014-09-09 6:28 ` [PATCH 03/11] drm/mst: start caching edid for logical ports Dave Airlie
2014-09-09 6:28 ` [PATCH 04/11] drm/displayid: add some DisplayID related defines/structs Dave Airlie
2014-09-09 6:28 ` Dave Airlie [this message]
2014-09-09 6:28 ` [PATCH 06/11] drm/tile: attempt to set tiled crtcs up Dave Airlie
2014-09-09 6:28 ` [PATCH 07/11] drm/edid: allow patching the EDID to report monster mode Dave Airlie
2014-09-09 6:28 ` [PATCH 08/11] drm/crtc: attempt to set tiled modes from userspace Dave Airlie
2014-09-09 6:28 ` [PATCH 09/11] drm/crtc: workaround userspace trying to derail crtc stealing Dave Airlie
2014-09-09 6:28 ` [PATCH 10/11] drm/tiled: add page_flip support for multi-crtc monitors Dave Airlie
2014-09-09 6:28 ` [PATCH 11/11] drm/tiled: vague attempt at waving at cursors Dave Airlie
2014-09-09 8:54 ` [RFC] attempting to hide 30" monitor in kernel (raw) Daniel Vetter
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=1410244096-9854-6-git-send-email-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/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.