···7878 return NULL;7979}80808181-/*TODO: This could use improvement, and learn to handle the fixed8282- * BIOS tables etc. It's fine currently, for its only user.8383- */8484-int8585-nouveau_connector_bpp(struct drm_connector *connector)8686-{8787- struct nouveau_connector *nv_connector = nouveau_connector(connector);8888-8989- if (nv_connector->edid && nv_connector->edid->revision >= 4) {9090- u8 bpc = ((nv_connector->edid->input & 0x70) >> 3) + 4;9191- if (bpc > 4)9292- return bpc;9393- }9494-9595- return 18;9696-}9797-9881static void9982nouveau_connector_destroy(struct drm_connector *connector)10083{···697714 nv_connector->native_mode = drm_mode_duplicate(dev, &mode);698715 }699716717717+ /* Determine display colour depth for everything except LVDS now,718718+ * DP requires this before mode_valid() is called.719719+ */720720+ if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS)721721+ nouveau_connector_detect_depth(connector);722722+700723 /* Find the native mode if this is a digital panel, if we didn't701724 * find any modes through DDC previously add the native mode to702725 * the list of modes.···718729 ret = 1;719730 }720731721721- /* Attempt to determine display colour depth, this has to happen after722722- * we've determined the "native" mode for LVDS, as the VBIOS tables723723- * require us to compare against a pixel clock in some cases..732732+ /* Determine LVDS colour depth, must happen after determining733733+ * "native" mode as some VBIOS tables require us to use the734734+ * pixel clock as part of the lookup...724735 */725725- nouveau_connector_detect_depth(connector);736736+ if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)737737+ nouveau_connector_detect_depth(connector);726738727739 if (nv_encoder->dcb->type == OUTPUT_TV)728740 ret = get_slave_funcs(encoder)->get_modes(encoder, connector);···789799 case OUTPUT_DP:790800 max_clock = nv_encoder->dp.link_nr;791801 max_clock *= nv_encoder->dp.link_bw;792792- clock = clock * nouveau_connector_bpp(connector) / 10;802802+ clock = clock * (connector->display_info.bpc * 3) / 10;793803 break;794804 default:795805 BUG_ON(1);