[Intel-gfx] [PATCH 10/17] drm/i915: Propagate failure to set mode for load-detect pipe

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 21 23:18:25 CEST 2011


Check the return value from drm_crtc_set_mode(), report the failure
via a debug message and propagate the error back to the caller. This
prevents us from blissfully continuing to do the load detection on a
disabled pipe. Fortunately actual failure for modesetting is very rare,
and reported failures even rarer.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 793245e2..b254fac 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5596,7 +5596,11 @@ bool intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
 	if (!crtc->enabled) {
 		if (!mode)
 			mode = &load_detect_mode;
-		drm_crtc_helper_set_mode(crtc, mode, 0, 0, crtc->fb);
+
+		if (!drm_crtc_helper_set_mode(crtc, mode, 0, 0, crtc->fb)) {
+			DRM_DEBUG_KMS("failed to set mode on load-detect pipe\n");
+			return false;
+		}
 	} else {
 		if (intel_crtc->dpms_mode != DRM_MODE_DPMS_ON) {
 			crtc_funcs = crtc->helper_private;
-- 
1.7.4.1




More information about the Intel-gfx mailing list