History

drm/radeon: Set cursor x/y to 0 when x/yorigin > 0.

Apart from the obvious cleanup, this should make the line cursor_end = x - xorigin + w; correct now.

Michel Dänzer committed 15 years ago

Commit 02e68591 parent b8aee291 file · +10 −10Browse files

Unified · Split

drivers/gpu/drm/radeon/radeon_cursor.c+10−10
@@ -215,10 +215,14 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, · 214 unmodified lines
215215 }
216216 DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
217217
218− if (x < 0)
218+ if (x < 0) {
219219 xorigin = min(-x, CURSOR_WIDTH - 1);
220− if (y < 0)
220+ x = 0;
221+ }
222+ if (y < 0) {
221223 yorigin = min(-y, CURSOR_HEIGHT - 1);
224+ y = 0;
225+ }
222226
223227 if (ASIC_IS_AVIVO(rdev)) {
224228 int i = 0;
@@ -251,16 +255,12 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, · 26 unmodified lines
251255
252256 radeon_lock_cursor(crtc, true);
253257 if (ASIC_IS_DCE4(rdev)) {
254− WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset,
255− ((xorigin ? 0 : x) << 16) |
256− (yorigin ? 0 : y));
258+ WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset, (x << 16) | y);
257259 WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
258260 WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset,
259261 ((w - 1) << 16) | (radeon_crtc->cursor_height - 1));
260262 } else if (ASIC_IS_AVIVO(rdev)) {
261− WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset,
262− ((xorigin ? 0 : x) << 16) |
263− (yorigin ? 0 : y));
263+ WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, (x << 16) | y);
264264 WREG32(AVIVO_D1CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
265265 WREG32(AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset,
266266 ((w - 1) << 16) | (radeon_crtc->cursor_height - 1));
@@ -274,8 +274,8 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, · 7 unmodified lines
274274 | yorigin));
275275 WREG32(RADEON_CUR_HORZ_VERT_POSN + radeon_crtc->crtc_offset,
276276 (RADEON_CUR_LOCK
277− | ((xorigin ? 0 : x) << 16)
278− | (yorigin ? 0 : y)));
277+ | (x << 16)
278+ | y));
279279 /* offset is from DISP(2)_BASE_ADDRESS */
280280 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, (radeon_crtc->legacy_cursor_offset +
281281 (yorigin * 256)));