[Intel-gfx] [PATCH 1/2] A Helper function that returns available link bandwidth

Anusha Srivatsa anusha.srivatsa at intel.com
Thu Aug 11 23:41:39 UTC 2016


drm/dp/mst

Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>

Add a function that returns the available link bandwidth for
MST port so that we can accurately determine whether a new
mode is valid for the link or not.

Cc: dri-devel at lists.freedesktop.org
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 12 ++++++++++++
 include/drm/drm_dp_mst_helper.h       |  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 04e4571..7a239f6 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -43,6 +43,8 @@ static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr,
 				  char *buf);
 static int test_calc_pbn_mode(void);
 
+int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
+
 static void drm_dp_put_port(struct drm_dp_mst_port *port);
 
 static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr,
@@ -2730,6 +2732,16 @@ static int test_calc_pbn_mode(void)
 	return 0;
 }
 
+int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port)
+{
+        port = drm_dp_get_validated_port_ref(mgr,port);
+        if (port)
+                return port->available_pbn;
+
+        return -EINVAL;
+}
+EXPORT_SYMBOL(drm_dp_mst_get_avail_pbn);
+
 /* we want to kick the TX after we've ack the up/down IRQs. */
 static void drm_dp_mst_kick_tx(struct drm_dp_mst_topology_mgr *mgr)
 {
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index 0032076..74dc4ab 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -576,6 +576,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_
 
 int drm_dp_calc_pbn_mode(int clock, int bpp);
 
+int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
 
 bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int pbn, int *slots);
 
-- 
2.7.4



More information about the Intel-gfx mailing list