[Nouveau] [PATCH v3 6/6] kms/nv50: detect LVDS max MHz correctly

Karol Herbst kherbst at redhat.com
Fri Aug 3 12:19:39 UTC 2018


Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 drm/nouveau/dispnv50/disp.c     | 5 ++++-
 drm/nouveau/nouveau_connector.c | 5 ++++-
 drm/nouveau/nouveau_encoder.h   | 4 ++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drm/nouveau/dispnv50/disp.c b/drm/nouveau/dispnv50/disp.c
index 103433cb..53c97c7a 100644
--- a/drm/nouveau/dispnv50/disp.c
+++ b/drm/nouveau/dispnv50/disp.c
@@ -1430,7 +1430,10 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe,
 	nv_encoder->update = nv50_sor_update;
 
 	switch (dcbe->type) {
-	case DCB_OUTPUT_LVDS: type = DRM_MODE_ENCODER_LVDS; break;
+	case DCB_OUTPUT_LVDS:
+		nv_encoder->lvds.max_mhz = caps->sor[or].lvds.max_mhz;
+		type = DRM_MODE_ENCODER_LVDS;
+		break;
 	case DCB_OUTPUT_DP:
 		nv_encoder->dp.no_interlace = caps->sor[or].dp.no_interlace;
 		type = DRM_MODE_ENCODER_TMDS;
diff --git a/drm/nouveau/nouveau_connector.c b/drm/nouveau/nouveau_connector.c
index 65fac604..027636b3 100644
--- a/drm/nouveau/nouveau_connector.c
+++ b/drm/nouveau/nouveau_connector.c
@@ -1029,7 +1029,10 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
 			return MODE_PANEL;
 
 		min_clock = 0;
-		max_clock = 400000;
+		if (nv_encoder->lvds.max_mhz)
+			max_clock = nv_encoder->lvds.max_mhz * 1000;
+		else
+			max_clock = 400000;
 		break;
 	case DCB_OUTPUT_TMDS:
 		hdmi = drm_detect_hdmi_monitor(nv_connector->edid);
diff --git a/drm/nouveau/nouveau_encoder.h b/drm/nouveau/nouveau_encoder.h
index fbef9dc0..6961bdfc 100644
--- a/drm/nouveau/nouveau_encoder.h
+++ b/drm/nouveau/nouveau_encoder.h
@@ -66,6 +66,10 @@ struct nouveau_encoder {
 			bool no_interlace;
 		} dp;
 
+		struct {
+			uint16_t max_mhz;
+		} lvds;
+
 		struct {
 			uint16_t max_mhz;
 		} tmds;
-- 
2.17.1



More information about the Nouveau mailing list