浏览代码

drm/i915: Cleanup if the EDP transcoder has a bobug input value

In the case where the hardware has been wrongly programmed and the EDP
TRANS_DDI_FUNC_CTL register has a bogus value in its EDP Input field, we
were using the pipe variable uninitialized.

In this case, shutdown the transcoder. It will be programmed correctly
the next time we try to enabled eDP.

Note from Paulo's review: Wrong modeset sequence can easily lead to
frozen machines hence the disable_ddi call might be risky. But since
things are awry already, doesn't matter too much.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
[danvet: Add note about Paulo's caution about potential hangs.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Damien Lespiau 12 年之前
父节点
当前提交
aaa148ecdc
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      drivers/gpu/drm/i915/intel_display.c

+ 8 - 0
drivers/gpu/drm/i915/intel_display.c

@@ -9125,6 +9125,13 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
 			case TRANS_DDI_EDP_INPUT_C_ONOFF:
 			case TRANS_DDI_EDP_INPUT_C_ONOFF:
 				pipe = PIPE_C;
 				pipe = PIPE_C;
 				break;
 				break;
+			default:
+				/* A bogus value has been programmed, disable
+				 * the transcoder */
+				WARN(1, "Bogus eDP source %08x\n", tmp);
+				intel_ddi_disable_transcoder_func(dev_priv,
+						TRANSCODER_EDP);
+				goto setup_pipes;
 			}
 			}
 
 
 			crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
 			crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
@@ -9135,6 +9142,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
 		}
 		}
 	}
 	}
 
 
+setup_pipes:
 	for_each_pipe(pipe) {
 	for_each_pipe(pipe) {
 		crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
 		crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);