summaryrefslogtreecommitdiff
path: root/hw/xquartz/xpr/dri.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-23Convert strncpy/strncat to strlcpy/strlcatAlan Coopersmith1-2/+1
As long as we're carrying around a compatibility copy in os/strl*.c, might as well use them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19XQuartz: Add diagnostic error checking to xp_destroy_surface.George Staplin1-1/+6
This occurred to me in hindsight after the last commit. If the original developer had done this, we would have noticed the problem sooner. (cherry picked from commit aa0a57996f3e7d16238f69976958c2526821388b)
2011-07-19XQuartz: Fix a memory leak with surfaces that a new test found.George Staplin1-11/+45
xp_destroy_surface was called with a surface id of 0, due to some premature cleanup that set it to 0. This means the surfaces weren't being destroyed until the window was. The code that did that was: pDRIDrawablePriv->sid = 0; In long running applications this leak may or may not have been harmful. With the old libGL the surfaces weren't destroyed until the context was destroyed or a new context created. In the new libGL they are reference counted, and released much sooner, so we ran into a resource leak more noticeably with some tests. Make the Apple DRI code dispatch events to the client(s) for destroyed surfaces, when a resource is destroyed. This seems to work in my tests, however this clearly wasn't working for a while, so bugs may result in the future if it enables some new (unexpected) side effects. Also add a few helpful comments to aid in understanding the code in the future. Tested with the test suite, Pymol, and various Mesa demos. (cherry picked from commit bede83eb19a1629396fcd5a46441f8476a8fcd1b)
2011-04-25XQuartz: xpr: Dead code removalJeremy Huddleston1-5/+0
Assigned value is always the same as the existing value. Found by clang static analyzer Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-11-22XQuartz dri: Don't check CoreGraphics versionJeremy Huddleston1-112/+0
The version check is hackish, and I highly doubt anyone using this code is on a version of OS X that predates this support (10.2 has support for it). Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-06-10Merge remote branch 'jeremyhu/master'Keith Packard1-8/+8
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-1/+1
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-08XQuartz: Fix build regression from faeebead7bfcc78535757ca7acc1faf7554c03b7Jeremy Huddleston1-8/+8
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard1-8/+17
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard1-2/+2
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-15/+15
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>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith1-5/+2
Convert all calls of CreateNewResourceType to pass name argument Breaks DIX ABI. ABI versions bumped: Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18Ensure all resource types created have names registeredAlan Coopersmith1-0/+4
Calls RegisterResourceName to record the type name for use by X-Resource, XACE/SELinux/XTsol, and DTrace. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18Check for failures from CreateNewResourceTypeAlan Coopersmith1-1/+1
Make sure to check return value before setting bitmask flags. For most calls, just fails to init the extension. Since Xinput already calls FatalError() on initialization failure, so does failure to allocate Xinput's resource type. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-02-16XQuartz: Add support for GLXPixmaps to the AppleDRI.George Staplin1-4/+162
This involved wrapping some GCOps to get the proper behavior when using X11 raster ops mixed with OpenGL (see driWrap.c). This extends the AppleDRI protocol with create and destroy pixmap functions. The dri.c code has been extended quite a bit to enable this, and to initialize the wrapping of CreateGC for GCOps. This has been tested with tests/glxpixmap and proven to work with the new libGL. Existing applications seem to work fine too. Redraws all appear to be correct. There may be some bugs lurking that I haven't found yet. I plan to drive them out by extending the libGL test suite. (cherry picked from commit 630518766b01022c49fe3a9e7d501808f71b06e2)
2009-02-12XQuartz: xpr: The dri.c code for pixmaps was wrong in several ways. They ↵George Staplin1-17/+26
weren't being exported correctly by Xplugin. This should fix a bug with the surface for a window, when an export fails. Before the export could fail and leave behind an invalid (freed) pointer in the dix privates. I have an idea of how to fix the GLXPixmaps now without using CGLSetOffScreen. This work is a step towards that. The Xplugin will need a small patch to fix an issue that this change brought forth. (cherry picked from commit 58c4116c47543b5e30c2232e7bee8efc0b9be176)
2009-01-15XQuartz: xpr: Cleanup some of the code and possibly fix part of the GLX ↵George Staplin1-80/+127
Pixmap problem. Split DRICreateSurface into 3 functions. Make CreateSurfaceForPixmap use xp_configure_surface. I suspect this is partly why GLXPixmaps never worked. It will require some more work and thoughts for pbuffers, unless we fake those with pixmaps and surfaces. (cherry picked from commit 9cf264e67744262b9f45079e6cd752eb3e3b0e08)
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-2/+0
A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-10-31XQuartz: LP64 related casting fixes from Bob MurphyJeremy Huddleston1-5/+5
(cherry picked from commit ea71710aaa7166ab510abe70f2dc47942de0ead7)
2008-08-28Prepare for array-index based devPrivates.Tomas Carnecky1-3/+6
TODO: static indices can be made just an int; some indices can be combined.
2007-12-13Merge branch 'master' into XACE-SELINUXEamon Walsh1-0/+737
Conflicts: Xext/EVI.c Xext/bigreq.c Xext/cup.c Xext/dpms.c Xext/fontcache.c Xext/mitmisc.c Xext/xcmisc.c Xext/xf86bigfont.c Xext/xtest.c configure.ac dbe/dbe.c hw/darwin/darwin.h hw/darwin/darwinEvents.c hw/darwin/iokit/xfIOKit.h hw/darwin/iokit/xfIOKitCursor.c hw/darwin/quartz/fullscreen/fullscreen.c hw/darwin/quartz/fullscreen/quartzCursor.c hw/darwin/quartz/quartz.c hw/darwin/quartz/quartzCommon.h hw/darwin/quartz/quartzCursor.c hw/darwin/quartz/xpr/dri.c hw/darwin/quartz/xpr/dristruct.h hw/darwin/quartz/xpr/xprCursor.c hw/darwin/quartz/xpr/xprFrame.c hw/xfree86/modes/xf86RandR12.c include/cursor.h miext/rootless/rootlessCommon.h miext/rootless/rootlessScreen.c miext/rootless/rootlessWindow.c render/picturestr.h Trying to pick up the pieces from the darwin churn here...
2007-12-05Darwin: Flattened quartz into darwin, renamed darwin xquartzJeremy Huddleston1-0/+760
Leaving xpr unflattened since we want modularity to replace that with xpc (XPluginComposite) at some point (cherry picked from commit 48e6a75fbdd0fee86e364f02ace83f20b312a2b2)