Commit Graph

76 Commits

Author SHA1 Message Date
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Keith Packard 3dd5bfe540 present: Send GLX_BufferSwapComplete events from present extension
This allows GL to support the GLX_INTEL_swap_event extension.

v2: Return GLX_BLIT_COMPLETE_INTEL for unknown swap types

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-05 09:51:00 -08:00
Adam Jackson 17ed7ac1fe glx: Lie about GLX_Y_INVERTED_EXT
Well, that was lame.  The problem with reporting y inversion honestly is
that libGL asks the driver _its_ opinion of Y inversion, which it just
fabricates from whole cloth.  So then when libGL goes to compare the
driver's idea of fbconfigs with that of the server - a fairly dumb idea
to begin with - nothing matches, and direct rendering fails, and
sadness.

So until the DRI drivers are fixed we should just continue to lie about
Y inversion.  GLX_DONT_CARE is what libGL would make up for that
attribute if we hadn't sent it, so just send that instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 17:05:14 -07:00
Adam Jackson be6680967a glx: convert to direct GL dispatch (v2)
We now expect to be linked against something that provides the GL API,
instead of manually grubbing about in the DRI driver's dispatch table.
Since the GLX we expose calls GL functions that are meant to be looked
up dynamically, also add a way to thunk through to GetProcAddress.

This includes a refresh of the generated sources, which requires a
correspondingly new Mesa.

The GetProcAddress stubs are at the moment merely enough to make this
link against Mesa 9.2, but should really be provided for everything not
in the OpenGL 1.2 ABI.

v2: Explicitly hide the GetProcAddress stubs so we can't conflict with
libGL symbols; fix leading tab/space issues [anholt]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 12:29:16 -04:00
Adam Jackson 7f5adf73a0 glx: Simplify glXDestroyContext
We can just free the resource unconditionally here.  ContextGone (which
FreeResourceByType will call) already does:

    cx->idExists = GL_FALSE;
    if (!cx->currentClient) {
        __glXFreeContext(cx);
    }

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson 276d8057aa glx: Fix memory leak in context garbage collection (v2)
I broke this, back in:

    commit a48dadc98a
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Mon Mar 21 11:59:29 2011 -0400

	glx: Reimplement context tags

In that, I changed the glx client state to not explicitly track the list
of current contexts for the client (since that was what we were deriving
tags from).  The bug was that I removed the code for same from
glxClientCallback without noticing that it had the side effect of
effectively de-currenting those contexts, so that ContextGone could free
them.  So, if you had a client exit with a context still current, the
context's memory would leak.  Not a huge deal for direct clients, but
viciously bad for indirect, since the swrast context state at the bottom
of Mesa is like 15M.

Fix this by promoting Bool isCurrent to ClientPtr currentClient, so that
we have a back-pointer to chase when walking the list of contexts when
ClientStateGone happens.

v2: Explicitly call __glXFreeContext on the ClientStateGone path.  Our
current context might be one we got from EXT_import_context and whose
creating client has since died.  Without the explicit call, the creating
client's FreeClientResources would not free the context because it's
still current, and the using client's FreeClientResources would not free
the context because it's not an XID it created.  This matches the logic
from a48dadc.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson 75b362763c glx: Only take a Pixmap reference if creating the GLXPixmap succeeded
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson 6ee4d9f94a glx: Fill in some missing attributes from DoGetFBConfigs
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:33 -04:00
Adam Jackson abd0865021 glx: Catch another failure case in drawable creation
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:33 -04:00
Adam Jackson acf14c1de7 glx: realloc style fix in RenderLarge
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson 9ebf739a68 glx: Eliminate a small malloc from QueryContext
No reason to have that be a failure path.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson b99f797540 glx: Handle failure to create the pixmap backing the pbuffer
We happen not to sanitize the width/height we pass to CreatePixmap here,
oops.  It's not exploitable, but it's certainly a crash, so let's just
throw BadAlloc instead.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson 22fbfdcb31 glx: Implement GLX_PRESERVED_CONTENTS drawable attribute
We back pixmaps with pbuffers so they're never actually clobbered.  Say
so when asked.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson 2e20b8382c glx: Implement GLX_FBCONFIG_ID in GetDrawableAttributes
Required by GLX 1.4, section 3.3.6, "Querying Attributes".

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson 0d76191bae glx: Implement GLX_{WIDTH,HEIGHT} in GetDrawableAttributes
Required by GLX 1.4, section 3.3.6, "Querying Attributes".

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson d11f13e383 glx: Compute number of attributes in GetDrawableAttributes on the fly
This doesn't have any effect yet, but is needed to properly build the
reply for pbuffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson 2b181ad095 glx: Pull GLX vendor string out of __GLXscreen
Given how we're currently implementing GLX this can't meaningfully vary
per-screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:31 -04:00
Tomasz Lis cf89aa5374 Full support of sRGB capable fbconfigs.
Changes to correctly initialize the sRGB capability attribute and
transfer it between XServer and the client. Modifications include
extension string, transferring visual config attribs and fbconfig
attribs. Also, attribute is initialized in the modules which do not
really use it (xquartz and xwin).
This version advertises both ARB and EXT strings, and initializes
the capability to default value of FALSE. It has corrected required
GLX version and does not influence swrast. The sRGB capable attribute
is attached only to those configs which do have this capability.
Both ARB and EXT versions share the same GLX extension enabling bit.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18 10:02:00 -07:00
Alan Coopersmith 26efa09d0c Use C99 designated initializers in glx Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:58:30 -07:00
Alan Coopersmith cdf5bcd420 Use calloc to zero fill buffers being allocated for replies & events
Ensures padding bytes are zero-filled

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:58:29 -07:00
Alan Coopersmith 789d64e19a Remove unneccesary casts from WriteToClient calls
Casting return to (void) was used to tell lint that you intended
to ignore the return value, so it didn't warn you about it.

Casting the third argument to (char *) was used as the most generic
pointer type in the days before compilers supported C89 (void *)
(except for a couple places it's used for byte-sized pointer math).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:12:56 -07:00
Ian Romanick aef0b4593e glx: Track the reset notification strategy for a context
Also require that the reset notification for a new context and the other
context in the share group match.  There isn't yet any way to specify a
non-default reset notification strategy, but that will come.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-05 11:45:15 -07:00
Ian Romanick 23612a63fc glx: Make several functions available outside the glxcmds.c compilation unit
validGlxScreen, validGlxFBConfig, validGlxContext, and
__glXdirectContextCreate will soon be used by createcontext.c.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:08:12 -07:00
Ian Romanick cd5689cac5 glx: Use one function to add a context to all global tables
Instead of having separate __glXAddContextToList and AddResource
functions, just have one function that does both steps.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:08:12 -07:00
Ian Romanick c1d91ab370 glx: Initialize remaining context fields
There is no reason to assume the screen's context allocated
initialized these fields, so don't.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:08:12 -07:00
Ian Romanick 0db76e5f77 glx: Initialize all context fields together
v2: Fix whitespace error noticed by Christopher James Halse Rogers.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:08:12 -07:00
Ian Romanick 96d74138b1 glx: Extend __GLXscreen::createContext to take attributes
The attributes will be used for glXCreateContextAttribsARB additions
in follow-on patches.

v2: Add missing 'int *error' parameters noticed by Christopher James
Halse Rogers.

v3: Remove redundant 'int err;' declaration noticed by Christopher
James Halse Rogers.  This was supposed to be in v2, but I missed it.

v4: Add comma missing from additions in v2.  Ugh.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:07:51 -07:00
Ian Romanick 62f06b0dcd glx: Don't track GLClientmajorVersion or GLClientminorVersion
Nothing uses these fields anywhere in the server.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:07:51 -07:00
Ian Romanick 724176a87a glx: Fix mishandling of shared contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23 13:07:51 -07:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Adam Jackson 6a433b67ca glx: Fix lifetime tracking for pixmaps
GLX pixmaps take a reference on the underlying pixmap; X and GLX pixmap
IDs can be destroyed in either order with no error.  Only windows need
to be tracked under both XIDs.

Fixes piglit/glx-pixmap-life.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-04-15 12:55:47 -04:00
Adam Jackson 10317682e2 glx: Remove some obfuscatory macros
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Adam Jackson a48dadc98a glx: Reimplement context tags
This would let you do a constant-time context lookup, but if that's your
performance problem you have two problems.  Just use the context's XID
as the tag value instead.

In order to do this, we have to defer destroying a context until it
actually goes unreferenced, as you're allowed to mention a context tag
after you've (ostensibly) destroyed the context, as long as it's still
your current context.  Thus, change DestroyContext to merely mark the
context as dead if it's a current context, and call down to actual
resource destruction (and XID reclamation) in StopUsingContext.

Also, stop trying to delete context state from DrawableGone.  This was
always broken, as GLX does not say that contexts are destroyed when
their drawables are destroyed.  But with the above change to defer
context destruction, this would trigger a server crash on client exit as
we'd free the context state twice.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28 12:46:38 -04:00
Julien Cristau 402b329c3a glx: Work around wrong request lengths sent by mesa
mesa used to send too long requests for GLXDestroyPixmap,
GLXDestroyWindow, GLXChangeDrawableAttributes, GLXGetDrawableAttributes
and GLXGetFBConfigsSGIX.

Fixes a regression introduced in ec9c97c6bf
X.Org bug#33324 <https://bugs.freedesktop.org/show_bug.cgi?id=33324>

Reported-by: xunx.fang@intel.com
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15 12:19:59 +01:00
Julien Cristau 1137c11be0 glx: fix BindTexImageEXT length check
The request is followed by a list of attributes.

X.Org bug#33449

Reported-and-tested-by: meng <mengmeng.meng@intel.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15 12:19:59 +01:00
Julien Cristau a883cf1545 glx: fix request length check for CreateGLXPbufferSGIX
The request is followed by an attribute list.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15 12:19:59 +01:00
Julien Cristau d9225b9602 glx: validate numAttribs field before using it
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:36:09 +01:00
Julien Cristau ec9c97c6bf glx: validate request lengths
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:31:30 +01:00
Julien Cristau 3f0d3f4d97 glx: make sure screen is non-negative in validGlxScreen
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10 15:31:12 +01:00
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
Chris Wilson 7e58178060 glx: Prevent NULL context deref in __glXGetDrawable() (bug 29184)
During a SwapBuffers request, we may end up querying an unknown drawable
outside of an active context, and so need to report this error prior to
attempting to dereference the NULL context.

Also fixes:

  [Bug 29184] glXSwapBuffers with no GLX context crashes X.
  https://bugs.freedesktop.org/show_bug.cgi?id=29184

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-08-19 18:03:11 -07:00
Mikhail Gusarov 6592db6bb5 Get rid of xstrdup when argument is definitely non-NULL
Replace xstrdup with strdup when either constant string is
being duplicated or argument is guarded by conditionals and
obviously can't be NULL

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 0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +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
Kristian Høgsberg 9de0e31746 dri2: Take an XID for tracking the DRI2 drawable
Some pixmaps (window pixmaps and scratch pixmaps) don't have the
drawable->id set and thus DRI2 gets confused when using that field
for looking up the DRI2 drawable.  Go back to using privates for getting
at the DRI2 drawable from a DrawablePtr.  We need to keep the resource
tracking in place so we can remove the DRI2 drawable when the X resource
it was created for goes away.  Additionally, we also now track the DRI2
drawable using a client XID so we can reclaim the DRI2 drawable even if
the client goes before the drawable and doesn't destroy the DRI2 drawable.

Tested-by: Owen W. Taylor <otaylor@fishsoup.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-05-11 11:01:35 -04:00
Kristian Høgsberg 22da7aa9d7 glx: Let the resource system destroy pixmaps
GLX pbuffers are implemented using a pixmap allocated by the server.
With the change to DRI2 to track DRI2 drawables as resources, we need to make
sure that every drawable we create a DRI2 drawable for has an XID.  By
using the XID of the pbuffer, the resource system will automatically
reclaim the hidden pixmap and the DRI2 drawable when the pbuffer is
destroyed or the client exits.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-16 14:53:25 -07:00
Kristian Høgsberg f0006aa58f glx: Track GLX 1.3 style GLX drawables under their X drawable ID as well
This ensures that the DrawableGone callback gets called as necessary
when the X drawable goes away.  Otherwise, using a GLX drawable
(say, glXSwapBuffers) in indirect mode after the X drawable has been
destroyed will crash the server.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-16 14:53:17 -07:00
Jesse Barnes 04a54f69a8 DRI2: add support for new DRI2 protocol requests
Support the new DRI2 2.2 protocol requests: DRI2SwapBuffers, DRI2GetMSC,
DRI2WaitMSC, DRI2WaitSBC and DRI2SwapInterval.

These requests allow the server to support the SGI_video_sync,
SGI_swap_interval, and OML_sync_control GLX extensions if DDX support is
present.  The new DDX APIs are documented in dri2.h.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-11 16:16:35 -05:00
Jamey Sharp b0dd6be2c8 Cast small-int values through intptr_t when passed as pointers
On 64-bit systems, int and pointers don't have the same size, so GCC gives
warnings about casts between int and pointer types. However, in the cases
covered by this patch, it's always a value that fits in int being stored
temporarily as a pointer and then converted back later, which is safe.
Casting through the pointer-sized integer type intptr_t convinces the
compiler that this is OK.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:38:44 +11:00
Ian Romanick 4c6bfa2c09 GLX: More clearly document the GLX protocol version handling
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-01 23:13:40 -07:00