Summary: | MakeContextCurrent may use the wrong opcode | ||
---|---|---|---|
Product: | Mesa | Reporter: | Jamey Sharp <jamey> |
Component: | GLX | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | high | CC: | the3dfxdude |
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Major clean up of MakeContextCurrent
Small test app for glXMakeCurrent currentContextTag patch version 1 currentContextTag patch version 2 Don't use currentContextTag from a direct context |
Description
Jamey Sharp
2006-09-27 15:54:07 UTC
I've checked in your fix. Thanks. That fix actually makes things worse. On the first call to glXMakeCurrent, the current context is set to &dummyContext. dummyContext.currentDpy is NULL, so the call to __glXSetupForCommand segfaults. I added a "&& oldGC != &dummyContext" to the condition, and that makes the segfault go away. That routine is a great big mess, so I'm going to see if I can clean it up a bit before I actually commit anything. Watch this space for patches. Created attachment 7271 [details] [review] Major clean up of MakeContextCurrent Rearrange most of the internals of MakeContextCurrent. Put all of the code to bind the new context up front. If that is successful, unbind the old context. This saves a lot of code and removes some locking crazyiness. This patch has been tested for indirect rendering with glxinfo, glxgears, manywin, and wincopy. You might as well check this in, Ian, so that it gets exercised. Re-closing. I committed a slightly modified version of patch #7271. Ian, I'm seeing a problem with this call: pglXMakeCurrent(gdi_display, None, NULL); produces: X Error of failed request: GLXBadContextTag Major opcode of failed request: 143 (GLX) Minor opcode of failed request: 5 (X_GLXMakeCurrent) Serial number of failed request: 25 Current serial number in output stream: 25 It's found in the wine source tree under dlls/winex11.drv/opengl.c:308. It used to work. Created attachment 7411 [details]
Small test app for glXMakeCurrent
This is a small test app showing my problem so you don't have to run Wine.
Created attachment 7427 [details] [review] currentContextTag patch version 1 Created attachment 7428 [details] [review] currentContextTag patch version 2 Created attachment 7429 [details] [review] Don't use currentContextTag from a direct context -1 is used as the currentContextTag of direct rendering contexts to indicate that the context does not have a valid currentContextTag from the point of view of the server. I believe the correct solution is to detect the oldGC->isDirect case in the call to SendMakeCurrentRequest and use None as the old context tag. This patch implements that. Please let me know if this works. It works thanks. 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.