aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
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
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')
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h8
-rw-r--r--drivers/gpu/drm/i915/intel_display.c40
2 files changed, 43 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 6cad6b1e3355..c7ef323d716e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2573,10 +2573,18 @@
2573#define _CURBBASE 0x700c4 2573#define _CURBBASE 0x700c4
2574#define _CURBPOS 0x700c8 2574#define _CURBPOS 0x700c8
2575 2575
2576#define _CURBCNTR_IVB 0x71080
2577#define _CURBBASE_IVB 0x71084
2578#define _CURBPOS_IVB 0x71088
2579
2576#define CURCNTR(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR) 2580#define CURCNTR(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR)
2577#define CURBASE(pipe) _PIPE(pipe, _CURABASE, _CURBBASE) 2581#define CURBASE(pipe) _PIPE(pipe, _CURABASE, _CURBBASE)
2578#define CURPOS(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS) 2582#define CURPOS(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS)
2579 2583
2584#define CURCNTR_IVB(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR_IVB)
2585#define CURBASE_IVB(pipe) _PIPE(pipe, _CURABASE, _CURBBASE_IVB)
2586#define CURPOS_IVB(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS_IVB)
2587
2580/* Display A control */ 2588/* Display A control */
2581#define _DSPACNTR 0x70180 2589#define _DSPACNTR 0x70180
2582#define DISPLAY_PLANE_ENABLE (1<<31) 2590#define DISPLAY_PLANE_ENABLE (1<<31)
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);