Commit Graph

21 Commits

Author SHA1 Message Date
Jesse Barnes 1e39fc784b DRI2/GLX: use new swap event types
Use the new swap event type so we get valid SBC values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:31:13 -07:00
Dave Airlie dc4a3edcf9 Revert "DRI2/GLX: make swap event handling match spec"
This reverts commit 70227e21bb.

revert this until we sort things out, with a new glproto release
with compatible struct names.
2011-05-05 16:25:33 +10:00
Jesse Barnes 70227e21bb DRI2/GLX: make swap event handling match spec
We only handle a 32 bit swap count, so use the new structure definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Luca Barbieri a0e5103200 glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x build
The Gallium EGL state tracker reuses dri2.c but not the GLX code.

Currently there is a bit of code in dri2.c that is incorrectly tied
to GLX: instead, make it call an helper that both GLX and Gallium EGL
implement, like dri2InvalidateBuffers.

This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId
is undefined.

Note that we might want to move the whole event translation elsewhere,
and probably stop using non-XCB DRI2 altogether, but this seems to be
the minimal fix.
2010-09-22 08:01:49 +02:00
Kristian Høgsberg f24ec6367b glx: Ignore DRI2 event for drawables we've destroyed
Since we now actually destroy GLX drawables, we get into situations where
we get events for drawables that no longer exist.  Just ignore the
event in that case.
2010-09-08 18:54:48 -04:00
Kristian Høgsberg 16887d042a glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread
safe.  Instead, just destroy the client side structures when the
drawable is no long current for a context.
2010-09-08 09:20:42 -04:00
Kristian Høgsberg c356f5867f glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types. 2010-07-28 16:45:25 -04:00
Carl Worth 14a3d61ea3 Avoid compiler warning for unused glx_dpy variable.
My earlier attempt to eliminate this warning (c0ca2bfb2a) was
invalid as it removed the variable declaration. Jerome correctly
reverted that (600c85efdb) since the variable is used when
X_DRI2SwapBuffers is defined.

Here, instead of removing the declaration, we move it to inside the
correct #ifdef.
2010-07-28 10:33:27 -07:00
Kristian Høgsberg ab434f6b76 glx: Use _Xglobal_lock for protecting extension display list
Avoids double locking glXLock in the X wire to event handlers.
2010-07-22 21:11:20 -04:00
Jerome Glisse 600c85efdb Revert "dri2: Remove an unused variable."
glx_info is used if X_DRI2SwapBuffers is defined
This reverts commit c0ca2bfb2a.
2010-07-21 17:40:37 -04:00
Carl Worth c0ca2bfb2a dri2: Remove an unused variable.
To quiet a compiler warning.
2010-07-21 13:17:05 -07:00
Kristian Høgsberg 3750ebd540 glx: Fix drawable lookup in DRI2 event handler
DRI2 events are sent to the X drawable ID used to create the DRI2 drawable,
not the GLX drawable ID.  So when an event comes in, we need to look up
the __GLXDRIdrawable by its X drawable ID, which needs a new hash table.
2010-07-19 09:37:38 -04:00
Nick Bowler f8d81c31ce dri2: Track event mask in client code.
When direct rendering is being used, DRI2 BufferSwapComplete events are
sent unconditionally to clients, even if they haven't been requested.
This causes error messages to be printed by every freeglut application
of the form

  freeglut (./gears): Unknown X event type: 104

and might confuse other clients.

This is a fixed up version of the patch by Jesse Barnes, which drops
BufferSwapComplete events if they are not requested by clients.

Fixes fdo bug 27962.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-07-14 10:23:09 -07:00
Fernando Carrijo d2fe97a209 mesa: Purge macros NEED_EVENTS and NEED_REPLIES
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-07-01 13:07:07 -06:00
Jesse Barnes 157bdd1446 DRI2: report swap events correctly in direct rendered case
In the direct rendered case, we need to convert DRI2 swap complete
events to GLX events for the client to consume.  This path had what
looks like a stray "& 0x75" from some earlier debugging that prevented
clients from seeing the right event code.
2010-04-13 09:39:28 -07:00
Ian Romanick 42ea25cb4e Update to final names from GLX_INTEL_swap_event spec
Fixes bug #27454.
2010-04-04 23:06:01 -07:00
Kristian Høgsberg 094c6fbc45 glx: Suppress BadDrawable from DRI2CopyRegion
This can happen when an X window is destroyed behind our back.  We use
DRI2CopyRegion behind the scenes in many places (like flushing the fake
front to the real front) so we have to ignore X errors triggered in that
case.

The glean test cases trigger this consistently as they don't destroy the
GLX drawable nicely, they just destroy the X window.
2010-03-22 22:04:23 -04:00
Kristian Høgsberg 846cf49522 glx: Fix a couple of warnings 2010-02-16 10:38:50 -05:00
Kristian Høgsberg 215d0dae61 glx: Only register wire handlers for the events the server supports 2010-02-16 10:38:50 -05:00
Francisco Jerez 61d26bc82e dri2: Event driven buffer validation.
When a buffer invalidation event is received from the X server, the
"invalidate" hook of the DRI2 flush extension is executed: A generic
implementation (dri2InvalidateDrawable) is provided that just bumps
the "pStamp" sequence number in __DRIdrawableRec.

For old servers not supporting buffer invalidation events, the
invalidate hook will be called before flushing the fake front/back
buffer (that's typically once per frame -- not a lot worse than the
situation we were in before).

No effort has been made on preserving backwards compatibility with
version 2 of the flush extension, but I think it's acceptable because
AFAIK no released stack is making use of it.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-16 10:38:50 -05:00
Kristian Høgsberg 6e8897ff9f Retire miniglx and move the actual glx code up to src/glx 2010-02-09 09:58:36 -05:00
Renamed from src/glx/x11/dri2.c (Browse further)