[Mesa-dev] Mismatch between Mesas dispatch table and the one used by the X server
stefan.bruens at rwth-aachen.de
Wed Mar 20 15:58:53 PDT 2013
On Wednesday 20 March 2013 15:47:24 you wrote:
> On 03/20/2013 02:43 PM, Stefan Brüns wrote:
> > On Tuesday 12 March 2013 09:25:07 Ian Romanick wrote:
> >> On 03/10/2013 11:24 AM, Stefan Brüns wrote:
> >>> Hi everyone,
> >>> I have run into a problem leading to a crashing X server for a bunch of
> >>> indirect GLX calls.
> >>> This problem affects any OpenGL clients using indirect rendering and
> >>> calling functions which are outside the ABI. Problems range from
> >>> malfunctioning to crashes.
> >>> Problem analysis:
> >>> The dispatcher functions in glx/indirect_dispatch.c demarshall the
> >>> function
> >>> arguments from the GLX wire protocol and then call the appropriate
> >>> function of the GL library. Function calls are done using dispatch table
> >>> with the help of the CALL_* helper macros defined in dispatch.h.
> >>> Unfortunately there is a mismatch between the dispatch table expected by
> >>> the xserver - which follows the layout e.g. found in glapitable.h - and
> >>> the one provided by the GL library, e.g. Mesa.
> >> The dependency is the other way around. The loader (either libGL on the
> >> client or the GLX extension in the server) dictates the layout of the
> >> dispatch table. The GL driver is required to adapt to the layout
> >> dictated by the loader. That's the whole reason the remap table exists.
> >> The driver queries the loader to learn where functions are located in
> >> the dispatch table. It then stores the dispatch table locations at
> >> (fixed) locations in the remap table. So, the driver knows that glFoo
> >> is at location 824 in the remap table, and that entry stores the
> >> location of glFoo in the dispatch table.
> >> It sounds like something else is going wrong.
> > Currently this obviously can not work.
> > The remap table is only used when FEATURE_remap_table is defined, which
> > for
> > the X server is never true.
> > Now, lets try defining FEATURE_remap_table for the xserver (which breaks
> > OS X and windows builds of Mesa, but anyway ...)
> Xserver has nothing to do with it. The remap table is entirely in the
> driver (*_dri.so). The xserver has no knowledge about the remap table
> whatsoever. The xserver only knows about the dispatch table, and it
> dictates where things are in that table.
> It's been a long time since I wrote this code, but I haven't been able
> to kill of all the memories of it yet. :)
Please, look at the code again as I have done!
The x server code found in xorg/glx/indirect_dispatch.c directly call into the
dispatch table, and it uses the offsets found in xorg/glx/dispatch.h
Stefan Brüns / Bergstraße 21 / 52062 Aachen
phone: +49 241 53809034 mobile: +49 151 50412019
More information about the mesa-dev