Reset the CCE/CP on engine reset, and make the ATIDRIDMA functions take a

more useful argument.
This commit is contained in:
Eric Anholt 2004-09-12 20:31:39 +00:00
parent fcd52d276f
commit 27b5a65f05
3 changed files with 32 additions and 12 deletions

View File

@ -371,10 +371,13 @@ void
ATIDRICloseScreen(ScreenPtr pScreen);
void
ATIDRIDMAStart(ScreenPtr pScreen);
ATIDRIDMAStart(ATIScreenInfo *atis);
void
ATIDRIDMAStop(ScreenPtr pScreen);
ATIDRIDMAStop(ATIScreenInfo *atis);
void
ATIDRIDMAReset(ATIScreenInfo *atis);
void
ATIDRIDispatchIndirect(ATIScreenInfo *atis, Bool discard);

View File

@ -222,6 +222,12 @@ ATIEngineReset(ATIScreenInfo *atis)
OUTPLL(mmio, R128_REG_MCLK_CNTL, mclkcntl);
MMIO_OUT32(mmio, ATI_REG_CLOCK_CNTL_INDEX, clockcntlindex);
}
#ifdef USE_DRI
if (atis->using_dri) {
ATIDRIDMAReset(atis);
ATIDRIDMAStart(atis);
}
#endif
}
static void
@ -937,7 +943,7 @@ ATIDMASetup(ScreenPtr pScreen)
#ifdef USE_DRI
if (atis->using_dri)
ATIDRIDMAStart(pScreen);
ATIDRIDMAStart(atis);
#endif /* USE_DRI */
if (!atis->using_dri) {
@ -981,7 +987,7 @@ ATIDMATeardown(ScreenPtr pScreen)
#ifdef USE_DRI
if (atis->using_dri)
ATIDRIDMAStop(pScreen);
ATIDRIDMAStop(atis);
#endif /* USE_DRI */
if (atis->using_dma)

View File

@ -1033,11 +1033,9 @@ ATIDRICloseScreen(ScreenPtr pScreen)
}
void
ATIDRIDMAStart(ScreenPtr pScreen)
ATIDRIDMAStart(ATIScreenInfo *atis)
{
KdScreenPriv(pScreen);
ATICardInfo(pScreenPriv);
ATIScreenInfo(pScreenPriv);
ATICardInfo *atic = atis->atic;
int ret;
if (atic->is_radeon)
@ -1055,11 +1053,9 @@ ATIDRIDMAStart(ScreenPtr pScreen)
* same for both R128 and Radeon, so we can just use the name of one of them.
*/
void
ATIDRIDMAStop(ScreenPtr pScreen)
ATIDRIDMAStop(ATIScreenInfo *atis)
{
KdScreenPriv(pScreen);
ATICardInfo(pScreenPriv);
ATIScreenInfo(pScreenPriv);
ATICardInfo *atic = atis->atic;
drmRadeonCPStop stop;
int ret;
@ -1078,6 +1074,21 @@ ATIDRIDMAStop(ScreenPtr pScreen)
atis->dma_started = FALSE;
}
void
ATIDRIDMAReset(ATIScreenInfo *atis)
{
ATICardInfo *atic = atis->atic;
int ret;
ret = drmCommandNone(atic->drmFd, atic->is_radeon ?
DRM_RADEON_CP_RESET : DRM_R128_CCE_RESET);
if (ret != 0)
FatalError("Failed to reset CCE/CP\n");
atis->dma_started = FALSE;
}
/* The R128 and Radeon Indirect ioctls differ only in the ioctl number */
void
ATIDRIDispatchIndirect(ATIScreenInfo *atis, Bool discard)