diff mbox

[RFC,1/4] drm/i915: Try to commit single pipe in one go

Message ID 1347464827-14187-2-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä Sept. 12, 2012, 3:47 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

---
 drivers/gpu/drm/i915/intel_atomic.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index e439c04..e9eaa8a 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -907,6 +907,7 @@  static int apply_config(struct drm_device *dev,
 	for (i = 0; i < dev->mode_config.num_crtc; i++) {
 		struct intel_crtc_state *st = &s->crtc[i];
 		struct intel_crtc *intel_crtc = to_intel_crtc(st->crtc);
+		int j;
 
 		if (st->mode_dirty) {
 			ret = crtc_mode_set(st->crtc);
@@ -925,21 +926,21 @@  static int apply_config(struct drm_device *dev,
 						 intel_crtc->cursor_height,
 						 intel_crtc->cursor_bo,
 						 intel_crtc->cursor_addr);
-	}
 
-	for (i = 0; i < dev->mode_config.num_plane; i++) {
-		struct intel_plane_state *st = &s->plane[i];
-		struct drm_plane *plane = st->plane;
+		for (j = 0; j < dev->mode_config.num_plane; j++) {
+			struct intel_plane_state *pst = &s->plane[j];
+			struct drm_plane *plane = pst->plane;
 
-		if (!s->plane[i].dirty)
-			continue;
+			if (!pst->dirty)
+				continue;
 
-		if (!plane->crtc)
-			continue;
+			if (plane->crtc != st->crtc)
+				continue;
 
-		ret = intel_commit_plane(plane, plane->crtc, plane->fb, &st->coords, false);
-		if (ret)
-			return ret;
+			ret = intel_commit_plane(plane, plane->crtc, plane->fb, &pst->coords, false);
+			if (ret)
+				return ret;
+		}
 	}
 
 	for (i = 0; i < dev->mode_config.num_crtc; i++) {