Add DGAReInitModes in order to allow the driver to change the list of
supported DGA modes. (Part 1)
This commit is contained in:
		
							parent
							
								
									c1a2abadfb
								
							
						
					
					
						commit
						d91d18e1d6
					
				| 
						 | 
					@ -209,6 +209,7 @@ Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, 
 | 
					Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, 
 | 
				
			||||||
			int num);
 | 
								int num);
 | 
				
			||||||
 | 
					Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
 | 
				
			||||||
xf86SetDGAModeProc xf86SetDGAMode;
 | 
					xf86SetDGAModeProc xf86SetDGAMode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* xf86Events.c */
 | 
					/* xf86Events.c */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -170,6 +170,57 @@ DGAInit(
 | 
				
			||||||
    return TRUE;
 | 
					    return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* DGAReInitModes allows the driver to re-initialize
 | 
				
			||||||
 | 
					 * the DGA mode list.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Bool
 | 
				
			||||||
 | 
					DGAReInitModes(
 | 
				
			||||||
 | 
					   ScreenPtr pScreen,
 | 
				
			||||||
 | 
					   DGAModePtr modes,
 | 
				
			||||||
 | 
					   int num
 | 
				
			||||||
 | 
					){
 | 
				
			||||||
 | 
					    DGAScreenPtr pScreenPriv;
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* No DGA? Ignore call (but don't make it look like it failed) */
 | 
				
			||||||
 | 
					    if(DGAScreenIndex < 0)
 | 
				
			||||||
 | 
						return TRUE;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					    pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Same as above */
 | 
				
			||||||
 | 
					    if(!pScreenPriv)
 | 
				
			||||||
 | 
						return TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Can't do this while DGA is active */
 | 
				
			||||||
 | 
					    if(pScreenPriv->current)
 | 
				
			||||||
 | 
						return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Quick sanity check */
 | 
				
			||||||
 | 
					    if(!num) 
 | 
				
			||||||
 | 
						modes = NULL;
 | 
				
			||||||
 | 
					    else if(!modes) 
 | 
				
			||||||
 | 
						num = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pScreenPriv->numModes = num;
 | 
				
			||||||
 | 
					    pScreenPriv->modes = modes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* This practically disables DGA. So be it. */
 | 
				
			||||||
 | 
					    if(!num)
 | 
				
			||||||
 | 
						return TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i = 0; i < num; i++)
 | 
				
			||||||
 | 
						modes[i].num = i + 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef PANORAMIX
 | 
				
			||||||
 | 
					     if(!noPanoramiXExtension)
 | 
				
			||||||
 | 
						for(i = 0; i < num; i++)
 | 
				
			||||||
 | 
						    modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     return TRUE;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
FreeMarkedVisuals(ScreenPtr pScreen)
 | 
					FreeMarkedVisuals(ScreenPtr pScreen)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue