summaryrefslogtreecommitdiff
path: root/src/glx
AgeCommit message (Collapse)AuthorFilesLines
2013-11-23glx: don't fail out when no configs if we have visualsDave Airlie1-1/+1
GLX 1.2 servers with no SGIX_fbconfigs exist (some citrix thing), and we fail glxinfo completely in those cases. CC: <mesa-stable@lists.freedesktop.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b01a3a9b72ed8d4899b4552658da7233c451142a)
2013-11-15dri: Remove redundant createNewContext function from __DRIimageDriverExtensionKristian Høgsberg1-45/+11
createContextAttribs is a superset of what createNewContext provides. Also remove the function typedef, since createNewContext is deprecated and no longer used in multiple interfaces. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "10.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit e0489531455623aa21aa565b2c890362d8437f23)
2013-11-15glx: Back DRI3 enablement out of the stable branch.Eric Anholt2-4/+0
After more testing (everyone else trying to build the stack is having as much trouble as I had, even after the problems I had were fixed), it really feels like dri3 is not something we're ready to support in this stable branch. The .c/.h code will remain here to enable easier cherry-picking from master, and everything stays on master so we can ship a solid DRI3 in 3 months. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-15glx: change query_renderer_integer() value param to unsignedBrian Paul3-3/+4
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> (cherry picked from commit 75982a5df42cd2406e529b7c96b36d2a8b1f7b60)
2013-11-15glx: Fix scons build.José Fonseca1-0/+3
Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 6c6f4aa6fdad19574406ea7edcbcca45d02e89b6)
2013-11-15scons: Add dri2_query_renderer.c to sources.José Fonseca1-0/+1
(cherry picked from commit cb3c57df3acfa237641aa004545a786f5624f198)
2013-11-07dri3: Fix pixmap buf_id computation10.0-branchpointKeith Packard1-1/+1
Looks like some kind of rebase damage to me... Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07glx: Add a more informative debug message in a DRI3 error path.Eric Anholt1-0/+7
2013-11-07Add DRI3+Present loaderKeith Packard6-1/+2195
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>
2013-11-07glx/tests: Add unit tests for the DRI2 part of GLX_MESA_query_rendererIan Romanick3-6/+314
After adding $(DEFINES) to AM_CPPFLAGS, the __glXGetCurrentContext wrapper function is no longer needed and causes compile errors. Using the correct defines causes it to be a macro! Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07glx/tests: Add unit tests for the GLX part of GLX_MESA_query_rendererIan Romanick3-1/+449
These tests primarilly ensure that the functions added by this extension don't abuse other interfaces (e.g., glx_screen::query_renderer_integer) when provided bad data. These tests helped me find a couple small bugs in the initial implementation. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07glx/tests: Add GetGLXScreenConfigs_called flagIan Romanick1-0/+4
Tests for the GLX_MESA_query_context extension will use this flag. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07glx/dri2: Add DRI2 support for GLX_MESA_query_rendererIan Romanick5-1/+119
The new functions for this extension were added to a separate file (dri2_query_renderer.c) to facilitate unit testing. I tried putting them in dri2_glx.c, and it resulting in an unending chain of dependencies. It was the proverbial threading hanging from a sweater. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07glx/dri2: Pull some internal structures out to a separate header fileIan Romanick2-20/+52
This structures will be accessed by internal functions that will be added in a file separate from dri2_glx.c. The new code will be added to a new file to facilitate unit testing. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07glx/tests: Silence warnings after adding fields to glx_screen_vtableIan Romanick1-2/+6
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07glx: Add functions and GLX plumbing for GLX_MESA_query_rendererIan Romanick4-1/+186
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07glx: Add extension tracking GLX_MESA_query_rendererIan Romanick2-0/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-30scons: Add missing dependencies to src/mapi/glapi/gen/*.xmlJosé Fonseca1-5/+6
Incremental builds were failing because not all generated source files were missing dependencies to src/mapi/glapi/gen/*.xml. Hopefully this change will be the end of these incremental build failures.
2013-10-25glx: Fix return value from indirect_bind_contextAdam Jackson1-4/+4
_XReply returns 1 on success, but indirect_bind_context returns 0 on success. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70486 Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-24dri: Pass in the dlsym()ed driver extension to screen creation.Eric Anholt2-12/+24
This will allow a megadrivers build to reference the actual driver being loaded from the shared dri_util screen creation code. v2: Fix indentation, fallback case in EGL (review by Emil). Reviewed-by: Matt Turner <mattst88@gmail.com> (v1) Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1) Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24glx: Add an optional function call for getting the DRI driver interface.Eric Anholt5-8/+22
The previous interface relied on a static struct, which meant that the driver didn't get a chance to edit the struct before the struct got used. For megadrivers, I want struct specific to the driver being loaded. v2: Fix the prototype in the docs (caught by Marek). Since the driver name was in the function, we didn't need to also pass it in. v3: Fix asprintf error checking (caught by Matt's gcc). Reviewed-by: Matt Turner <mattst88@gmail.com> (v1) Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24dri: Allow config options to be passed to the loader through extensions.Eric Anholt1-3/+14
Turns out already we have this nice mechanism for providing optional things from the driver to the loader, and I was going to have to rename the public global symbol to avoid conflicts when doing megadrivers. While the former __driConfigOptions is technically loader interface, this is the only loader that made use of that symbol. Continue paying attention to it if we can't find the new option, to retain compatibility with old drivers. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24glx: Move the driver extension-loading to a helper function.Eric Anholt3-4/+18
I'm planning on doing driver extension parsing from 3 places, and making the extension loading step a bit longer. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-08glx: Generate fewer errors in MakeContextCurrentAdam Jackson1-10/+0
For a few reasons. 1: In the (current) common case, these conditionals are never true. All we're doing by checking them is slowing down MakeCurrent. The server does these checks already anyway. 2: GLX >= 3.0 contexts may legally be made current without a bound framebuffer. This does not fix piglit/glx-create-context-current-no-framebuffer, but is a prerequisite for fixing it. Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08glx: Propagate failures from SendMakeCurrentRequest where possibleAdam Jackson1-3/+4
Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08glx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequestAdam Jackson1-7/+9
Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-04glx: Initialize OpenGL version to 1.0Rico Schüller3-17/+17
The old code in dri2_glx suffered from a typographical error that caused the default version to be 2.1 instead of 1.2 (minimum required by the Linux OpenGL ABI). drisw_glx had a similar error resulting in a default version of 0.1. Some driver/card combinations (r200/RV280, i915/915G) don't support OpenGL 2.1. These create in some corner cases an indirect context instead of a direct context when calling glXCreateContextAttribsARB(). This happens because of a bad default value. To avoid this, just used the default value specified by the GLX_ARB_create_context specification: "The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this case, implementations will typically return the most recent version of OpenGL they support which is backwards compatible with OpenGL 1.0 (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility profile)" Refactor all the default value setting to dri2_convert_glx_attribs, and make sure the correct defaults are set in that one place. Signed-off-by: Rico Schüller <kgbricola@web.de> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238 Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
2013-09-02glx: make the interval of LIBGL_SHOW_FPS adjustableChia-I Wu1-4/+8
LIBGL_SHOW_FPS=1 makes GLX print FPS every second while other values do nothing. Extend it so that LIBGL_SHOW_FPS=N will print the FPS every N seconds. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-08-13glx: Generate GLXBadDrawable when drawable is zeroIan Romanick1-2/+12
Fixes piglit glx-query-drawable-GLXBadDrawable. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-07-20Apple: glFlush() is not needed with CGLFlushDrawable()Jeremy Huddleston Sequoia1-2/+0
<rdar://problem/14496373> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-07-18mesa: Dispatch ARB_framebuffer_object and EXT_framebuffer_object differently9.2-branchpointTomasz Lis1-2/+6
Almost all of the functions between the ARB and the EXT share the same GLX protocol because the functionality is, essentially, identical. However, there are some differences between the extensions: - In the ARB extension, names must come from glGenBuffers. - In the ARB extension, framebuffer objects are not shared (but they are in the EXT). For these reasons, glBindFramebuffer and glBindRenderbuffer have different GLX protocol opcodes than their EXT counterparts. Currently these functions alias each other in the dispatch table. This makes it impossible to be truly spec conformant. This patch enables fixing the conformance issue by splitting glBindFramebuffer / glBindFramebufferEXT and glBindRenderbuffer / glBindRenderbufferEXT into separate dispatch table entries. Patches will be available shortly to: - Fix the conformance issue. - Stop advertising the EXT in OpenGL 3.1 (or core profiles). HOWEVER, this does represent a compatibility break between the loader (libGL or the Xserver GLX module) and the driver. Mesa drivers compiled without this change will request a single dispatch table entry for glBindFramebuffer and glBindFramebufferEXT. Since the updated loader has different entries for each, the request will fail, and the driver will die in a fire. Drivers built with the change should continue to load fine on loaders without the change. In this case, the driver will separately ask for entries for glBindFramebuffer and glBindFramebufferEXT, and the loader will tell it the same location. Since the loader in the server's GLX module is not (yet) updated, this should not be a problem. We also do not advertise the ARB extension from the server, so, again, this should not be a problem for the server. HOWEVER, this means that DRI1 drivers (remember mga_dri.so?) will no longer load with libGL build hereafter. That means this patch will need to be back ported to the 8.0 branch. v2 (idr): Added missing GLX protocol opcodes for the EXT functions and corrected the opcodes for the ARB functions. Updated GLX indirect_api unit test and dispatch sanity unit test. Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Signed-off-by: Bartosz Zawistowski <bartosz.l.zawistowski@intel.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
2013-07-18glx: Enable floating-point fbconfig extensionsTomasz Lis2-0/+4
Signed-off-by: Tomasz Lis <listom@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-18dri: Introduce new flags in __DRI_ATTRIB_RENDER_TYPETomasz Lis1-1/+7
Mark __DRI_ATTRIB_FLOAT_MODE as deprecated, and introduce new flags to __DRI_ATTRIB_RENDER_TYPE for float modes. Both signed float (fbconfig_float) and unsigned (packed_float) are introduced. The old attribute should be set for both float modes. v2 (idr): Require that the render mode from the DRI attributes matches the render mode of the config exactly. This is the behavior of the old code. 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>
2013-07-18glx: Require proper drawableType in init_fbconfig_for_chooserTomasz Lis1-1/+6
Make sure that init_fbconfig_for_chooser sets correct value of drawableType for visual configs and fbconfigs. Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-18glx: Validate the GLX_RENDER_TYPE valueTomasz Lis6-0/+55
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>
2013-07-18glx: Store the RENDER_TYPE in indirect renderingTomasz Lis6-25/+41
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>
2013-07-18glx: Handling RENDER_TYPE in glXCreateContext and init_fbconfig_for_chooserTomasz Lis1-4/+28
Set the correct values of renderType in glXCreateContext and init_fbconfig_for_chooser. Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-18glx: Changes to visual configs initialization.Tomasz Lis1-4/+24
Correctly handle the value of renderType and drawableType in fbconfig. Modify glXInitializeVisualConfigFromTags to read the parameter value, or detect it if it's not there. v2 (idr): If there was no GLX_RENDER_TYPE property, set the type based purely on the rgbMode as the previous code did. It is impossible for floatMode to be set at this point, so we can't have a float config. The previous code regressed a large number of piglit GLX tests because those tests don't set GLX_RENDER_TYPE in the glXChooseConfig call. Restoring the old behavior for that case fixes those regressions. Also fix handling of GLX_DONT_CARE for GLX_RENDER_TYPE. Fixes a regression in glx-dont-care-mask. 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>
2013-07-18glx: Retrieve the value of RENDER_TYPE from GLX attribs arrayTomasz Lis4-13/+13
Make sure that context creation routines are provided with the value of RENDER_TYPE retrieved from GLX attribs. v2 (idr): Minor formatting changes. Change type of dri2_convert_glx_attribs render_type parameter to uint32_t to silence some GCC warnings. 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>
2013-07-18glx: Store the value of renderType while creating contextTomasz Lis4-2/+17
Make sure that renderType property value is stored in GLX context while it's being created. Further patches will be provided to make the value correspond to fbconfig's renderType. v2 (idr): Move a hunk from the next patch to this patch to prevent a build break. 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>
2013-06-27glx: return True/False instead of GL_TRUE/GL_FALSEBrian Paul1-11/+11
Just to be consistent with the functions' Bool return type. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-27glx: move declarations before codeBrian Paul2-9/+9
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-26glx: Fix another missed glMultiDrawElementsEXT const change.Eric Anholt1-1/+1
The build was broken for me since b7d9478f36bde0f7b27321378c1bb799fdd4eaa1.
2013-06-05mesa: remove outdated version lines in commentsRico Schüller1-1/+0
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-05-30integer overflow in XF86DRIGetClientDriverName() [CVE-2013-1993 2/2]Alan Coopersmith1-3/+5
clientDriverNameLength is a CARD32 and needs to be bounds checked before adding one to it to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. NOTE: This is a candidate for stable release branches. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-05-30integer overflow in XF86DRIOpenConnection() [CVE-2013-1993 1/2]Alan Coopersmith1-1/+6
busIdStringLength is a CARD32 and needs to be bounds checked before adding one to it to come up with the total size to allocate, to avoid integer overflow leading to underallocation and writing data from the network past the end of the allocated buffer. NOTE: This is a candidate for stable release branches. Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-23mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke1-3/+4
The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-23mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke1-1/+1
This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-23mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke1-1/+1
Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <brianp@vmware.com>
2013-04-15build: Rename sources.mak -> Makefile.sourcesMatt Turner1-1/+1
For the sake of consistency. Tested-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>