All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 3/4] drm/i915: Skip CURBASE write when nothing changed
Date: Fri, 12 Sep 2014 20:53:34 +0300	[thread overview]
Message-ID: <1410544415-3059-3-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1410544415-3059-1-git-send-email-ville.syrjala@linux.intel.com>

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

Only write CURBASE when something about the cursor changed. Also
eliminate the unnecessary posting read after writing CURCNTR.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 82c0ad1..60c1aa4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8322,16 +8322,18 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
 			cntl |= CURSOR_PIPE_CSC_ENABLE;
 	}
 
-	if (intel_crtc->cursor_cntl != cntl) {
+	if (intel_crtc->cursor_cntl != cntl)
 		I915_WRITE(CURCNTR(pipe), cntl);
-		POSTING_READ(CURCNTR(pipe));
-		intel_crtc->cursor_cntl = cntl;
-	}
+
+	if (intel_crtc->cursor_cntl == cntl &&
+	    intel_crtc->cursor_base == base)
+		return;
 
 	/* and commit changes on next vblank */
 	I915_WRITE(CURBASE(pipe), base);
 	POSTING_READ(CURBASE(pipe));
 
+	intel_crtc->cursor_cntl = cntl;
 	intel_crtc->cursor_base = base;
 }
 
-- 
1.8.5.5

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

  parent reply	other threads:[~2014-09-12 17:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 13:48 [PATCH] drm/i915: Support variable cursor height on ivb+ ville.syrjala
2014-09-12 14:00 ` [PATCH v2] " ville.syrjala
2014-09-12 17:53   ` [PATCH v3 1/4] drm/i915: Move the cursor_base setup to i{845, 9xx}_update_cursor() ville.syrjala
2014-09-12 17:53     ` [PATCH v3 2/4] drm/i915: Only set CURSOR_PIPE_CSC_ENABLE when cursor is enabled ville.syrjala
2014-09-13 16:17       ` Chris Wilson
2014-09-15  9:12         ` Daniel Vetter
2014-09-12 17:53     ` ville.syrjala [this message]
2014-09-13 16:20       ` [PATCH v3 3/4] drm/i915: Skip CURBASE write when nothing changed Chris Wilson
2014-09-15 13:36         ` Ville Syrjälä
2014-09-15 13:46           ` Chris Wilson
2014-09-12 17:53     ` [PATCH v3 4/4] drm/i915: Support variable cursor height on ivb+ ville.syrjala
2014-09-13 16:23       ` Chris Wilson
2014-09-15 13:31         ` Ville Syrjälä
2014-09-13 16:15     ` [PATCH v3 1/4] drm/i915: Move the cursor_base setup to i{845, 9xx}_update_cursor() Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410544415-3059-3-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.