Commit 5fce682f authored by Alexandre Julliard's avatar Alexandre Julliard

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

Based on a patch by Lei Zhang.
parent 9d2d5eae
......@@ -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;
......
......@@ -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)); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment