Commit Graph

62 Commits

Author SHA1 Message Date
Adam Jackson a80780a763 glx: Remove swap barrier and hyperpipe support
Never implemented in any open source driver.  The implementation
assumed explicit DDX driver knowledge of how the client-side driver
worked, since at the time the server's GL renderer was not a DRI driver.
But now, it is, so any implementation of these should be done with
additional DRI driver API, like the swap control extension.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30 12:54:47 -05:00
Jeremy Huddleston 98f90145d7 XQuartz: GLX: Don't mangle __GLXDrawable's pDraw
We were incorrectly NULLing out pDraw in __GLXDrawable instead of ours in
__GLXAquaDrawable. (we should refactor to eliminate this redundancy later)

This was causing http://xquartz.macosforge.org/trac/ticket/426
This was benign until commit f0006aa58f
The root cause of this change was  fed7ccc481ad1caaa518cafe944c2327a5d0b6c65

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-07-28 18:11:38 -07:00
Mikhail Gusarov 416d228481 xquartz: Get rid of xstrdup when argument is definitely non-NULL
ditto for XQuartz

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11 19:04:23 +07:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Jeremy Huddleston ba1f1f9d9e XQuartz GL: Fix __glXAquaScreenCreateDrawable prototype
Fixes regression introduced in 9de0e31746

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-11 10:46:41 -07:00
Jeremy Huddleston 0efd7b8d82 XQuartz GLX: Change around includes for better compatability with different OS versions
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-02 15:27:29 -07:00
Jeremy Huddleston 5b0faf3554 XQuartz GLX: Don't let garbage enter our pixel request
https://bugs.freedesktop.org/show_bug.cgi?id=27654

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-15 10:57:04 -07:00
Jeremy Huddleston 436d0bb9cc darwin: Generate crash reports on FatalError()
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Adam Jackson <ajax@redhat.com>
2010-03-29 09:37:17 -07:00
Jeremy Huddleston bb75d0df8b XQuartz: GLX: Fix Availability for Tiger ppc workaround
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-03-21 21:56:39 -07:00
Keith Packard df9b6f16b2 Merge remote branch 'jeremyhu/master' 2010-03-15 08:26:58 -07:00
Gaetan Nadon 5f169f5493 XQuartz: remove undefined XSERVER_CFLAGS variable
This is a variable local to configure.ac which is not AC_SUBST()
It is undefined in any generated Makefile.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-15 08:24:02 -07:00
Jeremy Huddleston b117bc7a44 XQuartz: Include os.h for OsAbort()
Fixes regression from 5b9a52be7e

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-03-11 22:27:38 -08:00
Jeremy Huddleston b7a16117c6 XQuartz: GLX: Fix prototype for swapBuffers
This was a regression introduced by 04a54f69a8

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-03-11 22:27:37 -08:00
Rami Ylimaki 5b9a52be7e os: Prevent core dump from being truncated.
The problem fixed by this patch can be reproduced on Linux with the
following steps.
- Access NULL pointer intentionally in ProcessOtherEvent on key press.
- Instead of saving core dump to a file, write it into a pipe.
  echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern
- Dump the core by pressing a key.

While the core is being dumped into the pipe, the smart schedule timer
will cause a pending SIGALRM. Linux kernel stops writing data to the
pipe when there are pending signals. This causes the core dump to be
truncated. On my system I'm expecting a 6 MB dump but the size will be
60 kB instead. The problem is solved if we block the SIGALRM caused by
expired smart schedule timer.

I haven't been able to reproduce this problem in the following cases.
- Save core dump to a file instead of a pipe.
- kill -SEGV `pidof Xorg`
- Press a key to dump core while gdb is attached to Xorg.
- Give option -dumbSched to Xorg.

Also note that the fix works only when NoTrapSignals has the default
value FALSE. The problem can still be reproduced if error signals
aren't trapped. In addition to pending SIGALRM, there is a similar
problem with pending SIGIO from the keyboard driver during core dump.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17 23:20:52 -08:00
Jeremy Huddleston 4127e8e5be XQuartz: clang static analysis fixes
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-02-15 15:03:49 -08:00
Jeremy Huddleston 67a51cd9ef XQuartz: Fix a bunch of compilation warnings about style
(cherry picked from commit 54000bdcbca52a2de31f7c1a1147de6d8e9dbbb8)
2009-09-27 23:31:35 -07:00
Jeremy Huddleston 33bf9cb69d XQuartz: GLX capabilities: Allow 16bit accumulation buffers
http://xquartz.macosforge.org/trac/ticket/308
(cherry picked from commit e9e63a2118b76b6c31c4081fec08a99e4d796e22)
2009-09-23 18:21:48 -07:00
Jeremy Huddleston a8e634b86d XQuartz: GLX: Drawable does not contain resize anymore.
(cherry picked from commit 1e642f22fbf029bb3917091cb5fa2f78b4a92f62)
2009-08-31 15:59:45 -07:00
Jeremy Huddleston 6f3cc08ec0 XQuartz: GL: Unset GL_EXT_gpu_program_parameters for Tiger/ppc
See http://trac.macports.org/ticket/20638
(cherry picked from commit 0f3a89d306838b3c75a73cd1e9e2928737222b70)
2009-08-31 07:45:50 -07:00
Jeremy Huddleston fdb29ebeed XQuartz: GL: Explicitly set GL_EXT symbols to 0 if they are not in OpenGL.framework to prevent X11's glext.h from setting them to 1.
(cherry picked from commit 7fe37137d826d1b698e87a5b35050dd02f0a4d4b)
2009-08-31 07:45:40 -07:00
Jeremy Huddleston 931160fcf3 XQuartz: AIGLX: Provide empty __glXAquaDrawableResize to avoid crashing in DoMakeCurrent
(cherry picked from commit 60a1d2c2764f2f02c0751940a264588717afce79)
2009-08-05 16:17:47 -07:00
Jeremy Huddleston ae65daab08 XQuartz: Unify how we set our bitmasks for visuals
(cherry picked from commit c230b52c27ce50ac6c27011ec8e88f1b263b25f9)
2009-07-31 15:34:13 -07:00
Jeremy Huddleston da0a274780 XQuartz: Cleanup the bitmask setting for GLX visuals.
(cherry picked from commit d32c3df258e748958ef997c675dc4fae118c0d7b)
2009-07-31 15:34:03 -07:00
Jeremy Huddleston c81595e23b XQuartz: Overhaul setting up visuals
The main change is cleanup of the visualConfigs and setting up alpha correctly there to match the visuals being added earlier (so the default visual has a corresponding GLX visual)
(cherry picked from commit 7351db5c8746be30a4047469ee9b50bc19e62a89)
2009-07-26 02:35:49 -07:00
Jeremy Huddleston c8a3516514 XQuartz: Cleanup getGlCapabilities to avoid hardcoding the number of displays
(cherry picked from commit 12f7365f1f58d648217b16f09c2152fa47dcd7a1)
2009-07-16 17:32:04 -07:00
Jeremy Huddleston e7bc9ff816 XQuartz: Allow more than 3 OSX displays
(cherry picked from commit 45045eb3968069a8d74ce9188890a5537dc60fec)
2009-07-16 17:32:03 -07:00
Jeremy Huddleston 077556ec39 XQuartz: AIGLX dispatch table cleanup
This should fix some issues when building on different versions of OSX.  We only use extensions that OpenGL.framework's glext.h header tells us are supported.
(cherry picked from commit e10c53421f1e780573c8adcd8ea89d6ffa28a819)
2009-06-06 22:24:06 -07:00
George Staplin 61abf3189f XQuartz: GL: Change from xalloc to xcalloc to potentially avoid
uninitialized data in the __GLXAquaContext.
(cherry picked from commit d3120241f9f48d21f9a6ecfb848434a4a0270855)
2009-02-21 23:35:26 -08:00
George Staplin 5587f9b771 XQuartz: GL: Fix a bug with an uninitialized GLX data structure.
This was causing a crash randomly, due to random memory contents.
Use xcalloc to prevent this in the future, due to future changes or mistakes.

Set the drawableType to include GLX_PIXMAP_BIT and GLX_PBUFFER_BIT.
The new libGL supports these.

Set the max Pbuffer width/height, based on the results of a test program.
We may someday want to revisit this depending on what users need, so that
we create a CGLContextObj, make it current, and call glGetIntegerv to
gather the information at runtime.
(cherry picked from commit c7e338330943e0d03a99328c740540d03f018d20)
2009-02-21 23:35:22 -08:00
Jeremy Huddleston 67faf41b3f XQuartz: Don't need GlxSetVisualConfig any more
Fixes build failure resulting from 516f8e2cad1311a09764e2633644188d1e3c31bb
(cherry picked from commit 066b17028a35956a089815716e38571f305469c5)
2009-02-17 23:27:08 -08:00
Jeremy Huddleston f5c7f8a3ab XQuartz: GLX: Fix accidental exclusion of glBlitFramebufferEXT on Leopard
(cherry picked from commit 8620579483789ae9ac1b68dbefe32b70011386de)
2009-02-02 12:36:01 -08:00
Jeremy Huddleston e2b4d3d4a1 XQuartz: GLX: OpenGL.framework on Tiger doesn't have glBlitFramebufferEXT
(cherry picked from commit e01662cadcaa4052e3a5aa82cbaed00a2d0220e0)
2009-02-01 15:13:40 -08:00
George Staplin b137a0cdb1 XQuartz: GL: indirect.c changes to fix the build with newer OpenGL frameworks.
(cherry picked from commit 143224405ba74929c702a95de52b56df140b0d1b)
2009-01-26 10:28:03 -08:00
Dan Nicholson 64f924fbf5 Kill off --with-mesa-source completely
There were a few spots left in the source that were using the
--with-mesa-source defined headers or the now removed $(top_srcdir)/GL
directory. These aren't needed anymore as all the necessary source for
GLX is in $(top_srcdir)/glx.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2009-01-18 09:49:06 -08:00
George Staplin c5d52d4c37 XQuartz: GL: Make indirect.c build and work in the 1.6 branch.
Reorder some header files and provide some types earlier on.

Remove the static __GLXextensionInfo __glDDXExtensionInfo; that isn't
used in 1.4 or 1.5, and seems to have been removed from 1.6.  Remove
the data structures associated with that too.

Remove __glXAquaDrawableResize.  The GLX structure doesn't use
it anymore, and the Apple version did nothing useful before.

__glXAquaDrawableSwapBuffers(): base no longer contains a drawGlxc
member.  Now provide the the Apple/Aqua context in the __GLXAquaDrawable
struct.  Add the context member to the __GLXAquaDrawable struct.

Remove the fallback configs.  They aren't used in 1.4 or 1.5 either.

Remove init_visuals().  It's not used in 1.4 or 1.5 either.

In the drawable constructor initialize the state properly, including
the new context member.

Remove glAquaResetExtension() -- it's not used anymore.

This has been tested remotely and proven to work with glxgears,
fire, various texture programs I wrote, and various Mesa demos.
(cherry picked from commit d514152195452ae11ec7769c76489651620ad380)
2009-01-15 21:04:54 -08:00
George Staplin 0d8184de59 XQuartz: GL: Set the __GLXconfig renderType to GLX_RGBA_BIT.
(cherry picked from commit 3c14546f58f8a138fe67c9cacc3bd0b7fa90c29a)
2009-01-10 01:00:24 -08:00
George Staplin 9c3975d63e XQuartz: GL: Make many more fbconfigs and visuals available for the 1.5 branch.
Use a __GLXconfig linked list struct to store the configurations for the
fbconfigs and visuals in a pGlxScreen.

Also, remove the __GLXvisualConfig/GlxSetVisualConfigs code that isn't used
anymore.  There is more code we can remove later, but I want to do that in
separate commits.
(cherry picked from commit 94162b0f8a25267aca280d25e216cc6bde47da6e)
2009-01-10 01:00:09 -08:00
George Staplin 01eaebdc98 XQuartz: GL: Make various changes to makeFormat, so that it works better. Now glxgears looks normal with the old libGL.
Add various GLX extensions to the list of supported extensions.

Reformat the oddly formatted code in some areas.

Use xalloc and xfree instead of malloc and free.
(cherry picked from commit 755f53eb40c4329d8c82a31cb910c31fdd4ea12e)
2008-11-28 13:18:27 -08:00
George Staplin 6eb33bc0cb XQuartz: GL: Remove the inclusion of glcontextmodes.h.
Add some commentary about future directions needed for the GLX drawable
creation and destruction code.

Match xalloc with xfree.

I made some minor formatting improvements.
(cherry picked from commit b772d64fce31d16b498c621096e39d5203994d6e)
2008-11-22 11:13:51 -08:00
George Staplin 429b4b20d5 XQuartz: GL: Add a branch to prevent a NULL DrawablePtr structure access.
In attach() check for pDraw being NULL, and also print an ErrorF message,
because we eventually want to track down why this is occuring.

It's unclear how this occurs, but as I noted in the 1.4 branch, I believe that
the DrawablePtr/struct _Drawable -> id is the member being accessed that causes
KERN_PROTECTION_FAILURE at 0x0000000000000004

This passes my tests using: env LIBGL_ALWAYS_INDIRECT=1 ./sometest.

I fixed a warning: caused by initializing the screen->base.visuals with the
configs.  It is a ** not a *.  It seems that some other part of GLX will
initialize this for us.
(cherry picked from commit 17f6a261fca6d5856069dce28bb4838261afc6bc)
2008-11-22 11:13:46 -08:00
Jeremy Huddleston 76fcfc4801 XQuartz: GLX: sync up indirect.c to match George's updates in the xorg-server-1.5-apple branch 2008-11-21 20:25:55 -08:00
George Staplin 1a717779b6 XQuartz: GL: remove glcontextmodes.* from the Makefile.am. It has been replaced.
The new replacement is __GLXconfig.
(cherry picked from commit 3bed9b65c807a1aeb662b8042826cbb54280181d)
2008-11-21 20:10:57 -08:00
Jeremy Huddleston bc4f804cd8 XQuartz: Actually add glcontextmodes.[hc]
(cherry picked from commit 763195d338345e3637d112279bdbe002b6e7791a)
2008-11-14 15:13:59 -08:00
Jeremy Huddleston b078936571 XQuartz: Initial work on readding GLX to the 1.5 server
(cherry picked from commit a186cab6ae82340770c13b37ff5df731ce2a0ceb)
2008-11-14 15:10:32 -08:00
George Staplin 47d3821870 XQuartz: GL: Handle the alpha differently when the alpha is equal to GLCAPS_COLOR_BUF_INVALID_VALUE.
This prevents visuals with odd sizes.  The machine I use didn't have
this problem, but it shows up on some others.
(cherry picked from commit ed181382ddeb77019577d39b9c06b1cd839e18e4)
2008-11-13 11:34:21 -08:00
George Peter Staplin 13d06f5aaf XQuartz: GL: Add capability detection for depth buffers, and multisampling.
GL/capabilities.c: Add handleDepthModes(), and extend
handleRendererDescription() for the various depth and multisampling flags.

Add initialization of the new config options to initConfig().

GL/capabilities.h: Add depth and multisample config members.

GL/visualConfigs.c: Add depth and multisampling support to the visual config
setup.
(cherry picked from commit f527381eea6a8ae6cd791475b2060d21fcf8efb2)
2008-11-05 19:23:48 -08:00
George Peter Staplin 34bb06b292 XQuartz: GL: Work around problems with really deep visuals.
GL/capabilities.c: #if 0 (for now) any capabilities above 8 bits per channel,
because they introduce drawing problems.

GL/indirect.c: Comment out some visual setup code that shouldn't be running, and
actually seemed to cause some problems.  The current visualConfigs.c code seems
to do a reasonable job of setting up visuals for XQuartz.

GL/visualConfigs.c: Make use of the proper visual .class.   Eliminate depth 0.
It seems we really just want 24 for now, and 0 I think was a flaw in the original
code.
(cherry picked from commit 1e5f63f15e13a40a6e69a1505934d10d6990b6a2)
2008-11-05 19:23:41 -08:00
Jeremy Huddleston c5086badf0 XQuartz: LP64 related casting fixes from Bob Murphy
(cherry picked from commit ea71710aaa7166ab510abe70f2dc47942de0ead7)
2008-10-31 19:03:38 -07:00
George Peter Staplin 227d782a1b XQuartz: GL: Mark visuals that are slower than others, due to lack of acceleration.
This is used in libGL to determine a preferred visual.  glxinfo -v will also
report "visualCaveat=Slow" for such visuals.
(cherry picked from commit d5c17f585a240be9f9135975738e62951cde3353)
2008-10-31 15:49:25 -07:00
George Peter Staplin e7c26964ee XQuartz: GL: Fix several error handling mistakes in handleRenderDescriptions, that were leftover before the final code evolved.
(cherry picked from commit fe35a3639081dc78ac6cc4123cde37770f6a39fd)
2008-10-28 22:00:36 -07:00