| Summary: | i810: Setting GL_TEXTURE_LOD_BIAS_EXT can cause a segfault. | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | James Damour <James.Damour> |
| Component: | Drivers/DRI/i810 | Assignee: | Default DRI bug account <dri-devel> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | medium | ||
| Version: | git | ||
| Hardware: | x86 (IA32) | ||
| OS: | Linux (All) | ||
| URL: | http://sourceforge.net/tracker/index.php?func=detail&aid=1194546&group_id=31763&atid=403301 | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
A fix has been committed to Mesa CVS. It will be included in the 6.3.2 release, and it will also be in X.org 6.9 / 7.0. I also added a simple regression test for this bug, which is located in progs/tests/bug_3195.c. Mass version move, cvs -> git |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
When I try to set the GL_TEXTURE_LOD_BIAS_EXT of my OpenGL environment with the following line, the Intel 810 driver (extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c) sometimes suffers a segmentation fault: glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, -1.2); Sadly, I can't seem to manufacture a simple test case. This may *well* be due to pilot error; if so, I'd appreciate any advice on correctly initializing the texture environment. Still, I expect that OpenGL drivers should never cause a segmentation fault when setting a parameter value, so I'm submitting this report. I can work around the problem by adding the following code: + if (!glIsEnabled(GL_TEXTURE_2D)) + { + glEnable(GL_TEXTURE_2D); + glClear(0); + glDisable(GL_TEXTURE_2D); + } glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, -1.2); The following patch should avoid the segmentation fault altogether: ---cut here--- cvs diff -u ./xorg/xc/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c Index: ./xorg/xc/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c =================================================================== RCS file: /cvs/xorg/xc/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 i810tex.c --- ./xorg/xc/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c 16 Jun 2004 09:18:05 -0000 1.1.1.1 +++ ./xorg/xc/extras/Mesa/src/mesa/drivers/dri/i810/i810tex.c 3 May 2005 20:14:32 -0000 @@ -319,9 +319,11 @@ case GL_TEXTURE_LOD_BIAS_EXT: { struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; - i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData; - t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK); - t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(*param); + if (tObj) { + i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData; + t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK); + t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(*param); + } } break; ---cut here---