[PATCH 07/10] drm/i915: Drop useless posting reads from cursor commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

There should be no need to do posting reads between all the cursor
register accessess. Let's just drop them.

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a3ff816fb152..222f54ffd113 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9241,28 +9241,26 @@ static void i845_update_cursor(struct intel_plane *plane,
 		 * whilst the cursor is disabled.
 		 */
 		I915_WRITE(CURCNTR(PIPE_A), 0);
-		POSTING_READ(CURCNTR(PIPE_A));
 		plane->cursor.cntl = 0;
 	}
 
-	if (plane->cursor.base != base) {
+	if (plane->cursor.base != base)
 		I915_WRITE(CURBASE(PIPE_A), base);
-		plane->cursor.base = base;
-	}
 
-	if (plane->cursor.size != size) {
+	if (plane->cursor.size != size)
 		I915_WRITE(CURSIZE, size);
-		plane->cursor.size = size;
-	}
 
 	if (cntl)
 		I915_WRITE(CURPOS(PIPE_A), pos);
 
-	if (plane->cursor.cntl != cntl) {
+	if (plane->cursor.cntl != cntl)
 		I915_WRITE(CURCNTR(PIPE_A), cntl);
-		POSTING_READ(CURCNTR(PIPE_A));
-		plane->cursor.cntl = cntl;
-	}
+
+	POSTING_READ(CURCNTR(PIPE_A));
+
+	plane->cursor.cntl = cntl;
+	plane->cursor.base = base;
+	plane->cursor.size = size;
 }
 
 static void i845_disable_cursor(struct intel_plane *plane,
@@ -9308,19 +9306,19 @@ static void i9xx_update_cursor(struct intel_plane *plane,
 		pos = intel_cursor_position(plane, plane_state);
 	}
 
-	if (plane->cursor.cntl != cntl) {
+	if (plane->cursor.cntl != cntl)
 		I915_WRITE(CURCNTR(pipe), cntl);
-		POSTING_READ(CURCNTR(pipe));
-		plane->cursor.cntl = cntl;
-	}
 
 	if (cntl)
 		I915_WRITE(CURPOS(pipe), pos);
 
-	/* and commit changes on next vblank */
-	I915_WRITE(CURBASE(pipe), base);
+	if (plane->cursor.cntl != cntl ||
+	    plane->cursor.base != base)
+		I915_WRITE(CURBASE(pipe), base);
+
 	POSTING_READ(CURBASE(pipe));
 
+	plane->cursor.cntl = cntl;
 	plane->cursor.base = base;
 }
 
-- 
2.10.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux