Commit graph

330 commits

Author SHA1 Message Date
Emil Velikov 6d9fa0c13d autogen.sh: do not execute ./configure
This restores the original behaviour from previous patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-02-29 14:09:59 +00:00
Emil Velikov b5f920ef15 autogen.sh: replace with the one from mesa
Currently things fail miserably (as below) on a setup that can build all
of X.org and others without a glitch.

Note: this patch changes the default behaviour from "autogen.sh does not
execute ./configure" to "autogen.sh _does_ execute ./configure".

Things will be restored wit next commit - as to be kept separatelly
from this "copy file" commit.

$ ./autogen.sh
Preparing the libglvnd build system...please wait

Found GNU Autoconf version 2.69
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at
/usr/bin/automake line 3936.
Found GNU Automake version 1.15
Found GNU Libtool version 2.4.6

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... ERROR: aclocal failed

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-02-29 14:02:20 +00:00
Emil Velikov d7ab9d104d .gitignore: include all build artefacts
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-02-29 14:02:12 +00:00
Emil Velikov 335278a27f m4: add .gitignore file
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-02-29 14:02:11 +00:00
Aaron Plattner 4d977ea389 x11glvndserver: Use MODULEVERSIONSTRING instead of hard-coding "NVIDIA Corporation"
The X headers define MODULEVENDORSTRING like so:

  #ifndef MODULEVENDORSTRING
  #define MODULEVENDORSTRING      "X.Org Foundation"
  #endif

This allows module vendors such as NVIDIA to override the vendor string at build
time, rather than hard-coding "NVIDIA Corporation" in the sources.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Kyle Brenneman <kbrenneman@nvidia.com>
Fixes #48.
2016-02-16 13:09:08 -08:00
Kyle Brenneman 458b343bbb Merge pull request #65 from kwizart/avoid-version
Use -avoid-version for x11glvnd in x11glvnd_la_LDFLAGS
2016-02-16 11:28:40 -07:00
Nicolas Chauvet dd92b51948 Use -avoid-version for x11glvnd in x11glvnd_la_LDFLAGS
This patch also removes the -shared LDFLAGS
redundant with the libtool -module option
(in-sync with others x11 module/drivers)
2016-02-14 20:54:52 +01:00
Kyle Brenneman e3b64bfd1d Merge pull request #64 from felixonmars/patch-1
Fix a typo: plaforms -> platforms
2016-02-11 09:02:29 -07:00
Felix Yan 671728e2e3 Fix a typo: plaforms -> platforms 2016-02-11 11:06:14 +08:00
Kyle Brenneman 2367100187 Merge pull request #52 from bluca/autotools_fixes
Small pkg-config, autotools and README.md fixes
2016-02-09 09:52:08 -07:00
Luca Boccassi efad8926d8 Remove autogenerated sources and .pyc on clean 2016-02-09 16:48:03 +00:00
Luca Boccassi 760de850e9 Document build dependencies in README.md 2016-02-09 16:48:03 +00:00
Luca Boccassi d5bc0866a8 Check for glproto in configure.ac 2016-02-09 16:48:03 +00:00
Kyle Brenneman 82e0d23f6c Merge pull request #54 from rmorell/master
libGLdispatch: Fix PIC on x86_64 TSD.
2016-01-25 14:13:49 -07:00
Robert Morell 22aae7170f libGLdispatch: Fix PIC on x86_64 TSD.
This makes the built-in x86_64 TSD stubs use RIP-relative addressing so
that the linker doesn't have to generate relocations of text sections,
which breaks PIC.

Fixes #53
2016-01-25 12:40:45 -08:00
Kyle Brenneman ba0b05a569 GLDispatch: Initialize the dispatch table from __glDispatchCheckMultithreaded.
__glDispatchCheckMultithreaded will now check if the thread's current dispatch
table is NULL, and if it is, it will plug in the no-op table.

This is a workaround for some broken applications which try to call OpenGL
functions without a current context. As long as the thread calls a GLX function
first, any OpenGL calls it makes later will call a no-op stub instead of just
crashing.

Added calls to __glXThreadInitialize to some of the functions in
__GLXapiExports, so that GLX extension functions will still call
__glXThreadInitialize.
2016-01-21 15:19:57 -07:00
Kyle Brenneman 7c4076ddc8 Merge pull request #51 from nwnk/foreign-api-makecurrent
GLX: Refuse to transition directly from EGL to GLX contexts.
2016-01-20 15:03:33 -07:00
Adam Jackson c0d322ff08 GLX: Refuse to transition directly from EGL to GLX contexts
This is not expected to be common, and is undefined at the Khronos level
in any case. Refuse such attempts with BadAccess.
2016-01-20 14:52:52 -05:00
Kyle Brenneman ebe1709ea2 Add glxmd.h back.
glxmd.h was removed in a previous commit, but it's used from glxproto.h.
2016-01-18 18:56:47 -07:00
Kyle Brenneman 59be159c9b Remove a bunch of unused files.
Removed several header files that were copied from Mesa but aren't used in
libglvnd.

Removed everything under src/arch, also copied from Mesa but unused.
2016-01-14 09:42:05 -07:00
Kyle Brenneman ca8e52bf6f Added a pkgconfig file for the public header files.
Add a pkgconfig file that will give the include directory for the public
headers that a vendor library would use.
2016-01-13 16:04:40 -07:00
Kyle Brenneman ec97db7746 Install the public header files.
Two header files (libglxabi.h and GLdispatchABI.h) are public -- intended to be
used by vendor libraries, while the other headers are all internal to libglvnd.

Move the public header files to a new directory, include/glvnd.

Add a makefile so that the public headers are installed by make install.
2016-01-13 16:04:40 -07:00
Kyle Brenneman e5225e3da3 Merge pull request #50 from aaronp24/kde-clientstring-workaround
GLX: Return dummy strings for glXGetClientString(NULL, ...)
2016-01-08 15:12:43 -07:00
Aaron Plattner da090a2e38 GLX: Return dummy strings for glXGetClientString(NULL, ...)
KDE calls glXGetClientString with a NULL dpy argument, which crashes in the call
to XScreenCount(dpy).  Work around it by explicitly checking for this and
returning some static strings.

Note that one oddity is that querying the GLX_VERSION with a NULL dpy will
return the maximum version supported by libglvnd, but specifying a display will
return the maximum supported by any vendor on the display (up to libglvnd's
supported maximum).

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2016-01-08 13:33:46 -08:00
Kyle Brenneman e0e502bbbf Merge pull request #49 from kbrenneman/libglx-fix-glxfbconfig-abi
GLX: Fix GLXFBConfig mapping with multiple displays.
2016-01-06 16:50:23 -07:00
Kyle Brenneman c254ef4ada GLX: Use an assert to check for mismatched handle-to-vendor mappings.
In AddVendorPointerMapping and AddVendorXIDMapping, if there is an existing
mapping, then add an assert that the new vendor library matches the old one.

Handles have to map to at most one vendor, so if we get two different vendors
then there's a bug either in libGLX or in the vendor libraries.
2016-01-06 10:23:32 -07:00
Kyle Brenneman 6d8d0efb3f GLX: Fix a bunch of outdated names.
Renamed a bunch of structures and functions to reflect the fact that libGLX
maintains mappings of most objects directly to vendors now, not objects to
screens.
2016-01-04 15:17:30 -07:00
Kyle Brenneman 5c27a7817f GLX: Don't record the display pointer for contexts and configs.
Remove the Display pointer from __GLXscreenPointerMappingHash. It's no longer
needed for anything in libGLX.so. Dispatch functions can find a vendor library
given only the GLXContext handle itself, so functions like glXGetContextIDEXT
don't need the display either.
2016-01-04 15:10:04 -07:00
Kyle Brenneman bedb59a580 GLX: Use separate hashtables for contexts and configs.
libGLX now uses a separate hashtable for mapping GLXContext and GLXFBConfig
handles to vendor libraries.

Updated the ABI documentation to define requirements for GLXContext and
GLXFBConfig values, to ensure that there aren't ever any duplicate handles
between vendor libraries.
2016-01-04 14:55:36 -07:00
Kyle Brenneman 903ea20962 GLX: Remove the screen number from the pointer-to-vendor hashtable. 2016-01-04 13:40:15 -07:00
Kyle Brenneman 45aa814b11 GLX: Remove the screen from the GLXFBConfig map in the ABI.
Removed the screen number parameter from the GLXFBConfig mapping functions in
__GLXapiExports.
2016-01-04 13:20:46 -07:00
Kyle Brenneman 6116a24fec GLX: Remove the screen from the context map in the ABI.
Removed the screen number parameter from the context mapping functions in
__GLXapiExports.
2016-01-04 13:05:09 -07:00
Kyle Brenneman 973174c921 GLX: Add the vendor pointer to the context/config mapping. 2016-01-04 12:52:14 -07:00
Kyle Brenneman 161c6cb649 GLX: Remove the screen from the drawable map in the ABI.
Removed the screen parameter from the drawable mapping functions in
__GLXapiExports.
2016-01-04 12:37:08 -07:00
Kyle Brenneman 164c157ea2 GLX: Remove the screen from the XID mapping.
libGLX now only keeps track of the vendor library for each drawable, not the
screen number.

__glXVendorFromDrawable will now always return -1 for the screen. The screen
parameter will be removed in a later change.
2016-01-04 12:23:29 -07:00
Kyle Brenneman 83c9a70b7b GLX: Add a pointer to the vendor in the drawable mapping.
This is in preparation for removing the screen number entirely from the config,
context, and drawable mappings in the ABI.
2016-01-04 12:20:53 -07:00
Kyle Brenneman 362c3591aa GLX: Generate errors for invalid GLXFBConfigs.
When dispatching a function based on a GLXFBConfig, generate a GLXBadFBConfig
error if the config is invalid.
2015-12-18 13:28:24 -07:00
Kyle Brenneman 644caa3409 GLX: Generate errors for invalid contexts.
When dispatching a function based on a GLXContext, generate a GLXBadContext
error if the context is invalid.
2015-12-18 13:28:24 -07:00
Kyle Brenneman a627c5d166 GLX: Generate errors for invalid drawables.
When dispatching a function based on a GLXDrawable, generate an X error if the
drawable is invalid.

Added a helper function CommonDispatchDrawable to handle initialization,
looking up a vendor for a drawable, and reporting an error if it can't find
a vendor.

Removed __glXGetDrawableStaticDispatch, and replaced it with
CommonDispatchDrawable.

Removed the unused function __glXScreenFromDrawable.
2015-12-18 13:27:45 -07:00
Kyle Brenneman 273e11940e GLX: Add a missing lock.
In DisplayClosed, take the mutex for the current context hashtable before
calling UpdateCurrentContext.
2015-12-16 10:47:32 -07:00
Kyle Brenneman e4cdd1431b GLX: Fix a couple deadlocks.
Change the current context hash to use a recursive mutex instead of an rwlock.

In __glXLookupDisplay, don't take the lock until after InitDisplayInfoEntry
returns, so that it doesn't try to make any X calls while holding the lock.

If an X error occurs while holding a non-recursive lock, then the error handler
may call exit, which would in turn call __glXFini. That can cause a deadlock if
__glXFini tries to take the same lock.
2015-12-09 15:56:36 -07:00
Kyle Brenneman 71c96a71a7 GLX: Fix an error check in glXMakeCurrent.
In CommonMakeCurrent, if the new context is NULL and the drawables are not
None, then it should always generate a BadMatch error. But, if the old context
was NULL, then it would return before checking for the BadMatch error.
2015-12-02 11:52:26 -07:00
Kyle Brenneman 2f06c1656b GLX: A couple of minor fixes.
In MergeVersionStrings, deal with a zero return value from glvnd_asprintf. Zero
is technically a successful return value from glvnd_asprintf, even though none
of the format strings could produce it.

Remove a bit of dead code from AtomicDecrementClampAtZero. The only way for the
if(newVal < 0) branch to be taken is if (oldVal <= 0), which it can't be at
that point.
2015-11-23 12:04:39 -07:00
Kyle Brenneman 4038efca1f Implement GLESv1.
Added a Makefile to build libGLESv1_CM.so. It's copied and adapted from the one
for libOpenGL.so.

The GLESv1 library currently exports all of the core functions in gl.xml for
GLES version 1.0.
2015-11-20 14:44:25 -07:00
Kyle Brenneman c0d9bbf184 Factor out the common makefile code in libGLESv2 and libOpenGL.
Moved the duplicated makefile code for libOpenGL and libGLES to a new
file, entrypoint_common.mk.
2015-11-13 16:23:01 -07:00
Kyle Brenneman 2e8f77c11b Implement GLESv2.
Added a Makefile to build libGLESv2.so. It's copied and adapted from the one
for libOpenGL.so.

The GLESv2 library currently exports all of the core functions in gl.xml for
GLES versions 2.0 through 3.2, inclusive.
2015-11-13 16:22:42 -07:00
Kyle Brenneman 41c8dc023b Generalize the export list generation scripts.
In genCommon.py, change getLibOpenGLNamesFromRoots so that it accepts a target
parameter. Defined separate targets for each library, including libGLdispatch.

gen_libOpenGL_exports.py now takes a target parameter just like
gen_gldispatch_mapi.py does.

This is in preparation for adding function lists for the libGLES libraries.
2015-11-13 16:22:02 -07:00
Kyle Brenneman 31947394c7 libGLdispatch: Enable entrypoint patching for the x86 TSD build.
Rewrote the x86 TSD stubs to follow the same pattern and use the same common
functions as the x86-64 stubs.

Aside from being shorter and simpler with less code duplicaiton, this will
allow entrypoint patching to work in the x86 build.

Fixed some errors in the entrypoint patching in the unit tests. The
libGLX_dummy.so library was patching in PC-relative addresses for the MOV
instructions, but those instructions expect absolute addresses.
2015-11-13 11:40:22 -07:00
Kyle Brenneman 7f0ef9eae5 Don't install the unit test dummy vendor libraries.
Change the unit test makefile to use check_LTLIBRARIES instead of
lib_LTLIBRARIES so that the dummy vendor libraries aren't included in a
"make install".

Add a -rpath option to libGLX_dummy and libGLX_patchentry flags to force
libtool to actually create the .so files for them. Otherwise, it just creates
static libraries.
2015-11-12 10:04:39 -07:00
Kyle Brenneman 97f8039fcd Merge pull request #47 from kwizart/make-dist
Add few missing files and directory for make dist
2015-11-11 12:21:55 -07:00