drm/i915: Don't call bxt_ddi_phy_calc_lane_lat_optim_mask() after failing intel_dp_compute_config()

Submitted by Ville Syrjälä on April 11, 2019, 2:35 p.m.

Details

Message ID 20190411143508.18298-1-ville.syrjala@linux.intel.com
State New
Headers show
Series "drm/i915: Don't call bxt_ddi_phy_calc_lane_lat_optim_mask() after failing intel_dp_compute_config()" ( rev: 1 ) in Intel GFX

Commit Message

Ville Syrjälä April 11, 2019, 2:35 p.m.
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

If intel_dp_compute_config() fails it may not have populated
crtc_state->lane_count, which means
bxt_ddi_phy_calc_lane_lat_optim_mask() may end up with a MISSING_CASE().
Bail out immediately if intel_dp_compute_config() (or the HDMI
counterpart) fails so that we avoid triggeringing this MISSING_CASE
warning.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109373
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 3ae55274056c..3733e5858e08 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -3857,6 +3857,8 @@  static int intel_ddi_compute_config(struct intel_encoder *encoder,
 		ret = intel_hdmi_compute_config(encoder, pipe_config, conn_state);
 	else
 		ret = intel_dp_compute_config(encoder, pipe_config, conn_state);
+	if (ret)
+		return ret;
 
 	if (IS_GEN9_LP(dev_priv) && ret)
 		pipe_config->lane_lat_optim_mask =
@@ -3864,7 +3866,7 @@  static int intel_ddi_compute_config(struct intel_encoder *encoder,
 
 	intel_ddi_compute_min_voltage_level(dev_priv, pipe_config);
 
-	return ret;
+	return 0;
 
 }