Commit Graph

1296 Commits

Author SHA1 Message Date
Charmaine Lee 81f342ce64 glx: Fix incorrect pdp assignment in dri2_bind_context().
pdp should be set to dpyPriv->dri2Display.
Fixes blank frame failure running glretrace ClearView.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-18 08:03:27 -06:00
Adel Gadllah a69fabc76c dri3: Add GLX_EXT_buffer_age support
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>
2014-03-13 14:19:21 -07:00
Eric Anholt 0b02d8a633 dri3: Prefer the last chosen back when finding a new one.
With the buffer_age code, I need to be able to potentially call this more
than once per frame, and it would be bad if a new special event showing up
meant I chose a different back mid-frame.  Now, once we've chosen a back
for the frame, another find_back will choose it again since we know that
it won't have ->busy set until swap.

Note that this makes find_back return a buffer id instead of a backbuffer
index.  That's kind of a silly distinction anyway, since it's an identity
mapping between the two (it's the front buffer that is at an offset).

Reviewed-By: Adel Gadllah <adel.gadllah@gmail.com>
2014-03-13 14:19:16 -07:00
Emil Velikov f41a65397b glx: cleanup unneeded headers
- xf86dri.h is the old dri1 header, not required by dri2 nor dri3
 - fold xf86drm.h inclusiong inside dri2.h
 - dri3_glx does not have any drm specific dependencies
 - glapi.h is not required by the dri2 and dri3 codepaths

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:50:43 +00:00
Jon TURNEY e5214dd8f1 glx/tests: honor enable-driglx-direct configure flag
Recent commit fixed build issues in dri2_query_renderer.c by
wrapping in defined(direct_rendering) && !defined(applegl)

This patch targets the query_renderer tests, so that make check
passes on platforms such as hurd and cygwin.

v2: (Emil)
 - Rebase and update commit message.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:50:43 +00:00
Emil Velikov bba9c28215 configure: use LIB_EXT rather than hardcoded .so
Some platforms different library extension - dll, dylib, a.
Honor that when we are creating the required links.

Rename LIB_EXTENSION to LIB_EXT while we're here.

With libglapi linking aside, building classic drivers on
non-linux platforms should be possible now.

v2: Resolve conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov 020bc0d0dd automake: do not use symbols names for static glapi.la
In the cases where one links against the static glapi.la there
is no need to create temporary variables only to explicitly
link agaist it.

Instead use SHARED_GLAPI_LIB to explicitly indicate when one
is building and linking with the shared glapi provider.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov 3c5599b276 configure: remove old makefile variables
All the variables were used before the automake conversion
and do not make sense (nor are used) currently.

Replace GL_LIB_NAME with lib$(GL_LIB).$(LIB_EXTENSION) for
apple-glx. The build has been broken for ages, but this will
ease the recovery process as it happens.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Adel Gadllah b972e55684 glx_pbuffer: Refactor GetDrawableAttribute
Move the pdraw != NULL check out so that they don't
have to be duplicated.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 16:59:57 -08:00
Brian Paul 02cb04c68f mesa: remove remaining uses of _glthread_GetID()
It was really only used in the radeon driver for a debug printf.
And evidently, libGL.so referenced it just to work around some sort
of linker issue.

This patch removes the two calls to the function and the function
itself.

Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'.
Though, the missing symbol doesn't cause any issues on my system but
it does cause glxinfo to fail on one of our test systems.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-05 11:05:48 -07:00
Brian Paul db806cacfd mesa: remove empty glthread.h file
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Julien Cristau 6f0e2731e8 glx/dri2: fix build failure on HURD
Patch from Debian package.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-03 16:44:44 +01:00
Siavash Eliasi 2a399d9eae glx/apple: Fixed glx context memory leak in case of failure.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jeremy Huddleston Sequoia: <jeremyhu@apple.com>
2014-02-28 15:57:15 -08:00
Fredrik Höglund 3616e862f2 glx: Fix the GLXFBConfig attrib sort priorities
The sort priorites for GLX_SAMPLES and GLX_SAMPLE_BUFFERS are
not defined in GL_ARB_multisample, but they are defined in
the GLX 1.4 specification.

Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 02:17:12 +01:00
Fredrik Höglund f41c2f6c33 glx: Fix the default values for GLXFBConfig attributes
The default values for GLX_DRAWABLE_TYPE and GLX_RENDER_TYPE are
GLX_WINDOW_BIT and GLX_RGBA_BIT respectively, as specified in
the GLX 1.4 specification.

This fixes the glx-choosefbconfig-defaults piglit test.

Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 02:16:42 +01:00
Emil Velikov f92fbba11b glx/drisw: use the implemented version of __DRIswrastLoaderExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov f6537d0608 glx/dri: use the implemented version of __DRIdamageExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov ef342aad80 glx/dri_common: use the implemented version of __DRIsystemTimeExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov fbbf5ec471 glx/dri: use the implemented version of __DRIgetDrawableInfoExtension
... over the one provided by the headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov e9eb3ec331 glx/dri3: set the implemented version of __DRIimageLoaderExtension
... over the one provided by the spec.
Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov 92273962f5 glx/dri2: set the implemented version of __DRIdri2LoaderExtension
... over the version number provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Juha-Pekka Heikkila d530745169 glx: Add missing null check in __glX_send_client_info()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila e503609e6f glx: Add some missing null checks in glx_pbuffer.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila 2ae1437a8e glx: Add missing null check in __glXCloseDisplay
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Juha-Pekka Heikkila d28e92ff74 glx: Add missing null checks in glxcmds.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Kristian Høgsberg f658150639 glx: Pass NULL DRI drawables into the DRI driver for None GLX drawables
GLX_ARB_create_context allows making a GLX context current with None
drawable and readables, but this was never implemented correctly in GLX.
We would create a __DRIdrawable for the None GLX drawable and pass that
to the DRI driver and that would somehow work.  Now it's somehow broken.

The way this should have worked is that we pass a NULL DRI drawable
to the DRI driver when the GLX user calls glXMakeContextCurrent()
with None for drawable and readables.

https://bugs.freedesktop.org/show_bug.cgi?id=74143
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-06 14:23:42 -08:00
Keith Packard 3fbd1b0cb5 dri3: Track current Present swap mode and adjust buffer counts
This automatically adjusts the number of buffers that we want based on
what swapping mode the X server is using and the current swap interval:

        swap mode       interval        buffers
        copy            > 0             1
        copy            0               2
        flip            > 0             2
        flip            0               3

Note that flip with swap interval 0 is currently limited to twice the
underlying refresh rate because of how the kernel manages flipping. Moving
from 3 to 4 buffers would help, but that seems ridiculous.

v2: Just update num_back at the point that the values that change num_back
    change.  This means we'll have the updated value at the point that the
    freeing of old going-to-be-unused backbuffers happens, which might not
    have been the case before (change by anholt, acked by keithp).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 17:29:33 -08:00
Keith Packard aea4757eb4 dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888
The __DRIimage createImageFromFds function takes a fourcc code, but there was
no fourcc code that match __DRI_IMAGE_FORMAT_SARGB8. This adds a define for
that format, adds a translation in DRI3 from __DRI_IMAGE_FORMAT_SARGB8 to
__DRI_IMAGE_FOURCC_SARGB8888 and then adds translations *back* to
__IMAGE_FORMAT_SARGB8 in both the i915 and i965 drivers.

I'll refrain from comments on whether I think having two separate sets of
format defines in dri_interface.h is a good idea or not...

Fixes piglit glx-tfp and glx-visuals-depth

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 17:29:23 -08:00
Keith Packard f12d6d613a dri3: Flush XCB before blocking for special events
XCB doesn't flush the output buffer automatically, so we have to call
xcb_flush ourselves before waiting.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:40:25 -08:00
Keith Packard 09d6c19720 dri3: Enable GLX_INTEL_swap_event
Now that we're tracking SBC values correctly, and the X server has the
ability to send the GLX swap events from a PresentPixmap request, enable
this extension.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:40:06 -08:00
Keith Packard 1525474ead dri3: Fix dri3_wait_for_sbc to wait for completion of requested SBC
Eric figured out that glXWaitForSbcOML wanted to block until the requested
SBC had been completed, which means to wait until the
PresentCompleteNotify event for that SBC had been received.

This replaces the simple sleep(1) loop (which was bogus) with a loop that
just checks to see if we've seen the specified SBC value come back in a
PresentCompleteNotify event yet.

The change is a bit larger than that as I've broken out a piece of common
code to wait for and process a single Present event for the target
drawable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:38:36 -08:00
Keith Packard 71d614250e dri3: Track full 64-bit SBC numbers, instead of just 32-bits
Tracking the full 64-bit SBC values makes it clearer how those values are
being used, and simplifies the wait_msc code. The only trick is in
re-constructing the full 64-bit value from Present's 32-bit serial number
that we use to pass the SBC value from request to event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30 16:35:00 -08:00
Kristian Høgsberg cbecd958a7 build: Share the all-local rule for linking libraries into the build dir
This consolidates how we link the libraries into the build directory.
It works for lib_LTLIBRARIES but not custom shared libraries like DRI
drivers or gallium state trackers which needs special casing (cf dri
mega drivers, for example)

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-29 12:58:13 -08:00
Emil Velikov a6031a82f9 loader: Add missing \n on message printing
Cover both loader and glx/dri_glx
Drop \n from the default loader logger

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-27 09:37:29 -08:00
Eric Anholt 867d7c0e10 dri: Reuse dri_message to implement our other message handlers.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:37:29 -08:00
Eric Anholt 4a8da40fc0 dri: Fix the logger error message handling.
Since the loader changes, there has been a compiler warning that the
prototype didn't match.  It turns out that if a loader error message was
ever thrown, you'd segfault because of trying to use the warning level as
a format string.

Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:37:29 -08:00
Eric Anholt 7bd95ec437 dri2: Trust our own driver name lookup over the server's.
This allows Mesa to choose to rename driver .sos (or split drivers),
without needing a flag day with the corresponding 2D driver.

v2: Undo the loader-only-for-dri3 change.

Reviewed-by: Keith Packard <keithp@keithp.com> [v1]
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> [v1]
2014-01-27 09:37:10 -08:00
Eric Anholt be7a6976a8 dri2: Open the fd before loading the driver.
I want to stop trusting the server for the driver name, and instead decide
on our own based on the fd, so I needed this code motion.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:36:24 -08:00
Eric Anholt 378e7ad26f dri3: Fix two little memory leaks.
Noticed when valgrinding an unrelated bug.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:36:24 -08:00
Emil Velikov c6b6916b9a glx: link loader util lib only when building with dri3
Otherwise we pull libudev as a dependency and crash
games/programs that ship their own version of libudev.

Either way we should link the loader lib only when needed.
This fixes a regression caused by
commit eac776cf77
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Jan 11 02:24:43 2014 +0000

    glx: use the loader util lib

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73854
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-23 18:04:22 +00:00
Emil Velikov eac776cf77 glx: use the loader util lib
v2
* Set logger to ErrorMessageF. Spotted by Kristian

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:48 +00:00
Emil Velikov 8c2e7fd846 loader: introduce the loader util lib
All the various window system integration layers duplicate roughly the
same code for figuring out device and driver name, pci-id's, etc.  Which
is sad.  So extract it out into a loader util lib.

v2 (Emil)
* Separate the introduction of libloader from the code de-duplication.
* Strip out non-pci devices support.
* Add scons + Android build system support.
* Add VISIBILITY_CFLAGS to avoid exporting the loader funcs.

v3 (Emil)
* PIPE_OS_ANDROID is undefined at this scope, use ANDROID
* Make sure we define _EGL_NO_DRM when building only swrast

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-18 18:47:27 +00:00
José Fonseca 8771285054 s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008.  Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

    $ cat tg2vmw.sed
    # Run as:
    #
    #   git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
    #

    # Rename copyrights
    s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
    /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
    s/TUNGSTEN GRAPHICS/VMWARE/g

    # Rename emails
    s/alanh@tungstengraphics.com/alanh@vmware.com/
    s/jens@tungstengraphics.com/jowen@vmware.com/g
    s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
    s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
    s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
    s/michel@tungstengraphics.com/daenzer@vmware.com/g
    s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
    s/zack@tungstengraphics.com/zackr@vmware.com/

    # Remove dead links
    s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

    # C string src/gallium/state_trackers/vega/api_misc.c
    s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 20:00:32 +00:00
Juha-Pekka Heikkila d41f5396f3 glx: check memory allocations in __glXInitVertexArrayState()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-06 10:23:26 -07:00
Lauri Kasanen fe2079c4c0 glx: Simplify __glxGetMscRate, it only needs the screen, not a drawable
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>
2013-12-20 16:43:08 -08:00
Keith Packard 6b51113981 dri3: Rename DRI3_MAX_BACK to DRI3_NUM_BACK
It is the maximum number of back buffers, but the name is confusing and is
easily read as the maximum back buffer index. Chage to DRI3_NUM_BACK to make
the intended usage a bit clearer.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:31:09 -08:00
Keith Packard ca2012a912 dri3: Clean up struct dri3_drawable
Move the depth field up with width and height.

Remove unused previous_time and frames fields.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:18:11 -08:00
Keith Packard 95b04850d0 dri3: Free resources when drawable is destroyed.
Always nice to clean up after ourselves.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:17:59 -08:00
Keith Packard 568a27588d dri3: Switch to libxshmfence version 1.1
libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which
works when the fence is a linux futex. However, version 1.1
changes the exported datatype to 'struct xshmfence *'

Require libxshmfence version 1.1 and switch the API around.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 16:17:54 -08:00
Juha-Pekka Heikkila cd6aaf2920 glx: Fix two identical null check errors in driSet/GetInterval
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-19 08:25:45 -07:00
Juha-Pekka Heikkila c02f6c26d3 glx: add missing null check in dri2_bind_tex_image
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:40:19 -07:00
Juha-Pekka Heikkila ca3df5eeda glx: Add missing null check in dri2CreateDrawable
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Dave Airlie ba00f2f6f5 swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)
This patches add MESA_copy_sub_buffer support to the dri sw loader and
then to gallium state tracker, llvmpipe, softpipe and other bits.

It reuses the dri1 driver extension interface, and it updates the swrast
loader interface for a new putimage which can take a stride.

I've tested this with gnome-shell with a cogl hacked to reenable sub copies
for llvmpipe and the one piglit test.

I could probably split this patch up as well.

v2: pass a pipe_box, to reduce the entrypoints, as per Jose's review,
add to p_screen doc comments.

v3: finish off winsys interfaces, add swrast classic support as well.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

swrast: add support for copy_sub_buffer
2013-12-13 14:37:01 +10:00
Juha-Pekka Heikkila 84b1716b5e glx: Add missing null check in DRI2WireToEvent
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-11 18:18:43 -07:00
Juha-Pekka Heikkila 03ef57950a glx: Add missing null check in gxl/dri2_glx.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-03 14:35:41 -07:00
Juha-Pekka Heikkila b8875cb7c8 glx: Check malloc return value before accessing memory in glx/clientattrib.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-03 14:35:41 -07:00
Dave Airlie b01a3a9b72 glx: don't fail out when no configs if we have visuals
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>
2013-11-21 10:50:48 +10:00
Jon TURNEY 5ab59e5332 glx/tests: Provide __glXGetCurrentContext() stub when needed
Refine 8c533022.  Provide a stub __glXGetCurrentContext() function when
$(DEFINES) are such that it is not a macro.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-11-19 15:28:22 +00:00
Kristian Høgsberg e048953145 dri: Remove redundant createNewContext function from __DRIimageDriverExtension
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>
2013-11-12 16:08:17 -08:00
Brian Paul 944eebbdb4 glx: declare glx_screen struct to silence warning 2013-11-11 08:12:05 -07:00
Brian Paul 75982a5df4 glx: change query_renderer_integer() value param to unsigned
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>
2013-11-11 08:10:12 -07:00
José Fonseca 6c6f4aa6fd glx: Fix scons build.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-11-11 07:30:07 +00:00
Armin K f0f202e6b7 glx: conditionaly build dri3 and present loader (v3)
This patch makes it possible to disable DRI3 if desired.

Tested with:

./configure --disable-dri3 --with-dri-drivers=i965 \
--with-gallium-drivers= --disable-vdpau --disable-egl \
--disable-gbm --disable-xvmc

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71397
Cc: 10.0 <mesa-stable@lists.freedesktop.org>
2013-11-09 09:12:46 -08:00
José Fonseca cb3c57df3a scons: Add dri2_query_renderer.c to sources. 2013-11-08 12:22:22 +00:00
Keith Packard 035cce83f7 dri3: Fix pixmap buf_id computation
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-07 19:08:09 -08:00
Eric Anholt 4b5d0d10f1 glx: Add a more informative debug message in a DRI3 error path. 2013-11-07 19:08:09 -08:00
Keith Packard 2d94601582 Add DRI3+Present loader
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-07 19:08:09 -08:00
Ian Romanick 8c5330226f glx/tests: Add unit tests for the DRI2 part of GLX_MESA_query_renderer
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-07 18:12:33 -08:00
Ian Romanick 0cce553867 glx/tests: Add unit tests for the GLX part of GLX_MESA_query_renderer
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-07 18:12:33 -08:00
Ian Romanick d4cc186937 glx/tests: Add GetGLXScreenConfigs_called flag
Tests for the GLX_MESA_query_context extension will use this flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 18:12:33 -08:00
Ian Romanick 4680d237c5 glx/dri2: Add DRI2 support for GLX_MESA_query_renderer
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-07 18:12:33 -08:00
Ian Romanick 419684091c glx/dri2: Pull some internal structures out to a separate header file
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-07 18:12:32 -08:00
Ian Romanick 4944588cfd glx/tests: Silence warnings after adding fields to glx_screen_vtable
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 18:12:32 -08:00
Ian Romanick 6c28c037c4 glx: Add functions and GLX plumbing for GLX_MESA_query_renderer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:32 -08:00
Ian Romanick b3ffc5b6f4 glx: Add extension tracking GLX_MESA_query_renderer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-11-07 18:12:32 -08:00
José Fonseca 26a8f76ba1 scons: Add missing dependencies to src/mapi/glapi/gen/*.xml
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-30 12:21:54 +00:00
Adam Jackson 1090eb5755 glx: Fix return value from indirect_bind_context
_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-25 16:49:28 -04:00
Eric Anholt f93533d118 dri: Pass in the dlsym()ed driver extension to screen creation.
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-24 14:04:20 -07:00
Eric Anholt fcb57a8210 glx: Add an optional function call for getting the DRI driver interface.
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-24 14:04:20 -07:00
Eric Anholt cf5d8fc310 dri: Allow config options to be passed to the loader through extensions.
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-24 14:04:20 -07:00
Eric Anholt 80806c98ef glx: Move the driver extension-loading to a helper function.
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-24 14:04:20 -07:00
Adam Jackson e166a58c43 glx: Generate fewer errors in MakeContextCurrent
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-08 13:24:20 -04:00
Adam Jackson d101204c23 glx: Propagate failures from SendMakeCurrentRequest where possible
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Adam Jackson 68412d5006 glx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequest
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Rico Schüller 8b302e1635 glx: Initialize OpenGL version to 1.0
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-04 16:07:21 -07:00
Chia-I Wu da33347131 glx: make the interval of LIBGL_SHOW_FPS adjustable
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-09-02 11:42:58 +08:00
Ian Romanick d5aee174b8 glx: Generate GLXBadDrawable when drawable is zero
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-08-13 17:53:33 -07:00
Jeremy Huddleston Sequoia fa5ed99d8e Apple: glFlush() is not needed with CGLFlushDrawable()
<rdar://problem/14496373>

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-07-20 10:25:28 -07:00
Tomasz Lis 9f07ca11c1 mesa: Dispatch ARB_framebuffer_object and EXT_framebuffer_object differently
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-18 17:42:46 -07:00
Tomasz Lis eb83079b35 glx: Enable floating-point fbconfig extensions
Signed-off-by: Tomasz Lis <listom@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-18 16:03:42 -07:00
Tomasz Lis c37c367d38 dri: Introduce new flags in __DRI_ATTRIB_RENDER_TYPE
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-18 16:03:42 -07:00
Tomasz Lis 4473af7aca glx: Require proper drawableType in init_fbconfig_for_chooser
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-18 16:03:42 -07:00
Tomasz Lis 2eed9ff2fb glx: Validate the GLX_RENDER_TYPE value
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-18 16:03:42 -07:00
Tomasz Lis 27c8aa5cfb glx: Store the RENDER_TYPE in indirect rendering
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-18 16:03:42 -07:00
Tomasz Lis 1c748dff6b glx: Handling RENDER_TYPE in glXCreateContext and init_fbconfig_for_chooser
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-18 16:03:42 -07:00
Tomasz Lis b8126c7c8a glx: Changes to visual configs initialization.
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-18 16:03:42 -07:00
Tomasz Lis a92cd5b245 glx: Retrieve the value of RENDER_TYPE from GLX attribs array
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-18 16:03:42 -07:00
Tomasz Lis 36259a16fe glx: Store the value of renderType while creating context
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-07-18 16:03:42 -07:00
Brian Paul 482c43a946 glx: return True/False instead of GL_TRUE/GL_FALSE
Just to be consistent with the functions' Bool return type.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-27 07:48:19 -06:00
Brian Paul d171bc9d19 glx: move declarations before code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-06-27 07:48:18 -06:00
Eric Anholt fc32d40534 glx: Fix another missed glMultiDrawElementsEXT const change.
The build was broken for me since
b7d9478f36.
2013-06-26 12:28:25 -07:00
Rico Schüller 3998cfa933 mesa: remove outdated version lines in comments
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-06-05 08:54:27 -06:00
Alan Coopersmith 306f630e67 integer overflow in XF86DRIGetClientDriverName() [CVE-2013-1993 2/2]
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-30 18:03:45 -07:00
Alan Coopersmith 2e5a268f18 integer overflow in XF86DRIOpenConnection() [CVE-2013-1993 1/2]
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-05-30 18:03:39 -07:00
Kenneth Graunke 3d8d5b298a mesa: Restore 78-column wrapping of license text in C-style comments.
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-23 22:07:09 -07:00
Kenneth Graunke 96ff2edc73 mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.
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-23 22:07:06 -07:00
Kenneth Graunke dd404bc94f mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.
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-23 22:06:38 -07:00
Matt Turner 3c690524e2 build: Rename sources.mak -> Makefile.sources
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>
2013-04-15 12:04:25 -07:00
Alexander Monakov 9cda356004 Honor GLX_DONT_CARE in MATCH_MASK
NOTE: This is a candidate for stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47478
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62999
Bugzilla: http://bugs.winehq.org/show_bug.cgi?id=26763
2013-04-05 14:32:45 -07:00
Adam Jackson 38aa8ec937 glx: Build with VISIBILITY_CFLAGS in automake
Note: This is a candidate for the stable branches.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-03-21 13:21:18 -04:00
Rob Clark 4e8f5c52bb DRI2: HACK: no GLX_INTEL_swap_event if no ScheduleSwap
If ddx does not support swap, don't advertise it.  This is a hack to
work around current xservers which advertise this extension even when it
is clearly not supported.  When:

http://lists.x.org/archives/xorg-devel/2013-February/035449.html

is merged in upstream xserver and makes it's way into most distros then
this hack can be removed.  In the mean time, it is required to allow
gnome-shell/clutter/etc to work properly with a DDX driver which does
not support ScheduleSwap.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-03-18 14:16:43 -04:00
Brian Paul 622b1fcc18 glx: init screen = 0 to fix optimized build warning 2013-03-14 18:09:42 -06:00
Jon TURNEY f816a9f522 glx: Fix glXCreateWindow() when GLX_DIRECT_RENDERING is undefined
glXCreateWindow() and glXCreatePbuffer() always fail when built without
GLX_DIRECT_RENDERING defined since commit 48331047.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-02-27 13:36:19 -05:00
Zack Rusin 076403c30d DRI2: Don't disable GLX_INTEL_swap_event unconditionally
GLX_INTEL_swap_event is broken on the server side, where it's
currently unconditionally enabled. This completely breaks
systems running on drivers which don't support that extension.
There's no way to test for its presence on this side, so instead
of disabling it uncondtionally, just disable it for drivers
which are known to not support it. It makes sense because
most drivers do support it right now.
We'll be able to remove this once Xserver properly advertises
GLX_INTEL_swap_event.

Note: This is a candidate for stable branch branches.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60052
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-19 12:50:16 -08:00
Eric Anholt 7242b03622 glx: Centralize the code for context flushing.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-02-07 13:13:02 -08:00
Eric Anholt 95080ca8d4 glx: Add a little comment about what dri2FlushFrontBuffer() does.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-02-07 13:13:02 -08:00
Stéphane Marchesin 67e7263e45 glx: Check that swap_buffers_reply is non-NULL before using it
Check that the return value from xcb_dri2_swap_buffers_reply is
non-NULL before accessing the struct members.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-29 11:15:22 -08:00
Zack Rusin dbb2d192de glx: only advertise GLX_INTEL_swap_event if it's supported
Only drivers supporting DRI2 version >=4 support GLX_INTEL_swap_event.
So lets mark it as such otherwise applications which use this extension
(i.e. everything based on Clutter, e.g. gnome-shell) break horribly on
drivers supporting DRI2 versions only up to 3.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 19:13:05 -08:00
José Fonseca 71c87e42e1 scons: Fix dependencies of generated headers.
It appears that scons implicit dependency scanners fail to chain
dependencies of generated headers when these are outside the build tree.

This patch ensures generated source files are _always_ put in the build
tree. I'm not 100% this will fix all depency issues, but from my
experiments it does seem to fix this.

NOTE: For this to be effective it is necessary to clean the source tree
from generated header/source files.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-21 19:10:54 +00:00
Johannes Obermayr ebcabb88cf tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:38:38 +01:00
Matt Turner ac2793cf3e Clean up .gitignore files 2013-01-10 22:01:31 +01:00
Marek Olšák 5fb2b1f4d4 glx/dri2: set the __DRI2_FLUSH_DRAWABLE flag where it should be set
Sorry, I accidentally omitted this.

It only broke MLAA.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák 4a486f8bf2 glx/dri2: add and use new driver hook flush_with_flags 2012-12-02 00:19:00 +01:00
Marek Olšák 5b7e9b7360 glx: move the glFlush call one layer down 2012-12-02 00:15:00 +01:00
Dave Airlie a0ec9185eb dri_glx: fix use after free report
the critical error would use driverName.

Found by internal RH coverity scan.

Note: This is a candidate for stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:20:36 +10:00
Paul Berry 1a1db1746d mesa: Standardize names of OpenGL functions.
This patch adjusts the aliasing pattern in the GL API description XML,
and the functions that implement the GL API within Mesa, to
consistently follow these naming conventions:

- When several function names are aliases of each other, the primary
  name is the one with no extension suffix (or the name with the
  suffix "ARB", if no unsuffixed name is available).  (By "primary
  name", I mean the name that all the other functions point to using
  the XML "alias" attribute).

- The name of the mesa implementation of each function is the same as
  the primary name, with the prefix "_mesa_".

This patch renames the following mesa functions:
  _check_GetTexGenxvOES => _mesa_GetTexGenxvOES
  _check_TexGenxOES => _mesa_TexGenxOES
  _check_TexGenxvOES => _mesa_TexGenxvOES
  _es_AlphaFuncx => _mesa_AlphaFuncx
  _es_ClearColorx => _mesa_ClearColorx
  _es_ClearDepthx => _mesa_ClearDepthx
  _es_ClipPlanef => _mesa_ClipPlanef
  _es_ClipPlanex => _mesa_ClipPlanex
  _es_Color4x => _mesa_Color4x
  _es_DepthRangex => _mesa_DepthRangex
  _es_DrawTexxOES => _mesa_DrawTexxOES
  _es_DrawTexxvOES => _mesa_DrawTexxvOES
  _es_Fogx => _mesa_Fogx
  _es_Fogxv => _mesa_Fogxv
  _es_Frustumf => _mesa_Frustumf
  _es_Frustumx => _mesa_Frustumx
  _es_GetClipPlanef => _mesa_GetClipPlanef
  _es_GetClipPlanex => _mesa_GetClipPlanex
  _es_GetLightxv => _mesa_GetLightxv
  _es_GetMaterialxv => _mesa_GetMaterialxv
  _es_GetTexEnvxv => _mesa_GetTexEnvxv
  _es_GetTexParameterxv => _mesa_GetTexParameterxv
  _es_LightModelx => _mesa_LightModelx
  _es_LightModelxv => _mesa_LightModelxv
  _es_Lightx => _mesa_Lightx
  _es_Lightxv => _mesa_Lightxv
  _es_LineWidthx => _mesa_LineWidthx
  _es_LoadMatrixx => _mesa_LoadMatrixx
  _es_Materialx => _mesa_Materialx
  _es_Materialxv => _mesa_Materialxv
  _es_MultMatrixx => _mesa_MultMatrixx
  _es_MultiTexCoord4x => _mesa_MultiTexCoord4x
  _es_Normal3x => _mesa_Normal3x
  _es_Orthof => _mesa_Orthof
  _es_Orthox => _mesa_Orthox
  _es_PointParameterx => _mesa_PointParameterx
  _es_PointParameterxv => _mesa_PointParameterxv
  _es_PointSizex => _mesa_PointSizex
  _es_PolygonOffsetx => _mesa_PolygonOffsetx
  _es_QueryMatrixxOES => _mesa_QueryMatrixxOES
  _es_Rotatex => _mesa_Rotatex
  _es_SampleCoveragex => _mesa_SampleCoveragex
  _es_Scalex => _mesa_Scalex
  _es_TexEnvx => _mesa_TexEnvx
  _es_TexEnvxv => _mesa_TexEnvxv
  _es_TexParameterx => _mesa_TexParameterx
  _es_TexParameterxv => _mesa_TexParameterxv
  _es_Translatex => _mesa_Translatex
  _mesa_ActiveTextureARB => _mesa_ActiveTexture
  _mesa_BeginQueryARB => _mesa_BeginQuery
  _mesa_BindAttribLocationARB => _mesa_BindAttribLocation
  _mesa_BindBufferARB => _mesa_BindBuffer
  _mesa_BindFramebufferEXT => _mesa_BindFramebuffer
  _mesa_BindProgram => _mesa_BindProgramARB
  _mesa_BindRenderbufferEXT => _mesa_BindRenderbuffer
  _mesa_BlendEquationSeparateEXT => _mesa_BlendEquationSeparate
  _mesa_BlendEquationSeparatei => _mesa_BlendEquationSeparateiARB
  _mesa_BlendEquationi => _mesa_BlendEquationiARB
  _mesa_BlendFuncSeparateEXT => _mesa_BlendFuncSeparate
  _mesa_BlendFuncSeparatei => _mesa_BlendFuncSeparateiARB
  _mesa_BlendFunci => _mesa_BlendFunciARB
  _mesa_BlitFramebufferEXT => _mesa_BlitFramebuffer
  _mesa_BufferDataARB => _mesa_BufferData
  _mesa_BufferSubDataARB => _mesa_BufferSubData
  _mesa_CheckFramebufferStatusEXT => _mesa_CheckFramebufferStatus
  _mesa_ClampColorARB => _mesa_ClampColor
  _mesa_ClientActiveTextureARB => _mesa_ClientActiveTexture
  _mesa_ColorMaskIndexed => _mesa_ColorMaski
  _mesa_CompileShaderARB => _mesa_CompileShader
  _mesa_CompressedTexImage1DARB => _mesa_CompressedTexImage1D
  _mesa_CompressedTexImage2DARB => _mesa_CompressedTexImage2D
  _mesa_CompressedTexImage3DARB => _mesa_CompressedTexImage3D
  _mesa_CompressedTexSubImage1DARB => _mesa_CompressedTexSubImage1D
  _mesa_CompressedTexSubImage2DARB => _mesa_CompressedTexSubImage2D
  _mesa_CompressedTexSubImage3DARB => _mesa_CompressedTexSubImage3D
  _mesa_DeleteBuffersARB => _mesa_DeleteBuffers
  _mesa_DeleteFramebuffersEXT => _mesa_DeleteFramebuffers
  _mesa_DeletePrograms => _mesa_DeleteProgramsARB
  _mesa_DeleteQueriesARB => _mesa_DeleteQueries
  _mesa_DeleteRenderbuffersEXT => _mesa_DeleteRenderbuffers
  _mesa_DeleteVertexArraysAPPLE => _mesa_DeleteVertexArrays
  _mesa_DisableIndexed => _mesa_Disablei
  _mesa_DisableVertexAttribArrayARB => _mesa_DisableVertexAttribArray
  _mesa_DrawBuffersARB => _mesa_DrawBuffers
  _mesa_DrawTexf => _mesa_DrawTexfOES
  _mesa_DrawTexfv => _mesa_DrawTexfvOES
  _mesa_DrawTexi => _mesa_DrawTexiOES
  _mesa_DrawTexiv => _mesa_DrawTexivOES
  _mesa_DrawTexs => _mesa_DrawTexsOES
  _mesa_DrawTexsv => _mesa_DrawTexsvOES
  _mesa_EnableIndexed => _mesa_Enablei
  _mesa_EnableVertexAttribArrayARB => _mesa_EnableVertexAttribArray
  _mesa_EndQueryARB => _mesa_EndQuery
  _mesa_FogCoordPointerEXT => _mesa_FogCoordPointer
  _mesa_FramebufferRenderbufferEXT => _mesa_FramebufferRenderbuffer
  _mesa_FramebufferTexture1DEXT => _mesa_FramebufferTexture1D
  _mesa_FramebufferTexture2DEXT => _mesa_FramebufferTexture2D
  _mesa_FramebufferTexture3DEXT => _mesa_FramebufferTexture3D
  _mesa_FramebufferTextureLayerEXT => _mesa_FramebufferTextureLayer
  _mesa_GenBuffersARB => _mesa_GenBuffers
  _mesa_GenFramebuffersEXT => _mesa_GenFramebuffers
  _mesa_GenPrograms => _mesa_GenProgramsARB
  _mesa_GenQueriesARB => _mesa_GenQueries
  _mesa_GenRenderbuffersEXT => _mesa_GenRenderbuffers
  _mesa_GenerateMipmapEXT => _mesa_GenerateMipmap
  _mesa_GetActiveAttribARB => _mesa_GetActiveAttrib
  _mesa_GetActiveUniformARB => _mesa_GetActiveUniform
  _mesa_GetAttribLocationARB => _mesa_GetAttribLocation
  _mesa_GetBooleanIndexedv => _mesa_GetBooleani_v
  _mesa_GetBufferParameterivARB => _mesa_GetBufferParameteriv
  _mesa_GetBufferPointervARB => _mesa_GetBufferPointerv
  _mesa_GetBufferSubDataARB => _mesa_GetBufferSubData
  _mesa_GetCompressedTexImageARB => _mesa_GetCompressedTexImage
  _mesa_GetFramebufferAttachmentParameterivEXT => _mesa_GetFramebufferAttachmentParameteriv
  _mesa_GetIntegerIndexedv => _mesa_GetIntegeri_v
  _mesa_GetQueryObjecti64vEXT => _mesa_GetQueryObjecti64v
  _mesa_GetQueryObjectivARB => _mesa_GetQueryObjectiv
  _mesa_GetQueryObjectui64vEXT => _mesa_GetQueryObjectui64v
  _mesa_GetQueryObjectuivARB => _mesa_GetQueryObjectuiv
  _mesa_GetQueryivARB => _mesa_GetQueryiv
  _mesa_GetRenderbufferParameterivEXT => _mesa_GetRenderbufferParameteriv
  _mesa_GetShaderSourceARB => _mesa_GetShaderSource
  _mesa_GetUniformLocationARB => _mesa_GetUniformLocation
  _mesa_GetUniformfvARB => _mesa_GetUniformfv
  _mesa_GetUniformivARB => _mesa_GetUniformiv
  _mesa_GetVertexAttribPointervARB => _mesa_GetVertexAttribPointerv
  _mesa_GetVertexAttribdvARB => _mesa_GetVertexAttribdv
  _mesa_GetVertexAttribfvARB => _mesa_GetVertexAttribfv
  _mesa_GetVertexAttribivARB => _mesa_GetVertexAttribiv
  _mesa_IsBufferARB => _mesa_IsBuffer
  _mesa_IsEnabledIndexed => _mesa_IsEnabledi
  _mesa_IsFramebufferEXT => _mesa_IsFramebuffer
  _mesa_IsQueryARB => _mesa_IsQuery
  _mesa_IsRenderbufferEXT => _mesa_IsRenderbuffer
  _mesa_IsVertexArrayAPPLE => _mesa_IsVertexArray
  _mesa_LinkProgramARB => _mesa_LinkProgram
  _mesa_LoadTransposeMatrixdARB => _mesa_LoadTransposeMatrixd
  _mesa_LoadTransposeMatrixfARB => _mesa_LoadTransposeMatrixf
  _mesa_MapBufferARB => _mesa_MapBuffer
  _mesa_MultTransposeMatrixdARB => _mesa_MultTransposeMatrixd
  _mesa_MultTransposeMatrixfARB => _mesa_MultTransposeMatrixf
  _mesa_MultiDrawArraysEXT => _mesa_MultiDrawArrays
  _mesa_PointSizePointer => _mesa_PointSizePointerOES
  _mesa_ProvokingVertexEXT => _mesa_ProvokingVertex
  _mesa_RenderbufferStorageEXT => _mesa_RenderbufferStorage
  _mesa_SampleCoverageARB => _mesa_SampleCoverage
  _mesa_SecondaryColorPointerEXT => _mesa_SecondaryColorPointer
  _mesa_ShaderSourceARB => _mesa_ShaderSource
  _mesa_Uniform1fARB => _mesa_Uniform1f
  _mesa_Uniform1fvARB => _mesa_Uniform1fv
  _mesa_Uniform1iARB => _mesa_Uniform1i
  _mesa_Uniform1ivARB => _mesa_Uniform1iv
  _mesa_Uniform2fARB => _mesa_Uniform2f
  _mesa_Uniform2fvARB => _mesa_Uniform2fv
  _mesa_Uniform2iARB => _mesa_Uniform2i
  _mesa_Uniform2ivARB => _mesa_Uniform2iv
  _mesa_Uniform3fARB => _mesa_Uniform3f
  _mesa_Uniform3fvARB => _mesa_Uniform3fv
  _mesa_Uniform3iARB => _mesa_Uniform3i
  _mesa_Uniform3ivARB => _mesa_Uniform3iv
  _mesa_Uniform4fARB => _mesa_Uniform4f
  _mesa_Uniform4fvARB => _mesa_Uniform4fv
  _mesa_Uniform4iARB => _mesa_Uniform4i
  _mesa_Uniform4ivARB => _mesa_Uniform4iv
  _mesa_UniformMatrix2fvARB => _mesa_UniformMatrix2fv
  _mesa_UniformMatrix3fvARB => _mesa_UniformMatrix3fv
  _mesa_UniformMatrix4fvARB => _mesa_UniformMatrix4fv
  _mesa_UnmapBufferARB => _mesa_UnmapBuffer
  _mesa_UseProgramObjectARB => _mesa_UseProgram
  _mesa_ValidateProgramARB => _mesa_ValidateProgram
  _mesa_VertexAttribPointerARB => _mesa_VertexAttribPointer
  _mesa_WindowPos2dMESA => _mesa_WindowPos2d
  _mesa_WindowPos2dvMESA => _mesa_WindowPos2dv
  _mesa_WindowPos2fMESA => _mesa_WindowPos2f
  _mesa_WindowPos2fvMESA => _mesa_WindowPos2fv
  _mesa_WindowPos2iMESA => _mesa_WindowPos2i
  _mesa_WindowPos2ivMESA => _mesa_WindowPos2iv
  _mesa_WindowPos2sMESA => _mesa_WindowPos2s
  _mesa_WindowPos2svMESA => _mesa_WindowPos2sv
  _mesa_WindowPos3dMESA => _mesa_WindowPos3d
  _mesa_WindowPos3dvMESA => _mesa_WindowPos3dv
  _mesa_WindowPos3fMESA => _mesa_WindowPos3f
  _mesa_WindowPos3fvMESA => _mesa_WindowPos3fv
  _mesa_WindowPos3iMESA => _mesa_WindowPos3i
  _mesa_WindowPos3ivMESA => _mesa_WindowPos3iv
  _mesa_WindowPos3sMESA => _mesa_WindowPos3s
  _mesa_WindowPos3svMESA => _mesa_WindowPos3sv
  loopback_Color3b_f => _mesa_Color3b
  loopback_Color3bv_f => _mesa_Color3bv
  loopback_Color3d_f => _mesa_Color3d
  loopback_Color3dv_f => _mesa_Color3dv
  loopback_Color3i_f => _mesa_Color3i
  loopback_Color3iv_f => _mesa_Color3iv
  loopback_Color3s_f => _mesa_Color3s
  loopback_Color3sv_f => _mesa_Color3sv
  loopback_Color3ub_f => _mesa_Color3ub
  loopback_Color3ubv_f => _mesa_Color3ubv
  loopback_Color3ui_f => _mesa_Color3ui
  loopback_Color3uiv_f => _mesa_Color3uiv
  loopback_Color3us_f => _mesa_Color3us
  loopback_Color3usv_f => _mesa_Color3usv
  loopback_Color4b_f => _mesa_Color4b
  loopback_Color4bv_f => _mesa_Color4bv
  loopback_Color4d_f => _mesa_Color4d
  loopback_Color4dv_f => _mesa_Color4dv
  loopback_Color4i_f => _mesa_Color4i
  loopback_Color4iv_f => _mesa_Color4iv
  loopback_Color4s_f => _mesa_Color4s
  loopback_Color4sv_f => _mesa_Color4sv
  loopback_Color4ub_f => _mesa_Color4ub
  loopback_Color4ubv_f => _mesa_Color4ubv
  loopback_Color4ui_f => _mesa_Color4ui
  loopback_Color4uiv_f => _mesa_Color4uiv
  loopback_Color4us_f => _mesa_Color4us
  loopback_Color4usv_f => _mesa_Color4usv
  loopback_EdgeFlagv => _mesa_EdgeFlagv
  loopback_EvalCoord1d => _mesa_EvalCoord1d
  loopback_EvalCoord1dv => _mesa_EvalCoord1dv
  loopback_EvalCoord1fv => _mesa_EvalCoord1fv
  loopback_EvalCoord2d => _mesa_EvalCoord2d
  loopback_EvalCoord2dv => _mesa_EvalCoord2dv
  loopback_EvalCoord2fv => _mesa_EvalCoord2fv
  loopback_FogCoorddEXT => _mesa_FogCoordd
  loopback_FogCoorddvEXT => _mesa_FogCoorddv
  loopback_Indexd => _mesa_Indexd
  loopback_Indexdv => _mesa_Indexdv
  loopback_Indexi => _mesa_Indexi
  loopback_Indexiv => _mesa_Indexiv
  loopback_Indexs => _mesa_Indexs
  loopback_Indexsv => _mesa_Indexsv
  loopback_Indexub => _mesa_Indexub
  loopback_Indexubv => _mesa_Indexubv
  loopback_Materialf => _mesa_Materialf
  loopback_Materiali => _mesa_Materiali
  loopback_Materialiv => _mesa_Materialiv
  loopback_MultiTexCoord1dARB => _mesa_MultiTexCoord1d
  loopback_MultiTexCoord1dvARB => _mesa_MultiTexCoord1dv
  loopback_MultiTexCoord1iARB => _mesa_MultiTexCoord1i
  loopback_MultiTexCoord1ivARB => _mesa_MultiTexCoord1iv
  loopback_MultiTexCoord1sARB => _mesa_MultiTexCoord1s
  loopback_MultiTexCoord1svARB => _mesa_MultiTexCoord1sv
  loopback_MultiTexCoord2dARB => _mesa_MultiTexCoord2d
  loopback_MultiTexCoord2dvARB => _mesa_MultiTexCoord2dv
  loopback_MultiTexCoord2iARB => _mesa_MultiTexCoord2i
  loopback_MultiTexCoord2ivARB => _mesa_MultiTexCoord2iv
  loopback_MultiTexCoord2sARB => _mesa_MultiTexCoord2s
  loopback_MultiTexCoord2svARB => _mesa_MultiTexCoord2sv
  loopback_MultiTexCoord3dARB => _mesa_MultiTexCoord3d
  loopback_MultiTexCoord3dvARB => _mesa_MultiTexCoord3dv
  loopback_MultiTexCoord3iARB => _mesa_MultiTexCoord3i
  loopback_MultiTexCoord3ivARB => _mesa_MultiTexCoord3iv
  loopback_MultiTexCoord3sARB => _mesa_MultiTexCoord3s
  loopback_MultiTexCoord3svARB => _mesa_MultiTexCoord3sv
  loopback_MultiTexCoord4dARB => _mesa_MultiTexCoord4d
  loopback_MultiTexCoord4dvARB => _mesa_MultiTexCoord4dv
  loopback_MultiTexCoord4iARB => _mesa_MultiTexCoord4i
  loopback_MultiTexCoord4ivARB => _mesa_MultiTexCoord4iv
  loopback_MultiTexCoord4sARB => _mesa_MultiTexCoord4s
  loopback_MultiTexCoord4svARB => _mesa_MultiTexCoord4sv
  loopback_Normal3b => _mesa_Normal3b
  loopback_Normal3bv => _mesa_Normal3bv
  loopback_Normal3d => _mesa_Normal3d
  loopback_Normal3dv => _mesa_Normal3dv
  loopback_Normal3i => _mesa_Normal3i
  loopback_Normal3iv => _mesa_Normal3iv
  loopback_Normal3s => _mesa_Normal3s
  loopback_Normal3sv => _mesa_Normal3sv
  loopback_Rectd => _mesa_Rectd
  loopback_Rectdv => _mesa_Rectdv
  loopback_Rectfv => _mesa_Rectfv
  loopback_Recti => _mesa_Recti
  loopback_Rectiv => _mesa_Rectiv
  loopback_Rects => _mesa_Rects
  loopback_Rectsv => _mesa_Rectsv
  loopback_SecondaryColor3bEXT_f => _mesa_SecondaryColor3b
  loopback_SecondaryColor3bvEXT_f => _mesa_SecondaryColor3bv
  loopback_SecondaryColor3dEXT_f => _mesa_SecondaryColor3d
  loopback_SecondaryColor3dvEXT_f => _mesa_SecondaryColor3dv
  loopback_SecondaryColor3iEXT_f => _mesa_SecondaryColor3i
  loopback_SecondaryColor3ivEXT_f => _mesa_SecondaryColor3iv
  loopback_SecondaryColor3sEXT_f => _mesa_SecondaryColor3s
  loopback_SecondaryColor3svEXT_f => _mesa_SecondaryColor3sv
  loopback_SecondaryColor3ubEXT_f => _mesa_SecondaryColor3ub
  loopback_SecondaryColor3ubvEXT_f => _mesa_SecondaryColor3ubv
  loopback_SecondaryColor3uiEXT_f => _mesa_SecondaryColor3ui
  loopback_SecondaryColor3uivEXT_f => _mesa_SecondaryColor3uiv
  loopback_SecondaryColor3usEXT_f => _mesa_SecondaryColor3us
  loopback_SecondaryColor3usvEXT_f => _mesa_SecondaryColor3usv
  loopback_TexCoord1d => _mesa_TexCoord1d
  loopback_TexCoord1dv => _mesa_TexCoord1dv
  loopback_TexCoord1i => _mesa_TexCoord1i
  loopback_TexCoord1iv => _mesa_TexCoord1iv
  loopback_TexCoord1s => _mesa_TexCoord1s
  loopback_TexCoord1sv => _mesa_TexCoord1sv
  loopback_TexCoord2d => _mesa_TexCoord2d
  loopback_TexCoord2dv => _mesa_TexCoord2dv
  loopback_TexCoord2i => _mesa_TexCoord2i
  loopback_TexCoord2iv => _mesa_TexCoord2iv
  loopback_TexCoord2s => _mesa_TexCoord2s
  loopback_TexCoord2sv => _mesa_TexCoord2sv
  loopback_TexCoord3d => _mesa_TexCoord3d
  loopback_TexCoord3dv => _mesa_TexCoord3dv
  loopback_TexCoord3i => _mesa_TexCoord3i
  loopback_TexCoord3iv => _mesa_TexCoord3iv
  loopback_TexCoord3s => _mesa_TexCoord3s
  loopback_TexCoord3sv => _mesa_TexCoord3sv
  loopback_TexCoord4d => _mesa_TexCoord4d
  loopback_TexCoord4dv => _mesa_TexCoord4dv
  loopback_TexCoord4i => _mesa_TexCoord4i
  loopback_TexCoord4iv => _mesa_TexCoord4iv
  loopback_TexCoord4s => _mesa_TexCoord4s
  loopback_TexCoord4sv => _mesa_TexCoord4sv
  loopback_Vertex2d => _mesa_Vertex2d
  loopback_Vertex2dv => _mesa_Vertex2dv
  loopback_Vertex2i => _mesa_Vertex2i
  loopback_Vertex2iv => _mesa_Vertex2iv
  loopback_Vertex2s => _mesa_Vertex2s
  loopback_Vertex2sv => _mesa_Vertex2sv
  loopback_Vertex3d => _mesa_Vertex3d
  loopback_Vertex3dv => _mesa_Vertex3dv
  loopback_Vertex3i => _mesa_Vertex3i
  loopback_Vertex3iv => _mesa_Vertex3iv
  loopback_Vertex3s => _mesa_Vertex3s
  loopback_Vertex3sv => _mesa_Vertex3sv
  loopback_Vertex4d => _mesa_Vertex4d
  loopback_Vertex4dv => _mesa_Vertex4dv
  loopback_Vertex4i => _mesa_Vertex4i
  loopback_Vertex4iv => _mesa_Vertex4iv
  loopback_Vertex4s => _mesa_Vertex4s
  loopback_Vertex4sv => _mesa_Vertex4sv
  loopback_VertexAttrib1dARB => _mesa_VertexAttrib1d
  loopback_VertexAttrib1dNV => _mesa_VertexAttrib1dNV
  loopback_VertexAttrib1dvARB => _mesa_VertexAttrib1dv
  loopback_VertexAttrib1dvNV => _mesa_VertexAttrib1dvNV
  loopback_VertexAttrib1sARB => _mesa_VertexAttrib1s
  loopback_VertexAttrib1sNV => _mesa_VertexAttrib1sNV
  loopback_VertexAttrib1svARB => _mesa_VertexAttrib1sv
  loopback_VertexAttrib1svNV => _mesa_VertexAttrib1svNV
  loopback_VertexAttrib2dARB => _mesa_VertexAttrib2d
  loopback_VertexAttrib2dNV => _mesa_VertexAttrib2dNV
  loopback_VertexAttrib2dvARB => _mesa_VertexAttrib2dv
  loopback_VertexAttrib2dvNV => _mesa_VertexAttrib2dvNV
  loopback_VertexAttrib2sARB => _mesa_VertexAttrib2s
  loopback_VertexAttrib2sNV => _mesa_VertexAttrib2sNV
  loopback_VertexAttrib2svARB => _mesa_VertexAttrib2sv
  loopback_VertexAttrib2svNV => _mesa_VertexAttrib2svNV
  loopback_VertexAttrib3dARB => _mesa_VertexAttrib3d
  loopback_VertexAttrib3dNV => _mesa_VertexAttrib3dNV
  loopback_VertexAttrib3dvARB => _mesa_VertexAttrib3dv
  loopback_VertexAttrib3dvNV => _mesa_VertexAttrib3dvNV
  loopback_VertexAttrib3sARB => _mesa_VertexAttrib3s
  loopback_VertexAttrib3sNV => _mesa_VertexAttrib3sNV
  loopback_VertexAttrib3svARB => _mesa_VertexAttrib3sv
  loopback_VertexAttrib3svNV => _mesa_VertexAttrib3svNV
  loopback_VertexAttrib4NbvARB => _mesa_VertexAttrib4Nbv
  loopback_VertexAttrib4NivARB => _mesa_VertexAttrib4Niv
  loopback_VertexAttrib4NsvARB => _mesa_VertexAttrib4Nsv
  loopback_VertexAttrib4NubARB => _mesa_VertexAttrib4Nub
  loopback_VertexAttrib4NubvARB => _mesa_VertexAttrib4Nubv
  loopback_VertexAttrib4NuivARB => _mesa_VertexAttrib4Nuiv
  loopback_VertexAttrib4NusvARB => _mesa_VertexAttrib4Nusv
  loopback_VertexAttrib4bvARB => _mesa_VertexAttrib4bv
  loopback_VertexAttrib4dARB => _mesa_VertexAttrib4d
  loopback_VertexAttrib4dNV => _mesa_VertexAttrib4dNV
  loopback_VertexAttrib4dvARB => _mesa_VertexAttrib4dv
  loopback_VertexAttrib4dvNV => _mesa_VertexAttrib4dvNV
  loopback_VertexAttrib4ivARB => _mesa_VertexAttrib4iv
  loopback_VertexAttrib4sARB => _mesa_VertexAttrib4s
  loopback_VertexAttrib4sNV => _mesa_VertexAttrib4sNV
  loopback_VertexAttrib4svARB => _mesa_VertexAttrib4sv
  loopback_VertexAttrib4svNV => _mesa_VertexAttrib4svNV
  loopback_VertexAttrib4ubNV => _mesa_VertexAttrib4ubNV
  loopback_VertexAttrib4ubvARB => _mesa_VertexAttrib4ubv
  loopback_VertexAttrib4ubvNV => _mesa_VertexAttrib4ubvNV
  loopback_VertexAttrib4uivARB => _mesa_VertexAttrib4uiv
  loopback_VertexAttrib4usvARB => _mesa_VertexAttrib4usv
  loopback_VertexAttribI1iv => _mesa_VertexAttribI1iv
  loopback_VertexAttribI1uiv => _mesa_VertexAttribI1uiv
  loopback_VertexAttribI4bv => _mesa_VertexAttribI4bv
  loopback_VertexAttribI4sv => _mesa_VertexAttribI4sv
  loopback_VertexAttribI4ubv => _mesa_VertexAttribI4ubv
  loopback_VertexAttribI4usv => _mesa_VertexAttribI4usv
  loopback_VertexAttribs1dvNV => _mesa_VertexAttribs1dvNV
  loopback_VertexAttribs1fvNV => _mesa_VertexAttribs1fvNV
  loopback_VertexAttribs1svNV => _mesa_VertexAttribs1svNV
  loopback_VertexAttribs2dvNV => _mesa_VertexAttribs2dvNV
  loopback_VertexAttribs2fvNV => _mesa_VertexAttribs2fvNV
  loopback_VertexAttribs2svNV => _mesa_VertexAttribs2svNV
  loopback_VertexAttribs3dvNV => _mesa_VertexAttribs3dvNV
  loopback_VertexAttribs3fvNV => _mesa_VertexAttribs3fvNV
  loopback_VertexAttribs3svNV => _mesa_VertexAttribs3svNV
  loopback_VertexAttribs4dvNV => _mesa_VertexAttribs4dvNV
  loopback_VertexAttribs4fvNV => _mesa_VertexAttribs4fvNV
  loopback_VertexAttribs4svNV => _mesa_VertexAttribs4svNV
  loopback_VertexAttribs4ubvNV => _mesa_VertexAttribs4ubvNV

And changes the primary name assignment in the XML as follows:
  ActiveTextureARB => ActiveTexture
  AlphaFuncxOES => AlphaFuncx
  BeginConditionalRenderNV => BeginConditionalRender
  BeginQueryARB => BeginQuery
  BeginTransformFeedbackEXT => BeginTransformFeedback
  BindAttribLocationARB => BindAttribLocation
  BindBufferARB => BindBuffer
  BindBufferBaseEXT => BindBufferBase
  BindBufferRangeEXT => BindBufferRange
  BindFragDataLocationEXT => BindFragDataLocation
  BindFramebufferEXT => BindFramebuffer
  BindProgramNV => BindProgramARB
  BindRenderbufferEXT => BindRenderbuffer
  BlendEquationSeparateEXT => BlendEquationSeparate
  BlendFuncSeparateEXT => BlendFuncSeparate
  BlitFramebufferEXT => BlitFramebuffer
  BufferDataARB => BufferData
  BufferSubDataARB => BufferSubData
  CheckFramebufferStatusEXT => CheckFramebufferStatus
  ClampColorARB => ClampColor
  ClearColorxOES => ClearColorx
  ClearDepthxOES => ClearDepthx
  ClientActiveTextureARB => ClientActiveTexture
  ClipPlanefOES => ClipPlanef
  ClipPlanexOES => ClipPlanex
  Color4xOES => Color4x
  ColorMaskIndexedEXT => ColorMaski
  CompileShaderARB => CompileShader
  CompressedTexImage1DARB => CompressedTexImage1D
  CompressedTexImage2DARB => CompressedTexImage2D
  CompressedTexImage3DARB => CompressedTexImage3D
  CompressedTexSubImage1DARB => CompressedTexSubImage1D
  CompressedTexSubImage2DARB => CompressedTexSubImage2D
  CompressedTexSubImage3DARB => CompressedTexSubImage3D
  DeleteBuffersARB => DeleteBuffers
  DeleteFramebuffersEXT => DeleteFramebuffers
  DeleteProgramsNV => DeleteProgramsARB
  DeleteQueriesARB => DeleteQueries
  DeleteRenderbuffersEXT => DeleteRenderbuffers
  DeleteVertexArraysAPPLE => DeleteVertexArrays
  DepthRangexOES => DepthRangex
  DisableIndexedEXT => Disablei
  DisableVertexAttribArrayARB => DisableVertexAttribArray
  DrawBuffersARB => DrawBuffers
  EnableIndexedEXT => Enablei
  EnableVertexAttribArrayARB => EnableVertexAttribArray
  EndConditionalRenderNV => EndConditionalRender
  EndQueryARB => EndQuery
  EndTransformFeedbackEXT => EndTransformFeedback
  FogCoordPointerEXT => FogCoordPointer
  FogCoorddEXT => FogCoordd
  FogCoorddvEXT => FogCoorddv
  FogxOES => Fogx
  FogxvOES => Fogxv
  FramebufferRenderbufferEXT => FramebufferRenderbuffer
  FramebufferTexture1DEXT => FramebufferTexture1D
  FramebufferTexture2DEXT => FramebufferTexture2D
  FramebufferTexture3DEXT => FramebufferTexture3D
  FramebufferTextureLayerEXT => FramebufferTextureLayer
  FrustumfOES => Frustumf
  FrustumxOES => Frustumx
  GenBuffersARB => GenBuffers
  GenFramebuffersEXT => GenFramebuffers
  GenProgramsNV => GenProgramsARB
  GenQueriesARB => GenQueries
  GenRenderbuffersEXT => GenRenderbuffers
  GenerateMipmapEXT => GenerateMipmap
  GetActiveAttribARB => GetActiveAttrib
  GetActiveUniformARB => GetActiveUniform
  GetAttribLocationARB => GetAttribLocation
  GetBooleanIndexedvEXT => GetBooleani_v
  GetBufferParameterivARB => GetBufferParameteriv
  GetBufferPointervARB => GetBufferPointerv
  GetBufferSubDataARB => GetBufferSubData
  GetClipPlanefOES => GetClipPlanef
  GetClipPlanexOES => GetClipPlanex
  GetCompressedTexImageARB => GetCompressedTexImage
  GetFixedvOES => GetFixedv
  GetFragDataLocationEXT => GetFragDataLocation
  GetFramebufferAttachmentParameterivEXT => GetFramebufferAttachmentParameteriv
  GetIntegerIndexedvEXT => GetIntegeri_v
  GetLightxvOES => GetLightxv
  GetMaterialxvOES => GetMaterialxv
  GetQueryObjecti64vEXT => GetQueryObjecti64v
  GetQueryObjectivARB => GetQueryObjectiv
  GetQueryObjectui64vEXT => GetQueryObjectui64v
  GetQueryObjectuivARB => GetQueryObjectuiv
  GetQueryivARB => GetQueryiv
  GetRenderbufferParameterivEXT => GetRenderbufferParameteriv
  GetShaderSourceARB => GetShaderSource
  GetTexEnvxvOES => GetTexEnvxv
  GetTexParameterIivEXT => GetTexParameterIiv
  GetTexParameterIuivEXT => GetTexParameterIuiv
  GetTexParameterxvOES => GetTexParameterxv
  GetTransformFeedbackVaryingEXT => GetTransformFeedbackVarying
  GetUniformLocationARB => GetUniformLocation
  GetUniformfvARB => GetUniformfv
  GetUniformivARB => GetUniformiv
  GetUniformuivEXT => GetUniformuiv
  GetVertexAttribIivEXT => GetVertexAttribIiv
  GetVertexAttribIuivEXT => GetVertexAttribIuiv
  GetVertexAttribPointervNV => GetVertexAttribPointerv
  GetVertexAttribdvARB => GetVertexAttribdv
  GetVertexAttribfvARB => GetVertexAttribfv
  GetVertexAttribivARB => GetVertexAttribiv
  IsBufferARB => IsBuffer
  IsEnabledIndexedEXT => IsEnabledi
  IsFramebufferEXT => IsFramebuffer
  IsProgramNV => IsProgramARB
  IsQueryARB => IsQuery
  IsRenderbufferEXT => IsRenderbuffer
  IsVertexArrayAPPLE => IsVertexArray
  LightModelxOES => LightModelx
  LightModelxvOES => LightModelxv
  LightxOES => Lightx
  LightxvOES => Lightxv
  LineWidthxOES => LineWidthx
  LinkProgramARB => LinkProgram
  LoadMatrixxOES => LoadMatrixx
  LoadTransposeMatrixdARB => LoadTransposeMatrixd
  LoadTransposeMatrixfARB => LoadTransposeMatrixf
  MapBufferARB => MapBuffer
  MaterialxOES => Materialx
  MaterialxvOES => Materialxv
  MultMatrixxOES => MultMatrixx
  MultTransposeMatrixdARB => MultTransposeMatrixd
  MultTransposeMatrixfARB => MultTransposeMatrixf
  MultiDrawArraysEXT => MultiDrawArrays
  MultiTexCoord1dARB => MultiTexCoord1d
  MultiTexCoord1dvARB => MultiTexCoord1dv
  MultiTexCoord1iARB => MultiTexCoord1i
  MultiTexCoord1ivARB => MultiTexCoord1iv
  MultiTexCoord1sARB => MultiTexCoord1s
  MultiTexCoord1svARB => MultiTexCoord1sv
  MultiTexCoord2dARB => MultiTexCoord2d
  MultiTexCoord2dvARB => MultiTexCoord2dv
  MultiTexCoord2iARB => MultiTexCoord2i
  MultiTexCoord2ivARB => MultiTexCoord2iv
  MultiTexCoord2sARB => MultiTexCoord2s
  MultiTexCoord2svARB => MultiTexCoord2sv
  MultiTexCoord3dARB => MultiTexCoord3d
  MultiTexCoord3dvARB => MultiTexCoord3dv
  MultiTexCoord3iARB => MultiTexCoord3i
  MultiTexCoord3ivARB => MultiTexCoord3iv
  MultiTexCoord3sARB => MultiTexCoord3s
  MultiTexCoord3svARB => MultiTexCoord3sv
  MultiTexCoord4dARB => MultiTexCoord4d
  MultiTexCoord4dvARB => MultiTexCoord4dv
  MultiTexCoord4iARB => MultiTexCoord4i
  MultiTexCoord4ivARB => MultiTexCoord4iv
  MultiTexCoord4sARB => MultiTexCoord4s
  MultiTexCoord4svARB => MultiTexCoord4sv
  MultiTexCoord4xOES => MultiTexCoord4x
  Normal3xOES => Normal3x
  OrthofOES => Orthof
  OrthoxOES => Orthox
  PointParameterfEXT => PointParameterf
  PointParameterfvEXT => PointParameterfv
  PointParameteriNV => PointParameteri
  PointParameterivNV => PointParameteriv
  PointParameterxOES => PointParameterx
  PointParameterxvOES => PointParameterxv
  PointSizexOES => PointSizex
  PolygonOffsetxOES => PolygonOffsetx
  PrimitiveRestartIndexNV => PrimitiveRestartIndex
  ProvokingVertexEXT => ProvokingVertex
  RenderbufferStorageEXT => RenderbufferStorage
  RotatexOES => Rotatex
  SampleCoverageARB => SampleCoverage
  SampleCoveragexOES => SampleCoveragex
  ScalexOES => Scalex
  SecondaryColor3bEXT => SecondaryColor3b
  SecondaryColor3bvEXT => SecondaryColor3bv
  SecondaryColor3dEXT => SecondaryColor3d
  SecondaryColor3dvEXT => SecondaryColor3dv
  SecondaryColor3iEXT => SecondaryColor3i
  SecondaryColor3ivEXT => SecondaryColor3iv
  SecondaryColor3sEXT => SecondaryColor3s
  SecondaryColor3svEXT => SecondaryColor3sv
  SecondaryColor3ubEXT => SecondaryColor3ub
  SecondaryColor3ubvEXT => SecondaryColor3ubv
  SecondaryColor3uiEXT => SecondaryColor3ui
  SecondaryColor3uivEXT => SecondaryColor3uiv
  SecondaryColor3usEXT => SecondaryColor3us
  SecondaryColor3usvEXT => SecondaryColor3usv
  SecondaryColorPointerEXT => SecondaryColorPointer
  ShaderSourceARB => ShaderSource
  TexBufferARB => TexBuffer
  TexEnvxOES => TexEnvx
  TexEnvxvOES => TexEnvxv
  TexParameterIivEXT => TexParameterIiv
  TexParameterIuivEXT => TexParameterIuiv
  TexParameterxOES => TexParameterx
  TexParameterxvOES => TexParameterxv
  TransformFeedbackVaryingsEXT => TransformFeedbackVaryings
  TranslatexOES => Translatex
  Uniform1fARB => Uniform1f
  Uniform1fvARB => Uniform1fv
  Uniform1iARB => Uniform1i
  Uniform1ivARB => Uniform1iv
  Uniform1uiEXT => Uniform1ui
  Uniform1uivEXT => Uniform1uiv
  Uniform2fARB => Uniform2f
  Uniform2fvARB => Uniform2fv
  Uniform2iARB => Uniform2i
  Uniform2ivARB => Uniform2iv
  Uniform2uiEXT => Uniform2ui
  Uniform2uivEXT => Uniform2uiv
  Uniform3fARB => Uniform3f
  Uniform3fvARB => Uniform3fv
  Uniform3iARB => Uniform3i
  Uniform3ivARB => Uniform3iv
  Uniform3uiEXT => Uniform3ui
  Uniform3uivEXT => Uniform3uiv
  Uniform4fARB => Uniform4f
  Uniform4fvARB => Uniform4fv
  Uniform4iARB => Uniform4i
  Uniform4ivARB => Uniform4iv
  Uniform4uiEXT => Uniform4ui
  Uniform4uivEXT => Uniform4uiv
  UniformMatrix2fvARB => UniformMatrix2fv
  UniformMatrix3fvARB => UniformMatrix3fv
  UniformMatrix4fvARB => UniformMatrix4fv
  UnmapBufferARB => UnmapBuffer
  UseProgramObjectARB => UseProgram
  ValidateProgramARB => ValidateProgram
  VertexAttrib1dARB => VertexAttrib1d
  VertexAttrib1dvARB => VertexAttrib1dv
  VertexAttrib1sARB => VertexAttrib1s
  VertexAttrib1svARB => VertexAttrib1sv
  VertexAttrib2dARB => VertexAttrib2d
  VertexAttrib2dvARB => VertexAttrib2dv
  VertexAttrib2sARB => VertexAttrib2s
  VertexAttrib2svARB => VertexAttrib2sv
  VertexAttrib3dARB => VertexAttrib3d
  VertexAttrib3dvARB => VertexAttrib3dv
  VertexAttrib3sARB => VertexAttrib3s
  VertexAttrib3svARB => VertexAttrib3sv
  VertexAttrib4NbvARB => VertexAttrib4Nbv
  VertexAttrib4NivARB => VertexAttrib4Niv
  VertexAttrib4NsvARB => VertexAttrib4Nsv
  VertexAttrib4NubARB => VertexAttrib4Nub
  VertexAttrib4NubvARB => VertexAttrib4Nubv
  VertexAttrib4NuivARB => VertexAttrib4Nuiv
  VertexAttrib4NusvARB => VertexAttrib4Nusv
  VertexAttrib4bvARB => VertexAttrib4bv
  VertexAttrib4dARB => VertexAttrib4d
  VertexAttrib4dvARB => VertexAttrib4dv
  VertexAttrib4ivARB => VertexAttrib4iv
  VertexAttrib4sARB => VertexAttrib4s
  VertexAttrib4svARB => VertexAttrib4sv
  VertexAttrib4ubvARB => VertexAttrib4ubv
  VertexAttrib4uivARB => VertexAttrib4uiv
  VertexAttrib4usvARB => VertexAttrib4usv
  VertexAttribDivisorARB => VertexAttribDivisor
  VertexAttribI1ivEXT => VertexAttribI1iv
  VertexAttribI1uivEXT => VertexAttribI1uiv
  VertexAttribI4bvEXT => VertexAttribI4bv
  VertexAttribI4svEXT => VertexAttribI4sv
  VertexAttribI4ubvEXT => VertexAttribI4ubv
  VertexAttribI4usvEXT => VertexAttribI4usv
  VertexAttribIPointerEXT => VertexAttribIPointer
  VertexAttribPointerARB => VertexAttribPointer
  WindowPos2dMESA => WindowPos2d
  WindowPos2dvMESA => WindowPos2dv
  WindowPos2fMESA => WindowPos2f
  WindowPos2fvMESA => WindowPos2fv
  WindowPos2iMESA => WindowPos2i
  WindowPos2ivMESA => WindowPos2iv
  WindowPos2sMESA => WindowPos2s
  WindowPos2svMESA => WindowPos2sv
  WindowPos3dMESA => WindowPos3d
  WindowPos3dvMESA => WindowPos3dv
  WindowPos3fMESA => WindowPos3f
  WindowPos3fvMESA => WindowPos3fv
  WindowPos3iMESA => WindowPos3i
  WindowPos3ivMESA => WindowPos3iv
  WindowPos3sMESA => WindowPos3s
  WindowPos3svMESA => WindowPos3sv

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Paul Berry 33e0004720 dispatch: Include glheader.h in dispatch-related files.
This ensures that GLES1-only typedefs are available in these files.
In a future patch, this will allow us to expand the dispatch table to
include GLES1-only functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:24 -07:00
Ian Romanick 386282b5c2 glx: Add the extension string for GLX_ARB_framebuffer_sRGB
From the GLX perspective, the ARB and EXT extensions are identical.  Use
a single bit for both.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:23 -07:00
Ian Romanick 7b0f912e70 glx: Set sRGBCapable to a default value
Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:15 -07:00
Adam Jackson a30d14635d glx: Add GLXBadProfileARB to the error string list
Note: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-10-17 15:12:14 -04:00
Owen W. Taylor 1d0c621121 glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()
Due to a string mismatch, INTEL_swap_event wasn't listed among GLX
extensions for the connection, even when present on both client and
server. That is, glXQueryServerString and glXGetClientString reported the
extension, but glXQueryExtensionsString did not.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-17 10:16:23 -07:00
Fredrik Höglund 0978707917 glx: Fix a regression in the new XCB code
dri2DrawableGetMSC(), dri2WaitForMSC() and dri2WaitForSBC() were
inadvertently changed to return 0 on success.  This resulted in the callers
returning an error to the client.

Restore the previous behavior and also check that the reply pointers are
valid before accessing them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 02:24:42 +02:00
Eric Anholt 8c472b8f6a glx: Replace DRI2SwapBuffers() custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt f02242a4fa glx: Fix some indentation.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 811602885b glx: Replace DRI2SwapInterval custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 7acf8ae0e1 glx: Reuse setSwapInterval for setting initial swap interval. 2012-10-09 14:32:03 -07:00
Eric Anholt d0937759db glx: Allow glXSwapInterval(0) when vblank_mode=0.
There's no reason to say no in this case.
2012-10-09 14:32:03 -07:00
Eric Anholt ab8ae9301f glx: Replace DRI2GetMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 8e61b9028a glx: Replace DRI2WaitForMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 183ab9e14e glx: Replace DRI2WaitForSBC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt 1e74910bb7 glx/dri1: Remove uncompiled __DRI_SWAP_BUFFER_COUNTER code.
It's been in place but never enabled since 2010.  Note how one piece called a
DRI2 function, suggesting never being tested.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt c35a9388a3 glx: Unifdef some dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

I left in the DRI_TEX_BUFFER_VERSION ifdefs, which is broken and uncompiled
(the version wasn't bumped from 2 to 3 when the patch was landed), but I don't
know what should be done with it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt 3f0e3a7ad5 glx: Unifdef USE_XCB.
It's been required for building glx since
b518dfb513 in january.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Marek Olšák 53d06ecdd0 glx/dri2: use uint64_t instead of double to represent time for FPS calculation
Wine or a windows app changes fpucw to 0x7f, causing doubles to be equivalent
to floats, which broke the calculation of FPS.
We should be very careful about using doubles in Mesa.

Henri Verbeet adds:
  For reference, this is done by for example d3d9 when a D3D device is
  created without D3DCREATE_FPU_PRESERVE set. In the general case
  applications can do all kinds of terrible things to the FPU control
  word of course.
2012-10-03 16:55:48 +02:00
Matt Turner 814345f54b build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition 2012-10-01 15:23:04 -07:00
Matt Turner b6651ae6ad build: Use PTHREAD_LIBS and PTHREAD_CFLAGS 2012-10-01 15:23:04 -07:00
Jonas Maebe 5fdf1f784b darwin: do not create double-buffered offscreen pixel formats
http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-09-24 16:06:07 -07:00
Brian Paul 14f55869a4 glx: move 'prime' var into #ifdef'd code block
To silence unused var warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-06 18:58:49 -06:00
Matt Turner da3282b6e2 Replace another malloc/memset-0 combination with calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner 52789496a7 Remove useless memset after calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner 6bda027e01 Use calloc instead of malloc/memset-0
This patch has been generated by the following Coccinelle semantic
patch:

@@
expression E;
identifier I;
@@
- I = malloc(E);
+ I = calloc(1, E);
...
- memset(I, 0, sizeof *I);

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner 5067506ea6 Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic
patch:

// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
type T;
@@
+ free ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free((T) E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }

@@
expression E;
type T;
@@
+ free ((T) E);
- if (unlikely (E != NULL)) {
-   free ((T) E);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner 2b7a972e3f Don't cast the return value of malloc/realloc
This patch has been generated by the following Coccinelle semantic
patch:

// Don't cast the return value of malloc/realloc.
//
// Casting the return value of malloc/realloc only stands to hide
// errors.

@@
type T;
expression E1, E2;
@@
- (T)
(
_mesa_align_calloc(E1, E2)
|
_mesa_align_malloc(E1, E2)
|
calloc(E1, E2)
|
malloc(E1)
|
realloc(E1, E2)
)
2012-09-05 22:28:50 -07:00
Matt Turner 7c7b7b068b Remove Xcalloc/Xmalloc/Xfree calls
These calls allowed Xlib to use a custom memory allocator, but Xlib has
used the standard C library functions since at least its initial import
into git in 2003. It seems unlikely that it will grow a custom memory
allocator. The functions now just add extra overhead. Replacing them
will make future Coccinelle patches simpler.

This patch has been generated by the following Coccinelle semantic
patch:

// Remove Xcalloc/Xmalloc/Xfree calls

@@ expression E1, E2; @@
- Xcalloc (E1, E2)
+ calloc (E1, E2)

@@ expression E; @@
- Xmalloc (E)
+ malloc (E)

@@ expression E; @@
- Xfree (E)
+ free (E)

@@ expression E; @@
- XFree (E)
+ free (E)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:49 -07:00
Vinson Lee 17a574d7cd Use the correct macro _WIN32 for Windows.
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>
2012-09-05 22:14:32 -07:00
Matt Turner f9786394e5 build: Clean glx Makefile.am
mapi/glapi is already built when make is run in src/glx.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Dave Airlie 6a3ac03f2b glx/dri2: add dri2 prime support.
This adds support for having libGL pick a different driver for prime support.

DRI_PRIME env var is set to the value retrieved from the server randr
provider calls, by the calling process. (generally DRI_PRIME=1 will be
the right answer).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-16 10:02:10 +10:00
Christopher James Halse Rogers 726f534bbb build/glx: fix include paths for out-of-tree builds
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:17 -07:00
Christopher James Halse Rogers b2ecaab7ad build: fix location of generated files in src/mesa (v4)
Also fix include paths for the generated headers.

v2: Switch to using self-explanatory BUILDDIR/SRCDIR defined from
    top_builddir/top_srcdir rather than the ambiguous TOP.
v3: Add both top_builddir and top_srcdir to include flags for mesa asm.
    These rely on both in-tree and build-time-generated includes.
v4: Rebased on top of 948c8f502a.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-08-13 12:24:04 -07:00
Kenneth Graunke 68bccc40f5 glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.
If the application has requested reset notification, then
dri2_convert_glx_attribs will initialize this to the correct value.

Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but
doesn't when num_attribs == 0.  (The consensus seems to be that we
should make it do so, but that's more invasive, so I'm pushing this for
now.)

Fixes a regression since a8724d85f8
where trying to run OilRush_x86 or apitrace heaven_x64 would result in:

dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get
here."' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-08 17:15:21 -07:00
Ian Romanick 99fee476a1 glx: Don't use glapitable.h at all
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>
2012-08-08 10:06:26 -07:00
Ian Romanick f5dffb7e36 glx: Don't rely on struct _glapi_table
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  There are two completely separate code generation paths used to
assign dispatch offset.  Neither has any clue about the other.
Unsurprisingly, the can't agree on what offsets to assign.

This adds a bunch of overhead to __glXNewIndirectAPI, but this function
is called at most once.

The test ExtensionNopDispatch was removed.  There was just no way to
make this test work with the information provided in shared-glapi.
Since indirect_glx.c uses _glapi_get_proc_offset now, it was also
impossible to make the tests work without shared-glapi.  So much pain.

This fixes indirect rendering with shared-glapi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Brad King 27382c0f7b automake: Honor GL_LIB for mangled/custom lib names
Commit 2d4b77c7 (automake: Convert src/mesa/drivers/x11/Makefile to
automake, 2012-06-12) dropped the old Makefile, which used GL_LIB, and
replaced it with a Makefile.am hard-coding the name "GL".  This broke
handling of --enable-mangling and --with-gl-lib-name options which
depend on GL_LIB to specify the GL library name.

Use "@GL_LIB@" in src/mesa/drivers/x11/Makefile.am to configure the
library name.  Also use this approach to simplify src/glx/Makefile.am
and drop the HAVE_MANGLED_GL conditional.  While at it, fix the
compatibility link we create in "lib" for the software-only driver to
use version GL_MAJOR instead of hard-coding "1".

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-07-23 22:34:13 -07:00
Matt Turner f42e601ce0 glx: build tests after libglx.la
Previously, if you ran make followed by make check it would work, but
if you just ran make check the test program would fail to compile.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-17 06:59:00 -07:00
Jon TURNEY b2a37e242e automake: convert libglapi
* "configure substitutions are not allowed in _SOURCES variables" in automake,
so remove the AC_SUBST'ed GLAPI_ASM_SOURCES and instead use some AM_CONDITIONALS
to choose which asm sources are used

* Change GLAPI_LIB to point to the .la file in other Makefile.am files, and make a link
to the .a file for the convenience of other Makefiles which have not yet been converted
to automake

v2:
- Use AM_CPPFLAGS for cleaner build output
- EXTRA_SOURCES is not needed
- Remove libglapi.a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:07 +01:00
José Fonseca bd3aab8d79 scons: Also require recent XCB.
And don't trip when it's not found -- simply skip building src/glx.
2012-07-12 21:13:10 +01:00
Eric Anholt 6882381a2e mesa: Require current libxcb.
Without that, people with buggy apps that looked at just the server
string for GLX_ARB_create_context would call this function that just
threw an error when you tried to make a context.  Google shows plenty
of complaints about this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 12:29:12 -07:00
Ian Romanick a8724d85f8 glx/dri2: Add support for GLX_ARB_create_context_robustness
Add the infrastructure required for this extension.  There is no
xserver support and no driver support yet.  Drivers can enable this be
advertising DRI2 version 4 and accepting the
__DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
__DRI_CTX_ATTRIB_RESET_STRATEGY attribute in create context.

Some additional Mesa infrastructure is needed before drivers can do
this.  The GL_ARB_robustness spec, which all Mesa drivers already
advertise, requires:

    "If the behavior is LOSE_CONTEXT_ON_RESET_ARB, a graphics reset
    will result in the loss of all context state, requiring the
    recreation of all associated objects."

It is necessary to land this infrastructure now so that the related
infrastructure can land in the xserver.  The xserver has very long
release schedules, and the remaining Mesa parts should land long, long
before the next xserver merge window opens.

v2: Expose robustness as a DRI2 extension rather than bumping
__DRI_DRI2_VERSION.

v3: Add a comment explaining why dri2->base.version >= 3 is also
required for GLX_ARB_create_context_robustness.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 08:54:50 -07:00
Ian Romanick 5fb178ee43 glx/tests: Fix off-by-one error in allocating extension string buffer
NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50621
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=418161
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Markus Oehme <oehme.markus@gmx.de>
2012-07-03 12:28:45 -07:00
Paul Berry f2f05e50b1 glx/tests: Fix signed/unsigned comparison warnings. 2012-06-20 11:42:42 -07:00
Paul Berry 4b7b4c46c5 glx/tests and mesa/tests: Update .gitignore files.
This patch updates .gitignore files to account for the new build
artifacts introduced by the following commits:

ae376f0 glx/tests: Rename test as glx-test
8fecdcc mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
a29ad2b mesa/tests: Add tests for the generated dispatch table
2012-06-14 10:08:57 -07:00
Ian Romanick 3c22f79412 glx/tests: Add unit tests for generated code in indirect_init.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick 4c270f9c6b glx/tests: Add unit tests for generated code in indirect_size.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick ae376f0567 glx/tests: Rename test as glx-test
This matches the existing test in src/glsl/tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick 2e8c866f10 glx: Move tests from tests/glx to src/glx/tests
This matches the organization of other unit tests in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Stéphane Marchesin 0256edd709 glx: Handle a null reply in QueryVersion.
Works around crashes when X connections break.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Eric Anholt 743e505315 automake: Globally add stub automake targets to the old Makefiles.
I tried to update all the old Makefiles that included the default
config to be sure they had a default target if they didn't previously
have one, since this new all target will always point at it.  Almost
everything had one.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Brian Paul dff36e900c scons: add code to generate the various GL API files
This fixes recent build breakage when we began building the generated
API files from xml as part of the normal build process.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
2012-05-31 09:40:35 -06:00
Eric Anholt 0ce0f7c0c8 mesa: Remove the generated glapi from source control, and just build it.
Mesa already always depends on python to build.  The checked in
changes are not reviewed (because any trivial change rewrites the
world).  We also have been pushing commits between xml change and
regen where at-build-time xml-generated code disagrees with committed
xml-generated code.  And worst of all, sometimes we ("I") check in
*stale* xml-generated code.

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-29 11:51:57 -07:00
Jeremy Huddleston 27b821bc95 darwin: Address a build failure on Leopard and earlier OS versions
<https://trac.macports.org/ticket/34499>

Regression-from: 51691f0767
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-18 11:32:40 -07:00
Jeremy Huddleston d65bd195ec darwin: Eliminate a possible race condition while destroying a surface
Introduced by: c60ffd2840
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:30 -07:00
Jeremy Huddleston a73a800b32 darwin: Unlock our mutex before destroying it
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:29 -07:00
Jeremy Huddleston 51691f0767 darwin: Use ASL for logging
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:34 -07:00
Jeremy Huddleston cf5db0a418 darwin: Make reported errors more user-friendly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Jeremy Huddleston 244dc05214 darwin: Fix an error message
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Jeremy Huddleston 1a33c1b2b8 darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
2012-04-24 00:26:48 -07:00
Jonas Maebe c60ffd2840 apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Eric Anholt 94726d263e glx: Hook up the unit tests again using the internal gtest.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:18:00 -07:00
Yuanhan Liu 8b5b3b93d7 glx: fix compile warnings
Fix 'set but not used' warnings; gl_version, gl_versions_profiles and
glx_extensions variables are used just only HAVE_XCB_GLX_CREATE_CONTEXT
is defined. Thus those warnings are shown when that macro isn't defined.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:10 +08:00
Jon TURNEY ba83b8b4ae Use -no-undefined libtool flag in src/glx/Makefile.am
"Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-28 13:03:52 +01:00
Wang YanQing 7a6324dbfe glx:dri_common.c: check psc->driScreen->createDrawable return value
createDrawable may return NULL value, we should check it, or it will
make a segment failed.

[minor-indent-issue-fixed-by: Yuanhan Liu]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-28 09:51:16 +08:00
Dave Airlie 2c778375a1 glx/drisw: avoid segfaults when we fail to get visual
piglit glx-tfp segfaults on llvmpipe when run vs a 16-bit radeon screen,

it now fails instead of segfaulting, much prettier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-24 13:05:19 +00:00
Eric Anholt e07b1603e2 glx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.
When a GL LD_PRELOAD library like apitrace was used,
glXGetProcAddress() would return the preload's symbols instead of
libGL's symbol, leading to infinite recursion when the returned
function was called.  This didn't hit apitrace on most apps because
who calls glXGetProcAddress() on the global functions.

The -Bsymbolic, which was present in mklib before automake conversion,
causes the glxcmds.c:GLX_functions table to be resolved at link time,
so that LD_PRELOADs don't affect it any more.

Fixes crashes when running wine under apitrace.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-03-21 13:55:41 -07:00
Kenneth Graunke dfce56ba4d Add Makefile.in to toplevel .gitignore
To avoid redundancies, this patch also removes Makefile.in from the
other .gitignore files.

Acked-by: Eric Anholt <eric@anholt.net>
2012-03-20 11:50:50 -07:00
Paul Berry b41ab3b42c Add .deps/, .libs/, and *.la to toplevel .gitignore
To avoid redundancies, this patch also removes .deps, .libs, and *.la
from .gitignore files in subdirectories.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 11:50:50 -07:00
Kristian Høgsberg ca760181b4 shared-glapi: Convert to automake
This fixes a build problem where EGL links to libgbm.la, which encodes
a relative path to it's libglapi.so dependency.  The relative path
breaks when the linker tries to resolve it from src/egl/main instead
of src/gbm.  Typically we silently fall back to the system
libglapi.so, which is wrong and breaks when there isn't one.

Morale of the story: don't mix mklib and libtool.
2012-03-19 11:13:06 -04:00
Jeremy Huddleston f9e1295cff darwin: Build create_context.c
Fixes a build regression from: 588042a8ec

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
David Fries b60120608f Set close on exec flag FD_CLOEXEC
Set the close on exec flag when opening dri character devices, so they
will be closed and free any resouces allocated in exec.

Signed-off-by: David Fries <David@Fries.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 19:05:50 +00:00
Johannes Obermayr d249bd9cbd glx: Also put a symlink from libGL.so in lib/ for now.
This fixes the libGLU.so.* build when a system libGL.so is not present
since it is relying on the lib/ to build against until it gets
converted to automake.

Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2012-03-07 09:37:46 -08:00
Eric Anholt 8ffb098234 glx: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00