aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_cursor.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-10-18 19:48:34 -0400
committerDave Airlie <airlied@redhat.com>2010-10-18 19:48:34 -0400
commitb7ae5056c94a8191c1fd0b5697707377516c0c5d (patch)
tree394f68003ea0bc2a0c24e510a7c5b13f479ce743 /drivers/gpu/drm/radeon/radeon_cursor.c
parent2126d0a4a205e2d6b763434f892524cd60f74228 (diff)
parent6a2a11dbea5db417d200d38dda53c30a2e5603e0 (diff)
Merge branch 'drm-fixes' of /home/airlied/kernel/linux-2.6 into drm-core-next
Conflicts: drivers/gpu/drm/i915/intel_fb.c drivers/gpu/drm/radeon/r600_blit_kms.c drivers/gpu/drm/ttm/ttm_bo.c
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cursor.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_cursor.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
index 4a8102512db5..017ac54920fb 100644
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
@@ -206,6 +206,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
206 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 206 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
207 struct radeon_device *rdev = crtc->dev->dev_private; 207 struct radeon_device *rdev = crtc->dev->dev_private;
208 int xorigin = 0, yorigin = 0; 208 int xorigin = 0, yorigin = 0;
209 int w = radeon_crtc->cursor_width;
209 210
210 if (x < 0) 211 if (x < 0)
211 xorigin = -x + 1; 212 xorigin = -x + 1;
@@ -216,22 +217,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
216 if (yorigin >= CURSOR_HEIGHT) 217 if (yorigin >= CURSOR_HEIGHT)
217 yorigin = CURSOR_HEIGHT - 1; 218 yorigin = CURSOR_HEIGHT - 1;
218 219
219 radeon_lock_cursor(crtc, true); 220 if (ASIC_IS_AVIVO(rdev)) {
220 if (ASIC_IS_DCE4(rdev)) {
221 /* cursors are offset into the total surface */
222 x += crtc->x;
223 y += crtc->y;
224 DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
225
226 /* XXX: check if evergreen has the same issues as avivo chips */
227 WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset,
228 ((xorigin ? 0 : x) << 16) |
229 (yorigin ? 0 : y));
230 WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
231 WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset,
232 ((radeon_crtc->cursor_width - 1) << 16) | (radeon_crtc->cursor_height - 1));
233 } else if (ASIC_IS_AVIVO(rdev)) {
234 int w = radeon_crtc->cursor_width;
235 int i = 0; 221 int i = 0;
236 struct drm_crtc *crtc_p; 222 struct drm_crtc *crtc_p;
237 223
@@ -263,7 +249,17 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
263 if (w <= 0) 249 if (w <= 0)
264 w = 1; 250 w = 1;
265 } 251 }
252 }
266 253
254 radeon_lock_cursor(crtc, true);
255 if (ASIC_IS_DCE4(rdev)) {
256 WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset,
257 ((xorigin ? 0 : x) << 16) |
258 (yorigin ? 0 : y));
259 WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
260 WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset,
261 ((w - 1) << 16) | (radeon_crtc->cursor_height - 1));
262 } else if (ASIC_IS_AVIVO(rdev)) {
267 WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, 263 WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset,
268 ((xorigin ? 0 : x) << 16) | 264 ((xorigin ? 0 : x) << 16) |
269 (yorigin ? 0 : y)); 265 (yorigin ? 0 : y));