summaryrefslogtreecommitdiffstats
path: root/src/glx/glxclient.h
Commit message (Collapse)AuthorAgeFilesLines
* glx: Prepare driFetchDrawable for no-config contextsAdam Jackson2017-12-011-0/+4
| | | | | | | | | When we look up the DRI drawable state we need to associate an fbconfig with the drawable. With GLX_EXT_no_config_context we can no longer infer that from the context and must instead query the server. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* EGL: Implement the libglvnd interface for EGL (v3)Kyle Brenneman2017-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The new interface mostly just sits on top of the existing library. The only change to the existing EGL code is to split the client extension string into platform extensions and everything else. On non-glvnd builds, eglQueryString will just concatenate the two strings. The EGL dispatch stubs are all generated. The script is based on the one used to generate entrypoints in libglvnd itself. v2: [Kyle] - Rebased against master. - Reworked the EGL makefile to use separate libraries - Made the EGL code generation scripts work with Python 2 and 3. - Change gen_egl_dispatch.py to use argparse for the command line arguments. - Assorted formatting and style cleanup in the Python scripts. v3: [Emil Velikov] - Rebase - Remove separate glvnd glx/egl configure toggles Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* direct-to-native-GL for GLX clients on Cygwin ("Windows-DRI")Jon Turney2016-09-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Structurally, this is very similar to the existing Apple-DRI code, except I have chosen to implement this using the __GLXDRIdisplay, etc. vtables (as suggested originally in [1]), rather than a maze of ifdefs. This also means that LIBGL_ALWAYS_SOFTWARE and LIBGL_ALWAYS_INDIRECT work as expected. [1] https://lists.freedesktop.org/archives/mesa-dev/2010-May/000756.html This adds: * the Windows-DRI extension protocol headers and the windowsdriproto.pc file, for use in building the Windows-DRI extension for the X server * a Windows-DRI extension helper client library * a Windows-specific DRI implementation for GLX clients The server is queried for Windows-DRI extension support on the screen before using it (to detect the case where WGL is disabled or can't be activated). The server is queried for fbconfigID to pixelformatindex mapping, which is used to augment glx_config. The server is queried for a native handle for the drawable (which is of a different type for windows, pixmaps and pbuffers), which is used to augment __GLXDRIdrawable. Various GLX extensions are enabled depending on if the equivalent WGL extension is available.
* mesa_glinterop: remove mesa_glinterop typedefsEmil Velikov2016-05-301-6/+6
| | | | | | | | | | | | | | | | As is there are two places that do the typedefs - dri_interface.h and this header. As we cannot include the former in here, just drop the typedefs and use the struct directly (as needed). This is required because typedef redefinition is C11 feature which is not supported on all the versions of GCC used to build mesa. v2: Kill the typedef alltogether, as per Marek. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236 Cc: Vinson Lee <vlee@freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* glx: Implement the libglvnd interface.Kyle Brenneman2016-05-301-0/+5
| | | | | | | | | | | | | | | | With reference to the libglvnd branch: https://cgit.freedesktop.org/mesa/mesa/log/?h=libglvnd This is a squashed commit containing all of Kyle's commits, all but two of Emil's commits (to follow), and a small fixup from myself to mark the rest of the glX* functions as _GLX_PUBLIC so they are not exported when building for libglvnd. I (ajax) squashed them together both for ease of review, and because most of the changes are un-useful intermediate states representing the evolution of glvnd's internal API. Co-author: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* mesa_glinterop: make GL interop version field bidirectionalEmil Velikov2016-05-241-1/+1
| | | | | | | | | | | | | | This allows clear and easy communication between the two. Caller: Requesting information (struct vN) Callee: I know how to deal with older version (vN-1) only. Here is your data and the version I support. Caller: Older version ? Sure I'll cap all access to the fields provided by the older version (vN-1) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Tom Stellard <thomas.stellard@amd.com>
* glx: Don't enclose includes inside `extern "C" { }`.Jose Fonseca2016-04-261-0/+9
| | | | | | | | | Ran `make check` inside src/glx to verify everything compiles and links correctly. https://bugs.freedesktop.org/show_bug.cgi?id=95158 Reviewed-by: Brian Paul <brianp@vmware.com>
* glx: implement GLX part of interop interface (v2)Marek Olšák2016-04-201-0/+9
| | | | v2: - use const
* glx: remove support for non-multithreaded platformsEmil Velikov2015-03-111-17/+1
| | | | | | | | | Implicitly required for a while, although commit 9385c592c68 (mapi: remove u_thread.h) was the one that put the final nail on the coffin. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* Revert "glx: remove support for non-multithreaded platforms"Emil Velikov2015-03-061-1/+17
| | | | | | This reverts commit 38591295cd4b68f89f257b20f476f98de3772a47. Not meant to go in yet. Lacking review.
* glx: remove unneeded ifdef _WIN32 guardEmil Velikov2015-03-061-2/+0
| | | | | | | The C99 header exists on other platforms as well. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* glx: remove support for non-multithreaded platformsEmil Velikov2015-03-061-17/+1
| | | | | | | | Implicitly required for a while, although commit 9385c592c68 (mapi: remove u_thread.h) was the one that put the final nail on the coffin. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* glx: use ARRAY_SIZE from macros.hBrian Paul2015-03-041-1/+1
| | | | Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* glx: remove __glXstrdup()Juha-Pekka Heikkila2014-12-161-3/+0
| | | | | | | I didn't find this being used anywhere Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* dri3: Add GLX_EXT_buffer_age supportAdel Gadllah2014-03-131-0/+1
| | | | | | | | | | | v2: Indent according to Mesa style, reuse sbc instead of making a new swap_count field, and actually get a usable back before returning the age of the back (fixing updated piglit tests). Changes by anholt. Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com> Reviewed-by: Robert Bragg <robert@sixbynine.org> (v1) Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com> (v2) Reviewed-by: Eric Anholt <eric@anholt.net>
* glx: Simplify __glxGetMscRate, it only needs the screen, not a drawableLauri Kasanen2013-12-201-1/+1
| | | | | | | | | | Useful in its own right, but also needed for adaptive vsync. No regressions in the piglit glx-oml-sync-control-getmscrate test. Signed-off-by: Lauri Kasanen <cand@gmx.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Tested-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: change query_renderer_integer() value param to unsignedBrian Paul2013-11-111-1/+1
| | | | | | | | | When this function was added, the returned value was signed in some places, unsigned in others. v2: also add unsigned in the unit test, per Ian. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* Add DRI3+Present loaderKeith Packard2013-11-071-0/+2
| | | | | | | | | | | | Uses the __DRIimage loader interfaces. v2: Fix _XIOErrors when DRI3 isn't present (change by anholt). Apparently XCB just terminates your connection if you don't check for extensions before using them, instead of returning an error like you'd expect. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Eric Anholt <eric@anholt.net>
* glx: Add functions and GLX plumbing for GLX_MESA_query_rendererIan Romanick2013-11-071-1/+6
| | | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* glx: Validate the GLX_RENDER_TYPE valueTomasz Lis2013-07-181-0/+3
| | | | | | | | | | | | | Correctly handle the value of renderType in GLX context. In case of the value being incorrect, context creation fails. v2 (idr): indirect_create_context is just a memory allocator, so don't validate the GLX_RENDER_TYPE there. Fixes regressions in several GLX_ARB_create_context piglit tests. Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: Store the RENDER_TYPE in indirect renderingTomasz Lis2013-07-181-0/+7
| | | | | | | | | | | | v2 (idr): Open-code the check for GLX_RENDER_TYPE. dri2_convert_glx_attribs can't be called from here because that function only exists in direct-rendering builds. Also add a stub version of indirect_create_context_attribs to tests/fake_glx_screen.cpp to prevent 'make check' regressions. Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: move the glFlush call one layer downMarek Olšák2012-12-021-2/+2
|
* build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definitionMatt Turner2012-10-011-4/+4
|
* Use the correct macro _WIN32 for Windows.Vinson Lee2012-09-051-1/+1
| | | | | | | | | | | | | | The correct predefined macro for Windows is _WIN32, not WIN32 or __WIN32__. _WIN32 is defined for 32-bit and 64-bit version of Windows by both MSVC and MinGW compilers. http://sourceforge.net/p/predef/wiki/OperatingSystems http://msdn.microsoft.com/en-us/library/b0084kay.aspx This patch also fixes a MinGW automake build error. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
* glx: Don't use glapitable.h at allIan Romanick2012-08-081-1/+0
| | | | | | | | | | | | When --enable-shared-glapi is used, all non-ABI entries in the table are lies. Avoiding the use of glapitable.h avoids the lies. The only entries used in this code are entries that are ABI. For these, the ABI offset can be used directly. Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to get the pretty names for these offsets. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: Don't use 'new' as a function parameter nameIan Romanick2012-01-021-1/+1
| | | | | | | | Using 'new' as a function parameter name prevents including glxclient.h the unit tests (future patch) that use the Google C++ Testing Framework. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: Initial implementation of glXCreateContextAttribsARBIan Romanick2012-01-021-0/+2
| | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: Add glx_screen_vtable::create_context_attribsIan Romanick2012-01-021-0/+8
| | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: Add __glX_send_client_info super functionIan Romanick2012-01-021-0/+3
| | | | | | | | This function picks the correct client-info protocol (based on the server's GLX version and set of extensions) and sends it to the server. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* glx: Send DestroyContext protocol at the correct timesIan Romanick2011-12-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | Send the DestroyContext protocol immediately when glXDestroyContext is called, and never call it when glXFreeContextEXT is called. In both cases, either destroy the client-side structures or, if the context is current, set xid to None so that the client-side structures will be destroyed later. I believe this restores the behavior of the original SGI code. See src/glx/x11 around commit 5df82c8. The spec doesn't say anything about glXDestroyContext not really destroying imported contexts (it acts like glXFreeContextEXT instead), but that's what the original code did. Note that glXFreeContextEXT on a non-imported context does not destroy it either. Fixes the piglit test glx-free-context. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* GLX/DRI2: handle swap event swap count wrappingJesse Barnes2011-07-081-0/+16
| | | | | | | | | | | Create a new GLX drawable struct to track client related info, and add a wrap counter to it drawable and track it as we receive events. This allows us to support the full 64 bits of the event structure we pass to the client even though the server only gives us a 32 bit count. Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
* glx: Allow a context-specific fallback for glXGetProcAddressJeremy Huddleston2011-06-201-1/+1
| | | | | | | | In applegl, GLX advertises the same extensions provided by OpenGL.framework even if such extensions are not provided by glapi. This allows a client to get access to such API. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* glx: implement drawable refcounting.Stéphane Marchesin2011-06-171-0/+1
| | | | | | | | | | | | The current dri context unbind logic will leak drawables until the process dies (they will then get released by the GEM code). There are two ways to fix this: either always call driReleaseDrawables every time we unbind a context (but that costs us round trips to the X server at getbuffers() time) or implement proper drawable refcounting. This patch implements the latter. Signed-off-by: Antoine Labour <piman@chromium.org> Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
* apple: Dead code removalJeremy Huddleston2011-06-131-1/+0
| | | | Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* apple: Build darwin using applegl rather than indirectJeremy Huddleston2011-06-051-0/+12
| | | | | | | | | | This reverts portions of 6849916170c0275c13510251a7b217c20f2b993e that caused the darwin config to fail to build due to missing implementations in that commit. See https://bugs.freedesktop.org/show_bug.cgi?id=29162 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* apple: Re-add driContext and do_destroyJeremy Huddleston2011-06-051-0/+5
| | | | | | Fixes regression introduced by: c491e585e43d48a2aeec96ccc4008da6c443fb42 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* glx: Remove (unused, broken) fastImageUnpack fast pathAdam Jackson2011-06-021-8/+0
| | | | | Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* mesa: Add new MESA_multithread_makecurrent extension.Eric Anholt2011-02-261-2/+2
| | | | | | | This extension allows a client to bind one context in multiple threads simultaneously. It is then up to the client to manage synchronization of access to the GL, just as normal multithreaded GL from multiple contexts requires synchronization management to shared objects.
* glx: Fix leaks in DRI2 screen creation error paths.Henri Verbeet2011-01-311-0/+2
| | | | Signed-off-by: Brian Paul <brianp@vmware.com>
* glx: remove duplicated includeNicolas Kaiser2010-09-301-2/+0
| | | | | | Remove duplicated include. Signed-off-by: Brian Paul <brianp@vmware.com>
* glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x buildLuca Barbieri2010-09-221-0/+1
| | | | | | | | | | | | | | | The Gallium EGL state tracker reuses dri2.c but not the GLX code. Currently there is a bit of code in dri2.c that is incorrectly tied to GLX: instead, make it call an helper that both GLX and Gallium EGL implement, like dri2InvalidateBuffers. This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId is undefined. Note that we might want to move the whole event translation elsewhere, and probably stop using non-XCB DRI2 altogether, but this seems to be the minimal fix.
* glx: Set an all NULL vtable for dummyContextKristian Høgsberg2010-09-071-2/+2
| | | | | | This reverts 6a6e6d7b0a84e20f9754af02a575ae34081d310c and initializes dummyContext with an all NULL vtable. The context vtable pointer is supposed to always be non-NULL, but the vtable entries can be NULL.
* glx: Move dpy and scr fields out of direct rendering conditionalKristian Høgsberg2010-09-071-3/+3
| | | | | | | Nothing direct rendering specific about these fields. Moving them out makes no-direct-rendering compilation work again. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
* glx: Compare old ctx against dummyCtx, not NULLKristian Høgsberg2010-07-291-0/+2
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=29302
* glx: Split indirect and applegl implementations into different filesKristian Høgsberg2010-07-281-5/+4
|
* glx: Move bind and unbind to context vtableKristian Høgsberg2010-07-281-17/+8
|
* glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types.Kristian Høgsberg2010-07-281-39/+39
|
* glx: Rename __GLXscreenConfigs to struct glx_screenKristian Høgsberg2010-07-281-16/+15
| | | | Because double underscores in private type names is painful.
* glx: Use _X_EXPORT instead of our own PUBLIC macroKristian Høgsberg2010-07-281-18/+1
| | | | We're an X client library, so we can use Xfuncproto.h.
* glx: Rename glcontextmodes.[ch] to glxconfig.[ch]Kristian Høgsberg2010-07-281-1/+1
|