present: disable page flip only when a slave crtc is active
This prevents the tearing of moving window in a composite WM desktop when output slave is attached but none of its crtc is really active. Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
		
							parent
							
								
									45e0eb4b15
								
							
						
					
					
						commit
						bb9128fdc8
					
				| 
						 | 
				
			
			@ -117,6 +117,18 @@ present_flip_pending_pixmap(ScreenPtr screen)
 | 
			
		|||
    return screen_priv->flip_pending->pixmap;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static Bool
 | 
			
		||||
present_check_output_slaves_active(ScreenPtr pScreen)
 | 
			
		||||
{
 | 
			
		||||
    ScreenPtr pSlave;
 | 
			
		||||
 | 
			
		||||
    xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) {
 | 
			
		||||
        if (RRHasScanoutPixmap(pSlave))
 | 
			
		||||
            return TRUE;
 | 
			
		||||
    }
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static Bool
 | 
			
		||||
present_check_flip(RRCrtcPtr    crtc,
 | 
			
		||||
                   WindowPtr    window,
 | 
			
		||||
| 
						 | 
				
			
			@ -145,7 +157,7 @@ present_check_flip(RRCrtcPtr    crtc,
 | 
			
		|||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
    /* Fail to flip if we have slave outputs */
 | 
			
		||||
    if (screen->output_slaves)
 | 
			
		||||
    if (screen->output_slaves && present_check_output_slaves_active(screen))
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
    /* Make sure the window hasn't been redirected with Composite */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue