@@ -78,23 +78,6 @@ nouveau_encoder_connector_get(struct nouveau_encoder *encoder)
7878 return NULL ;
7979}
8080
81- /*TODO: This could use improvement, and learn to handle the fixed
82- * BIOS tables etc. It's fine currently, for its only user.
83- */
84- int
85- nouveau_connector_bpp (struct drm_connector * connector )
86- {
87- struct nouveau_connector * nv_connector = nouveau_connector (connector );
88-
89- if (nv_connector -> edid && nv_connector -> edid -> revision >= 4 ) {
90- u8 bpc = ((nv_connector -> edid -> input & 0x70 ) >> 3 ) + 4 ;
91- if (bpc > 4 )
92- return bpc ;
93- }
94-
95- return 18 ;
96- }
97-
9881static void
9982nouveau_connector_destroy (struct drm_connector * connector )
10083{
@@ -714,6 +697,12 @@ nouveau_connector_get_modes(struct drm_connector *connector)
714697 nv_connector -> native_mode = drm_mode_duplicate (dev , & mode );
715698 }
716699
700+ /* Determine display colour depth for everything except LVDS now,
701+ * DP requires this before mode_valid() is called.
702+ */
703+ if (connector -> connector_type != DRM_MODE_CONNECTOR_LVDS )
704+ nouveau_connector_detect_depth (connector );
705+
717706 /* Find the native mode if this is a digital panel, if we didn't
718707 * find any modes through DDC previously add the native mode to
719708 * the list of modes.
@@ -729,11 +718,12 @@ nouveau_connector_get_modes(struct drm_connector *connector)
729718 ret = 1 ;
730719 }
731720
732- /* Attempt to determine display colour depth, this has to happen after
733- * we've determined the "native" mode for LVDS, as the VBIOS tables
734- * require us to compare against a pixel clock in some cases ..
721+ /* Determine LVDS colour depth, must happen after determining
722+ * "native" mode as some VBIOS tables require us to use the
723+ * pixel clock as part of the lookup. ..
735724 */
736- nouveau_connector_detect_depth (connector );
725+ if (connector -> connector_type == DRM_MODE_CONNECTOR_LVDS )
726+ nouveau_connector_detect_depth (connector );
737727
738728 if (nv_encoder -> dcb -> type == OUTPUT_TV )
739729 ret = get_slave_funcs (encoder )-> get_modes (encoder , connector );
@@ -799,7 +789,7 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
799789 case OUTPUT_DP :
800790 max_clock = nv_encoder -> dp .link_nr ;
801791 max_clock *= nv_encoder -> dp .link_bw ;
802- clock = clock * nouveau_connector_bpp (connector ) / 10 ;
792+ clock = clock * (connector -> display_info . bpc * 3 ) / 10 ;
803793 break ;
804794 default :
805795 BUG_ON (1 );
0 commit comments