diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-11-05 10:58:25 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-11-05 10:58:25 +0100 |
commit | 37af2f6b52c8f217b205486742a6b46a864da8ed (patch) | |
tree | ac6ef8d53f3db98f30290bc19ead668644d37739 | |
parent | 5659e2f1b08e44d0c4f21a403e91b4801ef78f62 (diff) |
radeon: Use indirect register access for (un)hiding the cursor.
This avoids hangs that occur when touching these registers while the card is
busy with some cards.
-rw-r--r-- | src/radeon_cursor.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index f19f2bc..b8cfffd 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -98,12 +98,19 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc) RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; - 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)); } void @@ -115,12 +122,18 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc) RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; - 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); - + 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, 0, ~RADEON_CRTC_CUR_EN); } void |