@@ -118,10 +118,6 @@ static DevPrivateKeyRec XvScreenKeyRec;
118118
119119Bool noXvExtension = FALSE;
120120
121- static x_server_generation_t XvExtensionGeneration = 0 ;
122- static x_server_generation_t XvScreenGeneration = 0 ;
123- static x_server_generation_t XvResourceGeneration = 0 ;
124-
125121int XvReqCode ;
126122static int XvEventBase ;
127123int XvErrorBase ;
@@ -168,50 +164,37 @@ XvExtensionInit(void)
168164
169165 /* Look to see if any screens were initialized; if not then
170166 init global variables so the extension can function */
171- if (XvScreenGeneration != serverGeneration ) {
172- if (!CreateResourceTypes ()) {
173- ErrorF ("XvExtensionInit: Unable to allocate resource types\n" );
174- return ;
175- }
167+ if (!CreateResourceTypes ()) {
168+ ErrorF ("XvExtensionInit: Unable to allocate resource types\n" );
169+ return ;
170+ }
176171#ifdef XINERAMA
177- XineramaRegisterConnectionBlockCallback (XineramifyXv );
172+ XineramaRegisterConnectionBlockCallback (XineramifyXv );
178173#endif /* XINERAMA */
179- XvScreenGeneration = serverGeneration ;
180- }
181174
182- if (XvExtensionGeneration != serverGeneration ) {
183- XvExtensionGeneration = serverGeneration ;
184-
185- extEntry = AddExtension (XvName , XvNumEvents , XvNumErrors ,
186- ProcXvDispatch , ProcXvDispatch ,
187- XvResetProc , StandardMinorOpcode );
188- if (!extEntry ) {
189- FatalError ("XvExtensionInit: AddExtensions failed\n" );
190- }
175+ extEntry = AddExtension (XvName , XvNumEvents , XvNumErrors ,
176+ ProcXvDispatch , ProcXvDispatch ,
177+ XvResetProc , StandardMinorOpcode );
178+ if (!extEntry ) {
179+ FatalError ("XvExtensionInit: AddExtensions failed\n" );
180+ }
191181
192- XvReqCode = extEntry -> base ;
193- XvEventBase = extEntry -> eventBase ;
194- XvErrorBase = extEntry -> errorBase ;
182+ XvReqCode = extEntry -> base ;
183+ XvEventBase = extEntry -> eventBase ;
184+ XvErrorBase = extEntry -> errorBase ;
195185
196- EventSwapVector [XvEventBase + XvVideoNotify ] =
186+ EventSwapVector [XvEventBase + XvVideoNotify ] =
197187 (EventSwapPtr ) WriteSwappedVideoNotifyEvent ;
198- EventSwapVector [XvEventBase + XvPortNotify ] =
188+ EventSwapVector [XvEventBase + XvPortNotify ] =
199189 (EventSwapPtr ) WriteSwappedPortNotifyEvent ;
200190
201- SetResourceTypeErrorValue (XvRTPort , _XvBadPort );
202- (void ) dixAddAtom (XvName );
203- }
191+ SetResourceTypeErrorValue (XvRTPort , _XvBadPort );
192+ (void ) dixAddAtom (XvName );
204193}
205194
206195static Bool
207196CreateResourceTypes (void )
208197{
209-
210- if (XvResourceGeneration == serverGeneration )
211- return TRUE;
212-
213- XvResourceGeneration = serverGeneration ;
214-
215198 if (!(XvRTPort = CreateNewResourceType (XvdiDestroyPort , "XvRTPort" ))) {
216199 ErrorF ("CreateResourceTypes: failed to allocate port resource.\n" );
217200 return FALSE;
@@ -252,7 +235,6 @@ CreateResourceTypes(void)
252235 }
253236
254237 return TRUE;
255-
256238}
257239
258240static void XvWindowDestroy (CallbackListPtr * pcbl , ScreenPtr pScreen , WindowPtr pWin )
@@ -268,16 +250,13 @@ static void XvPixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr
268250int
269251XvScreenInit (ScreenPtr pScreen )
270252{
271- if (XvScreenGeneration != serverGeneration ) {
272- if (!CreateResourceTypes ()) {
273- ErrorF ("XvScreenInit: Unable to allocate resource types\n" );
274- return BadAlloc ;
275- }
253+ if (!CreateResourceTypes ()) {
254+ ErrorF ("XvScreenInit: Unable to allocate resource types\n" );
255+ return BadAlloc ;
256+ }
276257#ifdef XINERAMA
277- XineramaRegisterConnectionBlockCallback (XineramifyXv );
258+ XineramaRegisterConnectionBlockCallback (XineramifyXv );
278259#endif /* XINERAMA */
279- XvScreenGeneration = serverGeneration ;
280- }
281260
282261 if (!dixRegisterPrivateKey (& XvScreenKeyRec , PRIVATE_SCREEN , sizeof (XvScreenRec )))
283262 return BadAlloc ;
0 commit comments