@@ -413,6 +413,28 @@ int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link)
EXPORT_SYMBOL(drm_dp_link_power_down);
/*
+ * drm_dp_max_sink_dotclock() - Compute max pixel rate
+ * @dotclk: reference pixel rate
+ * @bd: pointer to a structure containing DP branch device information
+ *
+ * Returns max supported pixel rate.
+ */
+int drm_dp_max_sink_dotclock(int dotclk, struct drm_dp_bd *bd)
+{
+ int max_dotclk = dotclk;
+
+ /* DP to VGA dongle may define max pixel rate in DPCD */
+ if (bd->present) {
+ if ((bd->type & DP_DS_PORT_TYPE_VGA) &&
+ (bd->dfp.vga.dot_clk > 0))
+ max_dotclk = min(dotclk, bd->dfp.vga.dot_clk);
+ }
+
+ return max_dotclk;
+}
+EXPORT_SYMBOL(drm_dp_max_sink_dotclock);
+
+/*
* drm_dp_bd() - read DisplayPort Receiver Capability Fields for
* DP branch devices
* @aux: DisplayPort AUX channel
@@ -882,6 +882,7 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
+int drm_dp_max_sink_dotclock(int dotclk, struct drm_dp_bd *bd);
int drm_dp_bd(struct drm_dp_aux *aux, struct drm_dp_bd *bd);
int drm_dp_aux_register(struct drm_dp_aux *aux);
For DP branch devices DPCD register may define the max supported pixel rate for VGA dongles. This patch adds a check if DPCD register value is less than current setting for pixel rate. Signed-off-by: Mika Kahola <mika.kahola@intel.com> --- drivers/gpu/drm/drm_dp_helper.c | 22 ++++++++++++++++++++++ include/drm/drm_dp_helper.h | 1 + 2 files changed, 23 insertions(+)