i915: support 8xx desktop cursors

For some reason we never added 8xx desktop cursor support to the
kernel.  This patch fixes that.

[krh: Also set the size on pre-i915 hw.]
Tested-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Jesse Barnes
2009-05-20 16:47:08 -04:00
committed by Eric Anholt
parent 8e7d2b2c6e
commit 14b6039158
3 changed files with 39 additions and 8 deletions

View File

@ -1357,7 +1357,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
int pipe = intel_crtc->pipe;
uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR;
uint32_t base = (pipe == 0) ? CURABASE : CURBBASE;
uint32_t temp;
uint32_t temp = I915_READ(control);
size_t addr;
int ret;
@ -1366,7 +1366,12 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
/* if we want to turn off the cursor ignore width and height */
if (!handle) {
DRM_DEBUG("cursor off\n");
temp = CURSOR_MODE_DISABLE;
if (IS_MOBILE(dev) || IS_I9XX(dev)) {
temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
temp |= CURSOR_MODE_DISABLE;
} else {
temp &= ~(CURSOR_ENABLE | CURSOR_GAMMA_ENABLE);
}
addr = 0;
bo = NULL;
mutex_lock(&dev->struct_mutex);
@ -1409,10 +1414,19 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
addr = obj_priv->phys_obj->handle->busaddr;
}
temp = 0;
/* set the pipe for the cursor */
temp |= (pipe << 28);
temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
if (!IS_I9XX(dev))
I915_WRITE(CURSIZE, (height << 12) | width);
/* Hooray for CUR*CNTR differences */
if (IS_MOBILE(dev) || IS_I9XX(dev)) {
temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
temp |= (pipe << 28); /* Connect to correct pipe */
} else {
temp &= ~(CURSOR_FORMAT_MASK);
temp |= CURSOR_ENABLE;
temp |= CURSOR_FORMAT_ARGB | CURSOR_GAMMA_ENABLE;
}
finish:
I915_WRITE(control, temp);