From: Brian P. <br...@tu...> - 2002-08-16 16:36:15
|
Vedran Rodic wrote: > On Tue, Aug 13, 2002 at 12:07:42PM -0700, Waldo Bastian wrote: > >>You don't really expect us to use different Qt libs for each feature, do you? >>The question then becomes why glx is being initialized when it isn't used. I >>have no knowledge about glx so I can't answer that. I only know that KDE >>doesn't do anything with it in general. I can't speak for the Qt side of >>things. (You should contact TrollTech for that) > > > I've looked at this and found that QT is calling glXGetConfig in > src/kernel/qapplication_x11.cpp (search for "If we are using OpenGL widgets") > to find out if the visual it initialy selected is GL enabled. > If it isn't, it scans through available visuals to find one that is. > This seems perfectly legit thing to do. Wine does a similiar thing. > > I've removed the code section that calls glXGetConfig, started KDE 3 CVS > and my radeon module use count is 1. It used to be arround 11 after > KDE started. > > glXGetConfig calls __glXInitialize that calls driCreateDisplay that > eventually opens /dev/dri/card?. > > I'm not sure what to do about this. > > Seems to me that if we want swsuspend with KDE, 3D clients and whatnot > we'll have to do something similiar to reinit branch for the other remaining > DRM client (Mesa DRI). Doesn't KDE use a funky library loading system to reduce program start-up time? If so, is libGL actually getting loaded before the application starts? Otherwise, the question might be whether we could avoid DRI initialization if only glXGetConfig() is being called. If you look at the libGL code you'll see at almost all of the public GLX functions begin by calling the __glXInitialize() function. One of the things this function does is query the server for all GL/X visual information. A local copy of this is kept by libGL. Also during this process, we do per-screen initialization. This is when the DRI createScreen() function is called. This starts the DRI initialization process. The question is whether we could modify glXGetConfig() to avoid doing DRI initialization. I think it's possible because the glXGetConfig() function can do it's job without requiring the DRI. However, it could be a tricky programming project. I'd hesitate to tackle it before I fully understood the Qt/KDE issues. -Brian |