Commit Graph

56 Commits

Author SHA1 Message Date
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 54000bdcbc)
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 e9e63a2118)
2009-09-23 18:21:48 -07:00
Jeremy Huddleston
a8e634b86d XQuartz: GLX: Drawable does not contain resize anymore.
(cherry picked from commit 1e642f22fb)
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 0f3a89d306)
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 7fe37137d8)
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 60a1d2c276)
2009-08-05 16:17:47 -07:00
Jeremy Huddleston
ae65daab08 XQuartz: Unify how we set our bitmasks for visuals
(cherry picked from commit c230b52c27)
2009-07-31 15:34:13 -07:00
Jeremy Huddleston
da0a274780 XQuartz: Cleanup the bitmask setting for GLX visuals.
(cherry picked from commit d32c3df258)
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 7351db5c87)
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 12f7365f1f)
2009-07-16 17:32:04 -07:00
Jeremy Huddleston
e7bc9ff816 XQuartz: Allow more than 3 OSX displays
(cherry picked from commit 45045eb396)
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 e10c53421f)
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 d3120241f9)
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 c7e3383309)
2009-02-21 23:35:22 -08:00
Jeremy Huddleston
67faf41b3f XQuartz: Don't need GlxSetVisualConfig any more
Fixes build failure resulting from 516f8e2cad
(cherry picked from commit 066b17028a)
2009-02-17 23:27:08 -08:00
Jeremy Huddleston
f5c7f8a3ab XQuartz: GLX: Fix accidental exclusion of glBlitFramebufferEXT on Leopard
(cherry picked from commit 8620579483)
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 e01662cadc)
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 143224405b)
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 d514152195)
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 3c14546f58)
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 94162b0f8a)
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 755f53eb40)
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 b772d64fce)
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 17f6a261fc)
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 3bed9b65c8)
2008-11-21 20:10:57 -08:00
Jeremy Huddleston
bc4f804cd8 XQuartz: Actually add glcontextmodes.[hc]
(cherry picked from commit 763195d338)
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 a186cab6ae)
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 ed181382dd)
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 f527381eea)
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 1e5f63f15e)
2008-11-05 19:23:41 -08:00
Jeremy Huddleston
c5086badf0 XQuartz: LP64 related casting fixes from Bob Murphy
(cherry picked from commit ea71710aaa)
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 d5c17f585a)
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 fe35a36390)
2008-10-28 22:00:36 -07:00
George Peter Staplin
21ea9d82aa XQuartz: GL: Add feature detection of color sizes, and accum sizes.
This gives us a *lot* more visuals, and they should be more accurate.
Some of the visuals may have been wrong before.  This may enable more
OpenGL programs to behave correctly.

I also suspect libGL needs a little work to handle some of these correctly.
(cherry picked from commit 98a084ce9c)
2008-10-28 22:00:29 -07:00
George Peter Staplin
6a2693b2f9 XQuartz: Remove the enable_stereo default. We now use feature detection to enable stereo visuals.
We need to revisit the GL/indirect.c changes.  I think indirect.c should
be using the same feature detection and GLX visual config code.  The
indirect changes will require testing...
(cherry picked from commit 49b7a7c6f2)
2008-10-23 19:22:16 -07:00
Jeremy Huddleston
dc166bf642 XQuartz: Fixed EXTRA_DIST for new GL files.
(cherry picked from commit a11c905203)
2008-10-08 18:45:13 -07:00
George Staplin
8033279294 XQuartz: GL: setVisualConfigs() copied the behavior of indirect.c which is wrong, with regard to the handling of xcalloc failure.
Use ErrorF for an error message after an xcalloc failure, and return instead of falling through to GlxSetVisualConfigs, or abort()ing at the test branch.
(cherry picked from commit 1056700971)
2008-10-08 18:45:09 -07:00
George Staplin
52accec7db XQuartz: GL: Add the proper license information to the new files, and add more commentary to setVisualConfigs().
(cherry picked from commit 190a3d5e5d)
2008-10-08 18:44:28 -07:00
George Staplin
63abdf6115 XQuartz: GL: Add the new C code to the Makefile.am.
Commit the darwin.c changes I missed in the last commit, for calling
setVisualConfigs().
(cherry picked from commit eb3c014e17)
2008-10-08 18:44:24 -07:00