summaryrefslogtreecommitdiff
path: root/src/radeon_cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radeon_cursor.c')
-rw-r--r--src/radeon_cursor.c56
1 files changed, 25 insertions, 31 deletions
diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index bf66516b..8cef5d63 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -117,29 +117,26 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc)
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
-#ifdef XF86DRI
- if (info->CPStarted && pScrn->pScreen) DRILock(pScrn->pScreen, 0);
-#endif
-
- RADEON_SYNC(info, pScrn);
-
if (IS_AVIVO_VARIANT) {
OUTREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset,
INREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset)
| AVIVO_D1CURSOR_EN);
avivo_setup_cursor(crtc, TRUE);
} else {
- if (crtc_id == 0)
- OUTREGP(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_CUR_EN | 2 << 20,
- ~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
- else if (crtc_id == 1)
- OUTREGP(RADEON_CRTC2_GEN_CNTL, RADEON_CRTC2_CUR_EN | 2 << 20,
- ~(RADEON_CRTC2_CUR_EN | RADEON_CRTC2_CUR_MODE_MASK));
+ switch (crtc_id) {
+ case 0:
+ OUTREG(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL);
+ break;
+ case 1:
+ OUTREG(RADEON_MM_INDEX, RADEON_CRTC2_GEN_CNTL);
+ break;
+ default:
+ return;
+ }
+
+ OUTREGP(RADEON_MM_DATA, RADEON_CRTC_CUR_EN | 2 << 20,
+ ~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
}
-
-#ifdef XF86DRI
- if (info->CPStarted && pScrn->pScreen) DRIUnlock(pScrn->pScreen);
-#endif
}
void
@@ -151,27 +148,24 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
-#ifdef XF86DRI
- if (info->CPStarted && pScrn->pScreen) DRILock(pScrn->pScreen, 0);
-#endif
-
- RADEON_SYNC(info, pScrn);
-
if (IS_AVIVO_VARIANT) {
OUTREG(AVIVO_D1CUR_CONTROL+ radeon_crtc->crtc_offset,
INREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset)
& ~(AVIVO_D1CURSOR_EN));
avivo_setup_cursor(crtc, FALSE);
} else {
- if (crtc_id == 0)
- OUTREGP(RADEON_CRTC_GEN_CNTL, 0, ~RADEON_CRTC_CUR_EN);
- else if (crtc_id == 1)
- OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~RADEON_CRTC2_CUR_EN);
- }
-
-#ifdef XF86DRI
- if (info->CPStarted && pScrn->pScreen) DRIUnlock(pScrn->pScreen);
-#endif
+ case 0:
+ OUTREG(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL);
+ break;
+ case 1:
+ OUTREG(RADEON_MM_INDEX, RADEON_CRTC2_GEN_CNTL);
+ break;
+ default:
+ return;
+ }
+
+ OUTREGP(RADEON_MM_DATA, 0, ~RADEON_CRTC_CUR_EN);
+ }
}
void