aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2014-05-06 07:56:52 -0400
committerJani Nikula <jani.nikula@intel.com>2014-05-07 08:01:50 -0400
commit56071a207602a451f0c46d3dcc8379b59ef576e2 (patch)
tree84c51df56b1ab2a13d37b9bcee87d74b2074d7b5 /drivers/gpu
parente13e2b2c468bc54e872ad68126411d6a3f77001a (diff)
drm/i915: use lane count and link rate from VBT as minimums for eDP
Most likely the minimums for both should be enough for enabling the native resolution on the eDP, and we'll end up using the predetermined optimal link config for the panel. v2: Add debug prints. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73539 Tested-by: Markus Blank-Burian <burian@muenster.de> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 115662c2f048..8233f2aea665 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -767,8 +767,10 @@ intel_dp_compute_config(struct intel_encoder *encoder,
767 struct intel_crtc *intel_crtc = encoder->new_crtc; 767 struct intel_crtc *intel_crtc = encoder->new_crtc;
768 struct intel_connector *intel_connector = intel_dp->attached_connector; 768 struct intel_connector *intel_connector = intel_dp->attached_connector;
769 int lane_count, clock; 769 int lane_count, clock;
770 int min_lane_count = 1;
770 int max_lane_count = intel_dp_max_lane_count(intel_dp); 771 int max_lane_count = intel_dp_max_lane_count(intel_dp);
771 /* Conveniently, the link BW constants become indices with a shift...*/ 772 /* Conveniently, the link BW constants become indices with a shift...*/
773 int min_clock = 0;
772 int max_clock = intel_dp_max_link_bw(intel_dp) >> 3; 774 int max_clock = intel_dp_max_link_bw(intel_dp) >> 3;
773 int bpp, mode_rate; 775 int bpp, mode_rate;
774 static int bws[] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7, DP_LINK_BW_5_4 }; 776 static int bws[] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7, DP_LINK_BW_5_4 };
@@ -801,19 +803,33 @@ intel_dp_compute_config(struct intel_encoder *encoder,
801 /* Walk through all bpp values. Luckily they're all nicely spaced with 2 803 /* Walk through all bpp values. Luckily they're all nicely spaced with 2
802 * bpc in between. */ 804 * bpc in between. */
803 bpp = pipe_config->pipe_bpp; 805 bpp = pipe_config->pipe_bpp;
804 if (is_edp(intel_dp) && dev_priv->vbt.edp_bpp && 806 if (is_edp(intel_dp)) {
805 dev_priv->vbt.edp_bpp < bpp) { 807 if (dev_priv->vbt.edp_bpp && dev_priv->vbt.edp_bpp < bpp) {
806 DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n", 808 DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n",
807 dev_priv->vbt.edp_bpp); 809 dev_priv->vbt.edp_bpp);
808 bpp = dev_priv->vbt.edp_bpp; 810 bpp = dev_priv->vbt.edp_bpp;
811 }
812
813 if (dev_priv->vbt.edp_lanes) {
814 min_lane_count = min(dev_priv->vbt.edp_lanes,
815 max_lane_count);
816 DRM_DEBUG_KMS("using min %u lanes per VBT\n",
817 min_lane_count);
818 }
819
820 if (dev_priv->vbt.edp_rate) {
821 min_clock = min(dev_priv->vbt.edp_rate >> 3, max_clock);
822 DRM_DEBUG_KMS("using min %02x link bw per VBT\n",
823 bws[min_clock]);
824 }
809 } 825 }
810 826
811 for (; bpp >= 6*3; bpp -= 2*3) { 827 for (; bpp >= 6*3; bpp -= 2*3) {
812 mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, 828 mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,
813 bpp); 829 bpp);
814 830
815 for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { 831 for (lane_count = min_lane_count; lane_count <= max_lane_count; lane_count <<= 1) {
816 for (clock = 0; clock <= max_clock; clock++) { 832 for (clock = min_clock; clock <= max_clock; clock++) {
817 link_clock = drm_dp_bw_code_to_link_rate(bws[clock]); 833 link_clock = drm_dp_bw_code_to_link_rate(bws[clock]);
818 link_avail = intel_dp_max_data_rate(link_clock, 834 link_avail = intel_dp_max_data_rate(link_clock,
819 lane_count); 835 lane_count);