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

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Wed Sep 12 08:47:04 PDT 2012


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

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

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++) {
-- 
1.7.8.6



More information about the dri-devel mailing list