On 08/30/2017 12:58 PM, Adam Jackson wrote:
From: Kyle Brenneman <[email protected]> This is based on an out-of-tree module written by Kyle: https://github.com/kbrenneman/libglvnd/tree/server-libglx I (ajax) did a bunch of cosmetic fixes, ported it off xfree86 API, added request length checks, and fixed a minor bug or two. Signed-off-by: Adam Jackson <[email protected]> --- glx/meson.build | 21 ++ glx/vnd_dispatch_stubs.c | 510 +++++++++++++++++++++++++++++++++++++++++++++++ glx/vndcmds.c | 479 ++++++++++++++++++++++++++++++++++++++++++++ glx/vndext.c | 265 ++++++++++++++++++++++++ glx/vndserver.h | 117 +++++++++++ glx/vndservermapping.c | 196 ++++++++++++++++++ glx/vndservervendor.c | 91 +++++++++ glx/vndservervendor.h | 68 +++++++ include/Makefile.am | 1 + include/glxvndabi.h | 279 ++++++++++++++++++++++++++ include/meson.build | 1 + 11 files changed, 2028 insertions(+) create mode 100644 glx/vnd_dispatch_stubs.c create mode 100644 glx/vndcmds.c create mode 100644 glx/vndext.c create mode 100644 glx/vndserver.h create mode 100644 glx/vndservermapping.c create mode 100644 glx/vndservervendor.c create mode 100644 glx/vndservervendor.h create mode 100644 include/glxvndabi.h
Note that there's a few parts of that interface that I'm still working on, so I wouldn't mind some feedback on what people think about it. Off the top of my head:
The allocateServerImports and freeServerImports functions are there to make it easier to extend the GlxServerImports struct later without breaking backward compatibility. Would it be better/easier to just give the expected size of the GlxServerImports struct and let the caller allocate it?
The getVendorForScreen function takes a ClientPtr parameter. I included that so that at some point in the future, it might be able to handle different (screen -> vendor) mappings for different clients. But, that means it doesn't match up with the setScreenVendor function. I'm not sure what the best solution is here.
Passing the vendor-private pointer in and out of GlxServerImports::makeCurrent as a pointer and pointer-to-pointer feels awkward to me, but I haven't come up with anything better yet. It also doesn't have any way to change the pointer before the next makeCurrent call, though I don't know if that's likely to be needed.
Also worth noting is that in the libglvnd tree, I've got a script to generate the dispatch stubs in vnd_dispatch_stubs.c.
-Kyle _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
