aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-10-12 14:10:21 -0400
committerKeith Packard <keithp@keithp.com>2011-10-21 02:21:54 -0400
commit65a21cd65316145f9302594be8e69074369e1050 (patch)
treed1e629844f1d14b3db062366ce24ebf4385ebf93 /drivers/gpu/drm/i915/intel_display.c
parentf7cb34d47d2e30a8eb6201390ad81e232541c6d0 (diff)
drm/i915: fix IVB cursor support
The cursor regs have moved around, add the offsets and new macros for getting at them. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com> Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 880d44e38353..2371a8e38047 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5998,6 +5998,31 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
5998 I915_WRITE(CURBASE(pipe), base); 5998 I915_WRITE(CURBASE(pipe), base);
5999} 5999}
6000 6000
6001static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
6002{
6003 struct drm_device *dev = crtc->dev;
6004 struct drm_i915_private *dev_priv = dev->dev_private;
6005 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
6006 int pipe = intel_crtc->pipe;
6007 bool visible = base != 0;
6008
6009 if (intel_crtc->cursor_visible != visible) {
6010 uint32_t cntl = I915_READ(CURCNTR_IVB(pipe));
6011 if (base) {
6012 cntl &= ~CURSOR_MODE;
6013 cntl |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
6014 } else {
6015 cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
6016 cntl |= CURSOR_MODE_DISABLE;
6017 }
6018 I915_WRITE(CURCNTR_IVB(pipe), cntl);
6019
6020 intel_crtc->cursor_visible = visible;
6021 }
6022 /* and commit changes on next vblank */
6023 I915_WRITE(CURBASE_IVB(pipe), base);
6024}
6025
6001/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */ 6026/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
6002static void intel_crtc_update_cursor(struct drm_crtc *crtc, 6027static void intel_crtc_update_cursor(struct drm_crtc *crtc,
6003 bool on) 6028 bool on)
@@ -6045,11 +6070,16 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
6045 if (!visible && !intel_crtc->cursor_visible) 6070 if (!visible && !intel_crtc->cursor_visible)
6046 return; 6071 return;
6047 6072
6048 I915_WRITE(CURPOS(pipe), pos); 6073 if (IS_IVYBRIDGE(dev)) {
6049 if (IS_845G(dev) || IS_I865G(dev)) 6074 I915_WRITE(CURPOS_IVB(pipe), pos);
6050 i845_update_cursor(crtc, base); 6075 ivb_update_cursor(crtc, base);
6051 else 6076 } else {
6052 i9xx_update_cursor(crtc, base); 6077 I915_WRITE(CURPOS(pipe), pos);
6078 if (IS_845G(dev) || IS_I865G(dev))
6079 i845_update_cursor(crtc, base);
6080 else
6081 i9xx_update_cursor(crtc, base);
6082 }
6053 6083
6054 if (visible) 6084 if (visible)
6055 intel_mark_busy(dev, to_intel_framebuffer(crtc->fb)->obj); 6085 intel_mark_busy(dev, to_intel_framebuffer(crtc->fb)->obj);