[Intel-gfx] [PATCH v3 3/4] drm/i915: Skip CURBASE write when nothing changed
ville.syrjala at linux.intel.com
ville.syrjala at linux.intel.com
Fri Sep 12 19:53:34 CEST 2014
From: Ville Syrjälä <ville.syrjala at 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 at 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
More information about the Intel-gfx
mailing list