summaryrefslogtreecommitdiff
path: root/src/radeon_commonfuncs.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-02-26 11:44:13 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-26 11:44:13 -0500
commit000756e052a291230e5c95e48b69a5aa9c4fab0e (patch)
tree4a9a22ac48ae3081bfa70107fb175b081f1f380c /src/radeon_commonfuncs.c
parent22d7746bfc1bcbb3269afac88971254088ea9ece (diff)
parent8373f4399b03961f2c928a9275d47e9f41bd92bb (diff)
Merge branch 'r6xx-r7xx-support' of git+ssh://agd5f@git.freedesktop.org/git/xorg/driver/xf86-video-ati
Diffstat (limited to 'src/radeon_commonfuncs.c')
-rw-r--r--src/radeon_commonfuncs.c84
1 files changed, 52 insertions, 32 deletions
diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c
index 3aa61bcc..eabd87df 100644
--- a/src/radeon_commonfuncs.c
+++ b/src/radeon_commonfuncs.c
@@ -656,7 +656,7 @@ void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix,
return;
start = max(start, 0);
- stop = max(stop, xf86_config->crtc[crtc]->mode.VDisplay);
+ stop = min(stop, xf86_config->crtc[crtc]->mode.VDisplay);
if (start > xf86_config->crtc[crtc]->mode.VDisplay)
return;
@@ -730,8 +730,11 @@ void FUNC_NAME(RADEONWaitForIdle)(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Idle timed out, resetting engine...\n");
- RADEONEngineReset(pScrn);
- RADEONEngineRestore(pScrn);
+ if (info->ChipFamily < CHIP_FAMILY_R600) {
+ RADEONEngineReset(pScrn);
+ RADEONEngineRestore(pScrn);
+ } else
+ R600EngineReset(pScrn);
/* Always restart the engine when doing CP 2D acceleration */
RADEONCP_RESET(pScrn, info);
@@ -740,39 +743,56 @@ void FUNC_NAME(RADEONWaitForIdle)(ScrnInfoPtr pScrn)
}
#endif
-#if 0
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
- "WaitForIdle (entering): %d entries, stat=0x%08x\n",
- INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK,
- INREG(RADEON_RBBM_STATUS));
-#endif
-
- if (info->ChipFamily >= CHIP_FAMILY_R600)
- return;
-
- /* Wait for the engine to go idle */
- RADEONWaitForFifoFunction(pScrn, 64);
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ /* Wait for the engine to go idle */
+ if (info->ChipFamily >= CHIP_FAMILY_RV770)
+ R600WaitForFifoFunction(pScrn, 8);
+ else
+ R600WaitForFifoFunction(pScrn, 16);
- for (;;) {
- for (i = 0; i < RADEON_TIMEOUT; i++) {
- if (!(INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE)) {
- RADEONEngineFlush(pScrn);
- return;
+ for (;;) {
+ for (i = 0; i < RADEON_TIMEOUT; i++) {
+ if (!(INREG(R600_GRBM_STATUS) & R600_GUI_ACTIVE))
+ return;
}
- }
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
- "Idle timed out: %u entries, stat=0x%08x\n",
- (unsigned int)INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK,
- (unsigned int)INREG(RADEON_RBBM_STATUS));
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Idle timed out, resetting engine...\n");
- RADEONEngineReset(pScrn);
- RADEONEngineRestore(pScrn);
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
+ "Idle timed out: stat=0x%08x\n",
+ (unsigned int)INREG(R600_GRBM_STATUS));
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Idle timed out, resetting engine...\n");
+ R600EngineReset(pScrn);
#ifdef XF86DRI
- if (info->directRenderingEnabled) {
- RADEONCP_RESET(pScrn, info);
- RADEONCP_START(pScrn, info);
+ if (info->directRenderingEnabled) {
+ RADEONCP_RESET(pScrn, info);
+ RADEONCP_START(pScrn, info);
+ }
+#endif
}
+ } else {
+ /* Wait for the engine to go idle */
+ RADEONWaitForFifoFunction(pScrn, 64);
+
+ for (;;) {
+ for (i = 0; i < RADEON_TIMEOUT; i++) {
+ if (!(INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE)) {
+ RADEONEngineFlush(pScrn);
+ return;
+ }
+ }
+ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
+ "Idle timed out: %u entries, stat=0x%08x\n",
+ (unsigned int)INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK,
+ (unsigned int)INREG(RADEON_RBBM_STATUS));
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Idle timed out, resetting engine...\n");
+ RADEONEngineReset(pScrn);
+ RADEONEngineRestore(pScrn);
+#ifdef XF86DRI
+ if (info->directRenderingEnabled) {
+ RADEONCP_RESET(pScrn, info);
+ RADEONCP_START(pScrn, info);
+ }
#endif
+ }
}
}