Nickolay Kolchin
09-29-2006, 02:10 PM
Hello,
I have a weird problem with multithread application on i915 chipset (i810 DRI driver). Application segfaults when trying to use OpenGL functions from second thread.
All necessary initialization is perfomed in application, ie XInitThreads, etc.
Tested on Suse 10.1 (xorg 6.8, 20050225 i810 driver) and Gentoo LiveDVD (xorg 7.0, 1.4.2 i810 driver).
This code works fine with NVidia drivers.
Is this a driver bug? a Mesa bug? a well-known bug that nobody is going to fix in near future? Or this is my programming error?
static void* cbOpenglTest1(void*)
{
while(1)
{
XLockDisplay(display);
if(!glXMakeCurrent(display, x_win, x_glxContext))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
int err = glGetError();
L_INFO("OpenGL Error: %i", err);
if(!glXMakeCurrent(display, 0, 0))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
XUnlockDisplay(display);
usleep(100);
}
return 0;
}
static void Expose()
{
XLockDisplay(display);
if(!glXMakeCurrent(display, win, glxContext))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glRectf(-0.5, -0.5, 0.5, 0.5);
swapBuffers();
if(!glXMakeCurrent(display, 0, 0))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
XUnlockDisplay(display);
}--
Nickolay
I have a weird problem with multithread application on i915 chipset (i810 DRI driver). Application segfaults when trying to use OpenGL functions from second thread.
All necessary initialization is perfomed in application, ie XInitThreads, etc.
Tested on Suse 10.1 (xorg 6.8, 20050225 i810 driver) and Gentoo LiveDVD (xorg 7.0, 1.4.2 i810 driver).
This code works fine with NVidia drivers.
Is this a driver bug? a Mesa bug? a well-known bug that nobody is going to fix in near future? Or this is my programming error?
static void* cbOpenglTest1(void*)
{
while(1)
{
XLockDisplay(display);
if(!glXMakeCurrent(display, x_win, x_glxContext))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
int err = glGetError();
L_INFO("OpenGL Error: %i", err);
if(!glXMakeCurrent(display, 0, 0))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
XUnlockDisplay(display);
usleep(100);
}
return 0;
}
static void Expose()
{
XLockDisplay(display);
if(!glXMakeCurrent(display, win, glxContext))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glRectf(-0.5, -0.5, 0.5, 0.5);
swapBuffers();
if(!glXMakeCurrent(display, 0, 0))
{
printf("glXMakeCurrent failed\n");
exit(0);
}
XUnlockDisplay(display);
}--
Nickolay