diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index ac0c8ba51e1..dbbd9727e78 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -292,8 +292,17 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void) template.visualid = XVisualIDFromVisual(visual); vis = XGetVisualInfo(gdi_display, VisualIDMask, &template, &num); if (vis) { + WORD old_fs = wine_get_fs(); /* Create a GLX Context. Without one we can't query GL information */ ctx = pglXCreateContext(gdi_display, vis, None, GL_TRUE); + if (wine_get_fs() != old_fs) + { + wine_set_fs( old_fs ); + wine_tsx11_unlock(); + ERR( "%%fs register corrupted, probably broken ATI driver, disabling OpenGL.\n" ); + ERR( "You need to set the \"UseFastTls\" option to \"2\" in your X config file.\n" ); + return FALSE; + } } if (ctx) { @@ -411,7 +420,6 @@ LOAD_FUNCPTR(glXFreeMemoryNV) #undef LOAD_FUNCPTR if(!X11DRV_WineGL_InitOpenglInfo()) { - ERR("Intialization of OpenGL info failed, disabling OpenGL!\n"); wine_dlclose(opengl_handle, NULL, 0); opengl_handle = NULL; return FALSE; diff --git a/include/wine/library.h b/include/wine/library.h index cbaa0263c52..a1845cdcf12 100644 --- a/include/wine/library.h +++ b/include/wine/library.h @@ -177,7 +177,7 @@ inline static int wine_ldt_is_empty( const LDT_ENTRY *ent ) # define __DEFINE_GET_SEG(seg) \ extern inline unsigned short wine_get_##seg(void); \ extern inline unsigned short wine_get_##seg(void) \ - { unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; } + { unsigned short res; __asm__ __volatile__("movw %%" #seg ",%w0" : "=r"(res)); return res; } # define __DEFINE_SET_SEG(seg) \ extern inline void wine_set_##seg(int val); \ extern inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }