diff mbox

[3/3] drm/i915: warn about invalid pfit modes

Message ID 1366919703-20309-3-git-send-email-jbarnes@virtuousgeek.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jesse Barnes April 25, 2013, 7:55 p.m. UTC
We prevent invalid ones from getting here in the first place, but it
doesn't hurt to have an extra sanity check.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_panel.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Daniel Vetter April 25, 2013, 8:20 p.m. UTC | #1
On Thu, Apr 25, 2013 at 12:55:03PM -0700, Jesse Barnes wrote:
> We prevent invalid ones from getting here in the first place, but it
> doesn't hurt to have an extra sanity check.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Merged all three, with the first one a bit bikeshedded (as discussed on
irc).

Thanks, Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 016e676..48e7207 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -58,7 +58,6 @@  intel_pch_panel_fitting(struct intel_crtc *intel_crtc,
 			struct intel_crtc_config *pipe_config,
 			int fitting_mode)
 {
-	struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
 	struct drm_display_mode *mode, *adjusted_mode;
 	int x, y, width, height;
 
@@ -107,12 +106,15 @@  intel_pch_panel_fitting(struct intel_crtc *intel_crtc,
 		}
 		break;
 
-	default:
 	case DRM_MODE_SCALE_FULLSCREEN:
 		x = y = 0;
 		width = adjusted_mode->hdisplay;
 		height = adjusted_mode->vdisplay;
 		break;
+
+	default:
+		WARN(1, "bad panel fit mode: %d\n", fitting_mode);
+		return;
 	}
 
 done:
@@ -266,7 +268,6 @@  void intel_gmch_panel_fitting(struct intel_crtc *intel_crtc,
 			}
 		}
 		break;
-	default:
 	case DRM_MODE_SCALE_FULLSCREEN:
 		/*
 		 * Full scaling, even if it changes the aspect ratio.
@@ -284,6 +285,9 @@  void intel_gmch_panel_fitting(struct intel_crtc *intel_crtc,
 						 HORIZ_INTERP_BILINEAR);
 		}
 		break;
+	default:
+		WARN(1, "bad panel fit mode: %d\n", fitting_mode);
+		return;
 	}
 
 	/* 965+ wants fuzzy fitting */