GLX: Add a per-client vendor mapping.
Each client now has its own (screen, vendor) mapping.
Currently, it's just a copy of the global mapping, but later changes will allow
it to change.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 37a36a6b5b)
			
			
This commit is contained in:
		
							parent
							
								
									82f01ad786
								
							
						
					
					
						commit
						1fdb7cbce5
					
				
							
								
								
									
										11
									
								
								glx/vndext.c
								
								
								
								
							
							
						
						
									
										11
									
								
								glx/vndext.c
								
								
								
								
							|  | @ -139,8 +139,17 @@ GlxGetClientData(ClientPtr client) | |||
| { | ||||
|     GlxClientPriv *cl = xglvGetClientPrivate(client); | ||||
|     if (cl == NULL) { | ||||
|         cl = calloc(1, sizeof(GlxClientPriv)); | ||||
|         cl = calloc(1, sizeof(GlxClientPriv) | ||||
|                 + screenInfo.numScreens * sizeof(GlxServerVendor *)); | ||||
|         if (cl != NULL) { | ||||
|             int i; | ||||
| 
 | ||||
|             cl->vendors = (GlxServerVendor **) (cl + 1); | ||||
|             for (i=0; i<screenInfo.numScreens; i++) | ||||
|             { | ||||
|                 cl->vendors[i] = GlxGetVendorForScreen(NULL, screenInfo.screens[i]); | ||||
|             } | ||||
| 
 | ||||
|             xglvSetClientPrivate(client, cl); | ||||
|         } | ||||
|     } | ||||
|  |  | |||
|  | @ -57,6 +57,11 @@ typedef struct GlxContextTagInfoRec { | |||
| typedef struct GlxClientPrivRec { | ||||
|     GlxContextTagInfo *contextTags; | ||||
|     unsigned int contextTagCount; | ||||
| 
 | ||||
|     /**
 | ||||
|      * The vendor handles for each screen. | ||||
|      */ | ||||
|     GlxServerVendor **vendors; | ||||
| } GlxClientPriv; | ||||
| 
 | ||||
| extern int GlxErrorBase; | ||||
|  |  | |||
|  | @ -187,6 +187,16 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor) | |||
| 
 | ||||
| GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) | ||||
| { | ||||
|     // Note that the client won't be sending GPU screen numbers, so we don't
 | ||||
|     // need per-client mappings for them.
 | ||||
|     if (client != NULL && !screen->isGPU) { | ||||
|         GlxClientPriv *cl = GlxGetClientData(client); | ||||
|         if (cl != NULL) { | ||||
|             return cl->vendors[screen->myNum]; | ||||
|         } else { | ||||
|             return NULL; | ||||
|         } | ||||
|     } else { | ||||
|         GlxScreenPriv *priv = GlxGetScreen(screen); | ||||
|         if (priv != NULL) { | ||||
|             return priv->vendor; | ||||
|  | @ -194,3 +204,4 @@ GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen) | |||
|             return NULL; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue