[Intel-gfx] [PATCH 06/24] drm/i915: properly check for pipe count

Eugeni Dodonov eugeni.dodonov at intel.com
Thu Apr 26 20:21:01 CEST 2012


As suggested by Chris Wilson and Daniel Vetter, this chunk of code can be
simplified with a more simple check.

CC: Daniel Vetter <daniel.vetter at ffwll.ch>
CC: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8262ec6..27f384d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1981,16 +1981,10 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
 		return 0;
 	}
 
-	switch (intel_crtc->plane) {
-	case 0:
-	case 1:
-		break;
-	case 2:
-		if (IS_IVYBRIDGE(dev))
-			break;
-		/* fall through otherwise */
-	default:
-		DRM_ERROR("no plane for crtc\n");
+	if(intel_crtc->plane > dev_priv->num_pipe) {
+		DRM_ERROR("no plane for crtc: plane %d, num_pipes %d\n",
+				intel_crtc->plane,
+				dev_priv->num_pipe);
 		return -EINVAL;
 	}
 
-- 
1.7.10




More information about the Intel-gfx mailing list