Commit Graph

109 Commits

Author SHA1 Message Date
Keith Packard
0b21a0416b Merge remote branch 'alanc/master' 2010-01-27 14:14:15 -08:00
Eric Anholt
0688dca044 dri2: Fix order of operations issue in __glXdriSwapEvent test.
Clients would have received swap events regardless of asking for it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 14:06:59 -08:00
Alan Coopersmith
138d4c1670 glx: Sun compilers now support some gcc __attribute__ values
Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__
calls for aligned, always_inline, noinline, pure, const, and malloc.

This commit consists of the related updates to files that were
regenerated by gl_XML.py in mesa after adding the __SUNPRO_C checks to it

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-01-25 11:10:00 -08:00
Jesse Barnes
84956ca43b GLX/DRI2: add INTEL_swap_event support
This allows clients to easily check for swap completion status in their
main loop.

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:17:15 -05: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
Alan Coopersmith
895f40792a Add type name argument to CreateNewResourceType
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-18 17:44:12 -08:00
Alan Coopersmith
eb750f8b5e Check for failures from CreateNewResourceType
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-12-18 16:51:45 -08:00
Adam Jackson
77221c9155 glx: swrast can do GLX 1.4 too
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-14 14:34:15 -08:00
Mikhail Gusarov
d306373399 Supply all code using dl*() with DLOPEN_LIBS
Previously DLOPEN_LIBS was managed in top-level configure.ac.
Instead bundle it with the code using dl*() functions to
avoid breakages in uncommon configurations.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-29 14:15:02 -07:00
Jamey Sharp
fab74d1081 Suppress certain GCC warnings in auto-generated code.
- Don't warn for references to deprecated functions in xorg_symbols.
- Ignore functions generated by gl_apitemp.py that are never used.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 18:59:07 -07:00
Jamey Sharp
e8c48fd8f7 Suppress GCC warnings like "the address of u1' will always evaluate as true'".
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28 18:56:09 -07: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
Jamey Sharp
9bf2ff4faf Fix "possibly uninitialized" warnings in glx
In both functions, "answer" was uninitialized if "compsize" was 0, but in
that case __GLX_SEND_VOID_ARRAY(compsize) results in a call to
WriteToClient for 0 bytes, which returns immediately without examining the
"answer" argument. So initializing to a null pointer is as good as
anything else.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-08 13:36: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
Dave Airlie
cb54cf1b3e glx: fixup deref of null pointer when glx screen init fails.
I think this is what the original author wanted.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2009-10-02 08:47:13 +10:00
Dave Airlie
6ffda5aae7 dix/glx/composite: consolidate visual resize in one place.
The previous code was copied and in both cases incorrectly fixed
up the colormaps after resizing the visuals, this patch consolidates
the visual resize + colormaps fixups in one place. This version
also consolidates the vid allocation for the DepthPtr inside the
function.

I'm not 100% sure colormap.[ch] is the correct place for this but
visuals are mostly created in fb and I know thats not the place to
be resizing them.

Fixes fd.o bug #19470.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-30 10:00:07 +10:00
Ian Romanick
ad5c0d9efa GLX: Enable GLX 1.4 on DRI2
Return the minimum GLX version supported by all screens.  Assume that
DRI2 screens have all the required features for GLX 1.4.  Assume that
everyone else can only support GLX 1.2.

Reviewed-by: Kristian Høgsberg <krh@redhat.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-09-29 16:46:39 -07:00
Peter Hutterer
55747d256d input: define server-supported protocol versions in one single file.
include/protocol-versions.h specifies each extension version as supported by
the server and sent back on the wire to the client.

This fixes up several issues with the server potentially reporting a higher
version of the protocol if recompiled against a newer version of the
protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-21 21:47:35 +10:00
Alan Coopersmith
fe31f9c646 Change xf86dristr.h includes to use xf86driproto.h instead
Clears warnings about obsolete headers, but raises minimum
required version of xf86driproto to 2.1.0

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-16 12:06:07 +10:00
Michel Dänzer
120286aef5 glx: Add screen DestroyWindow wrapper to destroy the GLX drawable.
Fixes crashes exitting MacSlow's rgba-glx demo.
2009-09-03 08:05:59 +02:00
Peter Hutterer
c20304226b glx: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:13:44 +10:00
RALOVICH, Kristóf
73abdc94c3 glx: damage is only used with DRI
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-06 17:57:27 +03:00
RALOVICH, Kristóf
7208a0f032 glx: remove Xgl leftover
GlxSetRenderTables was only used by the long gone Xgl.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-07-06 17:57:23 +03:00
Eric Anholt
fd4eed69e4 dri2: Enable GLX_SGI_make_current_read when the DRI driver supports it.
This matches idr's 82f150d73c for DRI1.
2009-07-05 10:19:03 -07:00
Dave Airlie
184deb9bc3 GLX: make function static.
This function isn't called from anywhere else and I don't think it shuold be.
2009-06-24 10:41:47 +10:00
Dave Airlie
9d85b56078 GLX: note the implicit flushes with ReadPixels in indirect contexts.
This just notes the flush has occured when readpixels returns, and
fixes the glean test.
2009-06-24 10:41:47 +10:00
Michel Dänzer
3020b1d43e glx: Clean up more thoroughly if the drawable of a current context goes away.
Fixes crash when restarting compiz, due to cl->currentContexts[x] being stale.
2009-06-23 16:45:40 +02:00
Dave Airlie
918923e285 glx: fix open-coded linked list removal function
OMG stab stab stab, YALL.

removal function was made of crack, actually truncated the list from
the one after the find point.

However fixing this makes glean makecurrent fail with a GLX error.
2009-06-11 11:09:40 +10:00
Jeremy Huddleston
07c5941181 GLX: Make sure the types match for ALIAS in indirect_reqsize.c
(cherry picked from commit 31a20a573b)
2009-06-06 22:24:18 -07:00
Adam Jackson
ab5d1ae82e Remove some libXfont leftovers 2009-06-02 13:40:14 -04:00
Jeremy Huddleston
5c8540d8cf GLX: Purge glxint.h usage
Change (__GLXvisualConfig *) to (void *) in ABI compat stubs.
(cherry picked from commit b4adec886c)
2009-05-29 14:49:05 -07:00
Jeremy Huddleston
da2aaee24a GLX: Purge some glxint.h usage in glxcmds.c
This is related to d0b249f1c5 in the 1.4 branch and was ok'd by krh
(cherry picked from commit e587436cf2)
2009-05-29 14:48:24 -07:00
Eamon Walsh
22a33a7250 glx: Register names for the GLX resource types.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-05-19 22:49:25 -04:00
Michel Dänzer
2075d4bf9e glx: If a destroyed window is bound to the current context, make it not current.
Avoids subsequent crashes due to stale pointers to the DrawableRec, see
https://bugs.freedesktop.org/show_bug.cgi?id=21132#c15 and previous comments.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-14 11:46:41 +02:00
Pierre Willenbrock
40a8f2f408 Fix obvious copypasta
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2009-04-27 13:36:39 -07:00
Ian Romanick
ff6c7764c2 DRI2: Implement protocol for DRI2GetBuffersWithFormat
This change implements the protocol for DRI2GetBuffersWithFormat, but
the bulk of the differences are the changes to the extension / driver
interface to make this function work.  The old CreateBuffers and
DeleteBuffers routines are replaced with CreateBuffer and DeleteBuffer
(both singular).

This allows drivers to allocate buffers for a drawable one at a time.
As a result, 3D drivers can now allocate the (fake) front-buffer for a
window only when it is needed.  Since 3D drivers only ask for the
front-buffer on demand, the real front-buffer is always created.  This
allows CopyRegion impelemenations of SwapBuffers to continue working.
As with previous version of this code, if the client asks for the
front-buffer for a window, we instead give it the fake front-buffer.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:49:19 -07:00
Ian Romanick
d1e916d29b DRI2: Add missing front-buffer flush callback.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-20 20:58:56 -07:00
Werner LEMBERG
335c63fcd6 Add newline to some LogMessage strings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-20 12:38:08 +10:00
Ian Romanick
de1e43181b DRI2: Don't leave empty entries in private->buffers
This should fix bug #21130.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-15 11:14:58 -07:00
Kristian Høgsberg
7b6400a1b8 glx: Fix drawable private leak on destroy
When a drawable goes away, we don't destroy the GLX drawable in full,
since it may be current for a context.  This means that when the drawable
is destroyed in full later, the backend doesn't get a chance to
destroy resources associated with the drawable (the DRI2Drawable).

With this patch, we destroy the GLX drawable in full when it goes away
and then track down all contexts that reference it and NULL their
pointers.
2009-04-13 13:17:53 -04:00
Ian Romanick
f1a995d149 DRI2: Do not send the real front buffer of a window to the client
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-10 12:00:36 -07:00
Michel Dänzer
7b3982eb65 glx: Test the error value, not its address... 2009-04-09 08:21:09 +02:00
Ian Romanick
03aebed519 Use a #define instead of a magic number
The number of buffers is likely to change in the future, so having
this as a define is the right way to go.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-08 15:10:21 -07:00
Ian Romanick
0d9f3ca7ea Allow GLX sources to build against Mesa 7.4 sources
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-08 15:10:21 -07:00
Kristian Høgsberg
df27b870a8 Convert remaining GLX LookupIDByType() calls 2009-04-07 16:28:26 -04:00
Kristian Høgsberg
92562747a0 Add validGlxDrawable() and use dixLookupResourceByType().
Fixes deprecation warnings, and fixes a couple of GLX error codes
for failing drawable lookups.
2009-04-07 16:28:26 -04:00
Kristian Høgsberg
f70cfc8f90 Don't stomp on dixLookupDrawable() return value in DoCreateGLXPixmap(). 2009-04-07 16:28:26 -04:00
Kristian Høgsberg
30d81ad72e Make GLX context lookup use dixLookupResourceByType() 2009-04-07 16:28:26 -04:00
Kristian Høgsberg
91b697efde Support setTexBuffer2 in AIGLX.
Fixes broken GLX_tfp, specifically, lets compositors ignore un-defined
alpha channel for pixmaps.
2009-04-02 13:39:52 -04:00
Ian Romanick
4039603413 glx: Inialize best_score before calculating visual scores
This bug was pointed out by Peter Åstrand.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-02-17 08:27:32 -08:00