winex11.drv: Added a check for the ATI driver corrupting %fs.

Based on a patch by Lei Zhang.
This commit is contained in:
Alexandre Julliard 2007-02-14 18:18:07 +01:00
parent 9d2d5eae2d
commit 5fce682f41
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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)); }