diff options
| author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-10-12 14:10:21 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-26 12:10:07 -0500 |
| commit | e01b0328fa4df58b3d0ccd03f8b1b2768f05e539 (patch) | |
| tree | 29afbdac86b8bed03cf6034588af08f180c2df7c /drivers/gpu | |
| parent | ae6c19cd6c32f88b2d8549984ff2a5fcdcc932b2 (diff) | |
drm/i915: fix IVB cursor support
commit 65a21cd65316145f9302594be8e69074369e1050 upstream.
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>
Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 40 |
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 5d5def756c9..27e0e93a6ae 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -2544,10 +2544,18 @@ | |||
| 2544 | #define _CURBBASE 0x700c4 | 2544 | #define _CURBBASE 0x700c4 |
| 2545 | #define _CURBPOS 0x700c8 | 2545 | #define _CURBPOS 0x700c8 |
| 2546 | 2546 | ||
| 2547 | #define _CURBCNTR_IVB 0x71080 | ||
| 2548 | #define _CURBBASE_IVB 0x71084 | ||
| 2549 | #define _CURBPOS_IVB 0x71088 | ||
| 2550 | |||
| 2547 | #define CURCNTR(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR) | 2551 | #define CURCNTR(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR) |
| 2548 | #define CURBASE(pipe) _PIPE(pipe, _CURABASE, _CURBBASE) | 2552 | #define CURBASE(pipe) _PIPE(pipe, _CURABASE, _CURBBASE) |
| 2549 | #define CURPOS(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS) | 2553 | #define CURPOS(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS) |
| 2550 | 2554 | ||
| 2555 | #define CURCNTR_IVB(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR_IVB) | ||
| 2556 | #define CURBASE_IVB(pipe) _PIPE(pipe, _CURABASE, _CURBBASE_IVB) | ||
| 2557 | #define CURPOS_IVB(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS_IVB) | ||
| 2558 | |||
| 2551 | /* Display A control */ | 2559 | /* Display A control */ |
| 2552 | #define _DSPACNTR 0x70180 | 2560 | #define _DSPACNTR 0x70180 |
| 2553 | #define DISPLAY_PLANE_ENABLE (1<<31) | 2561 | #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 cbf4c4ce3a2..d08a6002d0e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -5334,6 +5334,31 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) | |||
| 5334 | I915_WRITE(CURBASE(pipe), base); | 5334 | I915_WRITE(CURBASE(pipe), base); |
| 5335 | } | 5335 | } |
| 5336 | 5336 | ||
| 5337 | static void ivb_update_cursor(struct drm_crtc *crtc, u32 base) | ||
| 5338 | { | ||
| 5339 | struct drm_device *dev = crtc->dev; | ||
| 5340 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 5341 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
| 5342 | int pipe = intel_crtc->pipe; | ||
| 5343 | bool visible = base != 0; | ||
| 5344 | |||
| 5345 | if (intel_crtc->cursor_visible != visible) { | ||
| 5346 | uint32_t cntl = I915_READ(CURCNTR_IVB(pipe)); | ||
| 5347 | if (base) { | ||
| 5348 | cntl &= ~CURSOR_MODE; | ||
| 5349 | cntl |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; | ||
| 5350 | } else { | ||
| 5351 | cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE); | ||
| 5352 | cntl |= CURSOR_MODE_DISABLE; | ||
| 5353 | } | ||
| 5354 | I915_WRITE(CURCNTR_IVB(pipe), cntl); | ||
| 5355 | |||
| 5356 | intel_crtc->cursor_visible = visible; | ||
| 5357 | } | ||
| 5358 | /* and commit changes on next vblank */ | ||
| 5359 | I915_WRITE(CURBASE_IVB(pipe), base); | ||
| 5360 | } | ||
| 5361 | |||
| 5337 | /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */ | 5362 | /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */ |
| 5338 | static void intel_crtc_update_cursor(struct drm_crtc *crtc, | 5363 | static void intel_crtc_update_cursor(struct drm_crtc *crtc, |
| 5339 | bool on) | 5364 | bool on) |
| @@ -5381,11 +5406,16 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc, | |||
| 5381 | if (!visible && !intel_crtc->cursor_visible) | 5406 | if (!visible && !intel_crtc->cursor_visible) |
| 5382 | return; | 5407 | return; |
| 5383 | 5408 | ||
| 5384 | I915_WRITE(CURPOS(pipe), pos); | 5409 | if (IS_IVYBRIDGE(dev)) { |
| 5385 | if (IS_845G(dev) || IS_I865G(dev)) | 5410 | I915_WRITE(CURPOS_IVB(pipe), pos); |
| 5386 | i845_update_cursor(crtc, base); | 5411 | ivb_update_cursor(crtc, base); |
| 5387 | else | 5412 | } else { |
| 5388 | i9xx_update_cursor(crtc, base); | 5413 | I915_WRITE(CURPOS(pipe), pos); |
| 5414 | if (IS_845G(dev) || IS_I865G(dev)) | ||
| 5415 | i845_update_cursor(crtc, base); | ||
| 5416 | else | ||
| 5417 | i9xx_update_cursor(crtc, base); | ||
| 5418 | } | ||
| 5389 | 5419 | ||
| 5390 | if (visible) | 5420 | if (visible) |
| 5391 | intel_mark_busy(dev, to_intel_framebuffer(crtc->fb)->obj); | 5421 | intel_mark_busy(dev, to_intel_framebuffer(crtc->fb)->obj); |
