Skip to content

Commit 51ea8a8

Browse files
committed
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm/radeon/kms: avivo cursor workaround applies to evergreen as well
2 parents 547af56 + 6a2a11d commit 51ea8a8

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

drivers/gpu/drm/radeon/radeon_cursor.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
203203
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
204204
struct radeon_device *rdev = crtc->dev->dev_private;
205205
int xorigin = 0, yorigin = 0;
206+
int w = radeon_crtc->cursor_width;
206207

207208
if (x < 0)
208209
xorigin = -x + 1;
@@ -213,22 +214,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
213214
if (yorigin >= CURSOR_HEIGHT)
214215
yorigin = CURSOR_HEIGHT - 1;
215216

216-
radeon_lock_cursor(crtc, true);
217-
if (ASIC_IS_DCE4(rdev)) {
218-
/* cursors are offset into the total surface */
219-
x += crtc->x;
220-
y += crtc->y;
221-
DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
222-
223-
/* XXX: check if evergreen has the same issues as avivo chips */
224-
WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset,
225-
((xorigin ? 0 : x) << 16) |
226-
(yorigin ? 0 : y));
227-
WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
228-
WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset,
229-
((radeon_crtc->cursor_width - 1) << 16) | (radeon_crtc->cursor_height - 1));
230-
} else if (ASIC_IS_AVIVO(rdev)) {
231-
int w = radeon_crtc->cursor_width;
217+
if (ASIC_IS_AVIVO(rdev)) {
232218
int i = 0;
233219
struct drm_crtc *crtc_p;
234220

@@ -260,7 +246,17 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
260246
if (w <= 0)
261247
w = 1;
262248
}
249+
}
263250

251+
radeon_lock_cursor(crtc, true);
252+
if (ASIC_IS_DCE4(rdev)) {
253+
WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset,
254+
((xorigin ? 0 : x) << 16) |
255+
(yorigin ? 0 : y));
256+
WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin);
257+
WREG32(EVERGREEN_CUR_SIZE + radeon_crtc->crtc_offset,
258+
((w - 1) << 16) | (radeon_crtc->cursor_height - 1));
259+
} else if (ASIC_IS_AVIVO(rdev)) {
264260
WREG32(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset,
265261
((xorigin ? 0 : x) << 16) |
266262
(yorigin ? 0 : y));

0 commit comments

Comments
 (0)