Reset the CCE/CP on engine reset, and make the ATIDRIDMA functions take a
more useful argument.
This commit is contained in:
		
							parent
							
								
									fcd52d276f
								
							
						
					
					
						commit
						27b5a65f05
					
				| 
						 | 
					@ -371,10 +371,13 @@ void
 | 
				
			||||||
ATIDRICloseScreen(ScreenPtr pScreen);
 | 
					ATIDRICloseScreen(ScreenPtr pScreen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ATIDRIDMAStart(ScreenPtr pScreen);
 | 
					ATIDRIDMAStart(ATIScreenInfo *atis);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ATIDRIDMAStop(ScreenPtr pScreen);
 | 
					ATIDRIDMAStop(ATIScreenInfo *atis);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					ATIDRIDMAReset(ATIScreenInfo *atis);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ATIDRIDispatchIndirect(ATIScreenInfo *atis, Bool discard);
 | 
					ATIDRIDispatchIndirect(ATIScreenInfo *atis, Bool discard);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -222,6 +222,12 @@ ATIEngineReset(ATIScreenInfo *atis)
 | 
				
			||||||
		OUTPLL(mmio, R128_REG_MCLK_CNTL, mclkcntl);
 | 
							OUTPLL(mmio, R128_REG_MCLK_CNTL, mclkcntl);
 | 
				
			||||||
		MMIO_OUT32(mmio, ATI_REG_CLOCK_CNTL_INDEX, clockcntlindex);
 | 
							MMIO_OUT32(mmio, ATI_REG_CLOCK_CNTL_INDEX, clockcntlindex);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					#ifdef USE_DRI
 | 
				
			||||||
 | 
						if (atis->using_dri) {
 | 
				
			||||||
 | 
							ATIDRIDMAReset(atis);
 | 
				
			||||||
 | 
							ATIDRIDMAStart(atis);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					@ -937,7 +943,7 @@ ATIDMASetup(ScreenPtr pScreen)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef USE_DRI
 | 
					#ifdef USE_DRI
 | 
				
			||||||
	if (atis->using_dri)
 | 
						if (atis->using_dri)
 | 
				
			||||||
		ATIDRIDMAStart(pScreen);
 | 
							ATIDRIDMAStart(atis);
 | 
				
			||||||
#endif /* USE_DRI */
 | 
					#endif /* USE_DRI */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!atis->using_dri) {
 | 
						if (!atis->using_dri) {
 | 
				
			||||||
| 
						 | 
					@ -981,7 +987,7 @@ ATIDMATeardown(ScreenPtr pScreen)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef USE_DRI
 | 
					#ifdef USE_DRI
 | 
				
			||||||
	if (atis->using_dri)
 | 
						if (atis->using_dri)
 | 
				
			||||||
		ATIDRIDMAStop(pScreen);
 | 
							ATIDRIDMAStop(atis);
 | 
				
			||||||
#endif /* USE_DRI */
 | 
					#endif /* USE_DRI */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (atis->using_dma)
 | 
						if (atis->using_dma)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1033,11 +1033,9 @@ ATIDRICloseScreen(ScreenPtr pScreen)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ATIDRIDMAStart(ScreenPtr pScreen)
 | 
					ATIDRIDMAStart(ATIScreenInfo *atis)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	KdScreenPriv(pScreen);
 | 
						ATICardInfo *atic = atis->atic;
 | 
				
			||||||
	ATICardInfo(pScreenPriv);
 | 
					 | 
				
			||||||
	ATIScreenInfo(pScreenPriv);
 | 
					 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (atic->is_radeon)
 | 
						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.
 | 
					 * same for both R128 and Radeon, so we can just use the name of one of them.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ATIDRIDMAStop(ScreenPtr pScreen)
 | 
					ATIDRIDMAStop(ATIScreenInfo *atis)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	KdScreenPriv(pScreen);
 | 
						ATICardInfo *atic = atis->atic;
 | 
				
			||||||
	ATICardInfo(pScreenPriv);
 | 
					 | 
				
			||||||
	ATIScreenInfo(pScreenPriv);
 | 
					 | 
				
			||||||
	drmRadeonCPStop stop;
 | 
						drmRadeonCPStop stop;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1078,6 +1074,21 @@ ATIDRIDMAStop(ScreenPtr pScreen)
 | 
				
			||||||
	atis->dma_started = FALSE;
 | 
						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 */
 | 
					/* The R128 and Radeon Indirect ioctls differ only in the ioctl number */
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
ATIDRIDispatchIndirect(ATIScreenInfo *atis, Bool discard)
 | 
					ATIDRIDispatchIndirect(ATIScreenInfo *atis, Bool discard)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue