summaryrefslogtreecommitdiff
path: root/src/glx
AgeCommit message (Collapse)AuthorFilesLines
2017-04-07glx: silence uninitialized var warningBrian Paul1-1/+1
Signed-off-by: Brian Paul <brianp@vmware.com>
2017-03-28glx: Remove #include <GL/glxint.h>Adam Jackson1-1/+0
We're not using anything in it, and we don't want to inherit struct definitions from some other package anyway. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-03-23glx: Prefer library path given by pkgconfig over the systemTopi Pohjolainen1-0/+3
Recent change to use drmGetDevices2() made me realize that build configured using PKG_CONFIG_PATH=my_drm_lib_path/pkgconfig ./autogen.sh considers the libdrm path gotten from pkgconfig only during make. When invoking "make install" the relink command puts system library ahead of the path gotten from pkgconfig (and starts to fail as system libdrm isn't new enough). This change forces the relink command to respect pkgconfig settings. It looks to me that in https://bugs.freedesktop.org/show_bug.cgi?id=100259 with Emil et al considering it a libtool bug. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> [Emil Velikov: add inline comment] Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-16glx: Implement __DRI_BACKGROUND_CALLABLEPaul Berry2-1/+30
v2: Marek: Add DRI3 support. v3: (Timothy Arceri) use C99 initializers. Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Acked-by: Marek Olšák <maraeo@gmail.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Mike Lothian <mike@fireburn.co.uk>
2017-03-15glx: don't expose systemTimeExtension for DRI2/DRI3/DRISWEmil Velikov3-4/+0
Used/applicable to only dri1 drivers. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-02-28glx/tests: automake: add dispatch-index-check to the tarballEmil Velikov1-0/+1
Otherwise we'll fail at `make distcheck' Fixes: 3cc33e76401 ("glx: add GLXdispatchIndex sort check") Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-02-26check: add support for running test as standaloneEric Engestrom1-0/+5
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2017-02-26check: make any failure fatalEric Engestrom1-0/+1
Previously, only the last error code was returned. Using `set -e` makes the script quit on any unhandled error. Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2017-02-26check: mark two tests are requiring bashEric Engestrom1-1/+1
Requirement was removed just before pushing, but it's actually needed for heredocs (`<<<`). Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2017-02-24glx: add GLXdispatchIndex sort checkEric Engestrom2-1/+25
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-02-15glx/glvnd: Fix GLXdispatchIndex sortingHans de Goede1-4/+4
Commit 8bca8d89ef3b ("glx/glvnd: Fix dispatch function names and indices") fixed the sorting of the array initializers in g_glxglvnddispatchfuncs.c because FindGLXFunction's binary search needs these to be sorted alphabetically. That commit also mostly fixed the sorting of the DI_foo defines in g_glxglvnddispatchindices.h, which is what actually matters as the arrays are initialized using "[DI_foo] = glXfoo," but a small error crept in which at least causes glXGetVisualFromFBConfigSGIX to not resolve, breaking games such as "The Binding of Isaac: Rebirth" and "Crypt of the NecroDancer" from Steam not working and possible causes other problems too. This commit fixes the last of the sorting errors, fixing these mentioned games not working. Fixes: 8bca8d89ef3b ("glx/glvnd: Fix dispatch function names and indices") Cc: "13.0" <mesa-stable@lists.freedesktop.org> Cc: "17.0" <mesa-stable@lists.freedesktop.org> Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-02-13glx: remove always true XDAMAGE_1_1_INTERFACE guardEmil Velikov1-4/+0
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-02-13glx: remove DRI2DriverPrimeShift compile guardsEmil Velikov1-2/+0
DRI2DriverPrimeShift was added in dri2proto-2.8, which we now require as of the previous commit. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-02-13glx: remove always true ifdef guardsEmil Velikov1-4/+0
The two symbols referenced were introduced with v2.2 and 2.3 of the dri2proto package and we require dri2proto >= 2.6. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-02-06glx: guard swap-interval functions against destroyed drawablesNicolai Hähnle2-3/+19
The GLX specification says about glXDestroyPixmap: "The storage for the GLX pixmap will be freed when it is not current to any client." So arguably, functions like glXSwapIntervalMESA can be called after glXDestroyPixmap has been called for the currently bound GLXPixmap. In that case, the GLXDRIDrawable no longer exists, and so we just skip those calls. Cc: 17.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-02-06glx/dri3: guard in_current_context against a disappeared drawableNicolai Hähnle1-0/+4
Cc: 17.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-02-06glx/dri3: handle NULL pointers in loader-to-DRI3 drawable conversionNicolai Hähnle1-0/+2
With a subsequent patch, we might see NULL loaderPrivates, e.g. when a DRIdrawable is flushed whose corresponding GLXDRIdrawable was destroyed. This resulted in a crash, since the loader vs. DRI3 drawable structures have a non-zero offset. Fixes glx-visuals-{depth,stencil} -pixmap Cc: 17.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-27glx/windows: automake: include builddir prior to srcdirEmil Velikov1-1/+1
Analogous to previous commit. Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> Cc: Jon Turney <jon.turney@dronecode.org.uk> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-27glx/apple: automake: include builddir prior to srcdirEmil Velikov1-2/+2
Analogous to previous commit. Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> Cc: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jeremy Sequoia <jeremyhu@apple.com>
2017-01-27glx: automake: include builddir prior to srcdirEmil Velikov1-2/+2
Analogous to previous commit. Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-18glx: unify GLX_SGIX_pbuffer aliased declarationsEmil Velikov2-18/+0
No point in having an identical code in two places. Not to mention that the Apple one incorrectly uses GLXDrawable as pbuf type. This change is both API and ABI safe since the header uses the correct GLXPbufferSGIX and both types are a typedef of the same primitive XID. Cc: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jeremy Sequoia <jeremyhu@apple.com>
2017-01-18glx: use GLX_ALIAS for glXGetProcAddressEmil Velikov1-13/+4
Use the macro, rather than open-coding it. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-18mesa: make use of HAVE_FUNC_ATTRIBUTE_ALIAS macroEmil Velikov2-4/+4
We must make sure that xserver has an equivalent one-line change to its configure.ac as the glx/glapi headers get copied over. Then again, xserver does _not_ seem to set HAVE_ALIAS to begin with so one might want to look into that first. Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-18glx: remove always false ifdef GLX_NO_STATIC_EXTENSION_FUNCTIONSEmil Velikov1-5/+0
Quick search through git history (of both mesa and xserver) hows no instances where this was ever set. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-05dri3: Fix MakeCurrent without a default framebufferFredrik Höglund1-4/+10
In OpenGL 3.0 and later it is legal to make a context current without a default framebuffer. This has been broken since DRI3 support was introduced. Cc: "13.0 12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-11-15dri: make use of loader_get_extensions_name(..) helperChristian Gmeiner1-3/+2
Changes since v1: - removed not needed includes - use the loader version of the helper v2 [Emil Velikov] - Keep the includes - they are required. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-15Revert "dri: make use of dri_get_extensions_name(..) helper"Emil Velikov1-2/+3
This reverts commit 1a21d21580965eff751414d140b3c176eeee2eb3. Pushed the wrong version of the patch.
2016-11-15dri: make use of dri_get_extensions_name(..) helperChristian Gmeiner1-3/+2
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-04glx: make interop ABI visible againMarek Olšák1-2/+2
This was broken when the GLAPI use was removed from mesa_glinterop.h. Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-03glx/windows: Add wgl.h to the sources listAndreas Boll1-1/+2
Otherwise it won't be picked in the tarball and the build will fail. Fixes: 533b3530c12 ("direct-to-native-GL for GLX clients on Cygwin ("Windows-DRI")") Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-11-02glx/glvnd: Use bsearch() in FindGLXFunction instead of open-coding itAdam Jackson1-18/+16
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-11-02glx/glvnd: Fix dispatch function names and indicesAdam Jackson2-146/+144
As this array was not actually sorted, FindGLXFunction's binary search would only sometimes work. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-11-02glx/glvnd: Don't modify the dummy slot in the dispatch tableAdam Jackson1-0/+3
Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-10-18loader: remove loader_get_driver_for_fd() driver_typeEmil Velikov2-2/+2
Reminiscent from the pre-loader days, were we had multiple instances of the loader logic in separate places and one could build a "GALLIUM_ONLY" version. Since that is no longer the case and the loaders (glx/egl/gbm) do not (and should not) require to know any classic/gallium specific we can drop the argument and the related code. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-14loader/dri3: constify the loader_dri3_vtableEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-14glx: Perform check for valid fbconfig against proper X-Screen.Mario Kleiner1-2/+1
Commit cf804b4455fac9e585b3600a8318caaced9c23de ('glx: fix crash with bad fbconfig') introduced a check in glXCreateNewContext() if the given config is a valid fbconfig. Unfortunately the check always checks the given config against the fbconfigs of the DefaultScreen(dpy), instead of the actual X-Screen specified in the config config->screen. This leads to failure whenever a GL context is created on a non-DefaultScreen(dpy), e.g., on X-Screen 1 of a multi-x-screen setup, where the default screen is typically 0. Fix this by using config->screen instead of DefaultScreen(dpy). Tested to fix context creation failure on a dual-x-screen setup. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-07loader/dri3: add get_dri_screen() to the vtableMartin Peres1-0/+11
This allows querying the current active screen from the loader's common code. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
2016-10-06glx: rename choose_visual(), drop const argumentEmil Velikov1-15/+11
The function deals with fb (style) configs, thus using "visual" in the name is misleading. Which in itself had led to the use of fbconfig_style_tags argument. Rename the function to reflect what it does and drop the unneeded argument. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-10-06glx: return GL_FALSE from glx_screen_init where applicable.Emil Velikov1-2/+5
Return GL_FALSE if we fail to find any fb/visual configs, otherwise we end up with all sorts of chaos further down the GLX stack. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-10-06glx: correctly mask the drawableType for GLX_ARB_fbconfig_floatEmil Velikov1-1/+1
The comment/spec says - only for pbuffer drawables, while the code clears the window/pixmap bit. Practise what you preach and apply the trivial tweak. In practise this should not cause functional change. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-09-15direct-to-native-GL for GLX clients on Cygwin ("Windows-DRI")Jon Turney16-2/+2050
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.
2016-09-05glx/glvnd: list the strcmp arguments in correct orderEmil Velikov1-2/+2
Currently, due to the inverse order, strcmp will produce negative result when the needle is towards the start of the haystack. Thus on the next iteration(s) we'll end up further towards the end and eventually fail to locate the entry. Cc: "12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-08-17glx: Don't use current context in __glXSendErrorMichel Dänzer1-3/+1
There's no guarantee that there is one, and we don't need one anyway. Fixes piglit tests: glx@glx-fbconfig-bad glx@glx_ext_import_context@import context, multi process glx@glx_ext_import_context@import context, single process Fixes: 2e3f067458e4 ("glx: fix error code when there is no context bound") Cc: "11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2016-08-15glx: apple specific occurences of dummyContext checkTapani Pälli3-4/+4
Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Cc: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-08-15glx: fix error code when there is no context boundBernard Kilarski5-20/+33
v2: change all related NULL checks to check against dummyContext v3: really check for dummyContext *only* when ctx was from __glXGetCurrentContext v4: cover more checks, add dummyBuffer, dummyVtable (Emil) Signed-off-by: Bernard Kilarski <bernard.r.kilarski@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "11.2" <mesa-stable@lists.freedesktop.org>
2016-07-26glx: Avoid aliasing violations.Matt Turner2-24/+25
Compilers are perfectly capable of generating efficient code for calls like these to memcpy(). Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-07-20Avoid overflow in 'last' variable of FindGLXFunction(...)Stefan Dirsch1-3/+3
This 'last' variable used in FindGLXFunction(...) may become negative, but has been defined as unsigned int resulting in an overflow, finally resulting in a segfault when accessing _glXDispatchTableStrings[...]. Fixed this by definining it as signed int. 'first' variable also needs to be defined as signed int. Otherwise condition for while loop fails due to C implicitly converting signed to unsigned values before comparison. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Stefan Dirsch <sndirsch@suse.de> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-07-08glx: Fix for commit 2c86668694.Matt Turner1-0/+2
Ian suggested these changes in his review and I made them, but I pushed the old version of the patch.
2016-07-08glx: Undo memory allocation checking damage.Matt Turner1-5/+1
This partially reverts commit d41f5396f3cb619729021390c273f838d92f11fb. That untested commit broke the tex-skipped-unit piglit test and the arbvparray Mesa demo when run with indirect GLX. state->array_state is used during initialization, so its assignment cannot be moved to the end of the function. The backtrace looked like: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff77c7a5c in __glXGetActiveTextureUnit (state=0x6270e0) at indirect_vertex_array.c:1952 1952 return state->array_state->active_texture_unit; (gdb) bt 0 0x00007ffff77c7a5c in __glXGetActiveTextureUnit (state=0x6270e0) at indirect_vertex_array.c:1952 1 0x00007ffff77cbf62 in get_client_data (gc=0x626f50, cap=34018, data=0x7fffffffd7a0) at single2.c:159 2 0x00007ffff77cce51 in __indirect_glGetIntegerv (val=34018, i=0x7fffffffd830) at single2.c:498 3 0x00007ffff77c4340 in __glXInitVertexArrayState (gc=0x626f50) at indirect_vertex_array.c:193 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-07-08glx: Fix indirect multi-texture GL_DOUBLE coordinate arrays.Colin McDonald2-30/+50
There is no draw arrays protocol support for multi-texture coordinate arrays, so it is implemented by sending batches of immediate mode commands from emit_element_none in indirect_vertex_array.c. This sends the target texture unit (which has been previously setup in the array_state header field), followed by the texture coordinates. But for GL_DOUBLE coordinates the texture unit must be sent *after* the texture coordinates. This is documented in the glx protocol description, and can also be seen in the indirect.c immediate mode commands generated from gl_API.xml. Sending the target texture unit in the wrong place can crash the remote X server. To fix this required some more extensive changes to indirect_vertex_array.c and indirect_vertex_array_priv.h, in order to remove the texture unit value out of the array_state "header" field, and send it separately. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61907