Re: [Intel-gfx] [PATCH v3 1/4] drm/i915: Move the cursor_base setup to i{845, 9xx}_update_cursor()

2014-09-13 Thread Chris Wilson
On Fri, Sep 12, 2014 at 08:53:32PM +0300, ville.syrj...@linux.intel.com wrote:
 From: Ville Syrjälä ville.syrj...@linux.intel.com
 
 To make the code a bit more undestandable move the
 intel_crtc-cursor_base assignment into the low level update cursor
 routines. That's were we compare the current value with the new one
 so immediately seeing that it gets assigned only afterwards helps
 one to understand that it gets assigned only after the comparison.
 
 Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com

I'd been tempted to do this myself, but lacked justification.
Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH v3 1/4] drm/i915: Move the cursor_base setup to i{845, 9xx}_update_cursor()

2014-09-12 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com

To make the code a bit more undestandable move the
intel_crtc-cursor_base assignment into the low level update cursor
routines. That's were we compare the current value with the new one
so immediately seeing that it gets assigned only afterwards helps
one to understand that it gets assigned only after the comparison.

Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com
---
 drivers/gpu/drm/i915/intel_display.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 41986cc..8a5cb6b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8274,8 +8274,10 @@ static void i845_update_cursor(struct drm_crtc *crtc, 
u32 base)
intel_crtc-cursor_cntl = 0;
}
 
-   if (intel_crtc-cursor_base != base)
+   if (intel_crtc-cursor_base != base) {
I915_WRITE(_CURABASE, base);
+   intel_crtc-cursor_base = base;
+   }
 
if (intel_crtc-cursor_size != size) {
I915_WRITE(CURSIZE, size);
@@ -8328,6 +8330,8 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 
base)
/* and commit changes on next vblank */
I915_WRITE(CURBASE(pipe), base);
POSTING_READ(CURBASE(pipe));
+
+   intel_crtc-cursor_base = base;
 }
 
 /* If no-part of the cursor is visible on the framebuffer, then the GPU may 
hang... */
@@ -8378,7 +8382,6 @@ static void intel_crtc_update_cursor(struct drm_crtc 
*crtc,
i845_update_cursor(crtc, base);
else
i9xx_update_cursor(crtc, base);
-   intel_crtc-cursor_base = base;
 }
 
 static bool cursor_size_ok(struct drm_device *dev,
-- 
1.8.5.5

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