Skip to content

Commit

Permalink
drm/i915: Move the cursor_base setup to i{845, 9xx}_update_cursor()
Browse files Browse the repository at this point in the history
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.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ville Syrjälä authored and Daniel Vetter committed Sep 19, 2014
1 parent f77c44b commit 99d1f38
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -8258,8 +8258,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);
Expand Down Expand Up @@ -8312,6 +8314,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... */
Expand Down Expand Up @@ -8362,7 +8366,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,
Expand Down

0 comments on commit 99d1f38

Please sign in to comment.